mobile app 与server通信的四种方式

Have you ever wondered how the information gets into the application installed in your mobile device, how it is updated, and how it is synchronized with your account in the web application on the desktop? If you think that this is a case of miracle then it is time to know the truth.

How is it possible to comprise the database of 1000GB (no current mobile device can handle such an amount of space) into an application weighting 50KB? Impossible?

Let’s take a real example. The database of the famous Facebook equals to 25TB and is stored on several servers. In other words, it can be translated as if the Facebook DB could be stored in about 3200 USB flash cards with capacity of 8GB (a standard size of your photo camera flash card). Only imagine this amount! And on the opposite end, we can see your mobile application for this social media that is only about 7MB.

So, what are the options of communication between your mobile device and a remote storage?

In fact, there are several ways how to do this.

Here are several possible variants among which to choose depending on the business goals.

1. Direct Connection(telnet/ssh)

The mobile application directly connects to the server database to get respond. To ensure the confidentiality the SSH or another encryption type can be used.

Features:

  • Direct connection using standard telnet/ssh;
  • User verification via simple login/password;
  • UI commands converted to server commands.

Advantages:

  • Simple;
  • No additional costs on developing of the back-end applications;
  • No additional costs on maintaining of the additional hardware.

Disadvantages:

      - No scalability;
      - Can’t have access to external servers or databases (cloud access);
    - Has the only functionality of the standard telnet/ssh protocol.

2. Server-side application(socket)

The mobile application directly connects to the server -side
application that is in simple words a software program running on a
remote server.

Features:

      • Direct connection to a server-side application;
      • User verification via simple/secure login/password;
    • UI commands converted to server application commands.

Advantages:

  • Direct connection;
  • Can use external resources (servers, databases) using in-app connection from the server side;
  • No additional costs on maintaining of the additional hardware.

Disadvantages:

- Scaling is possible, but is time and effort consumable;
- More complex and has no built-in possibilities for using in a cloud infrastructure;
- Require developing of the back end application;
- Back end application should be placed on the controllable server.

3. Web application(HTTP传送数据报可以是http数据或者JSON、XML。最常用这种!!!)

The mobile application can communicate with the same web application to get information from it.

Features:

• Using of a web services via specialized API;
• User verification via simple/secure login/password;
• UI commands converted to API requests.

Advantages:

  • Using of REST API;
  • Easy to develop the client side;
  • Can use external resources (servers, databases) using connection from the server side;
  • No additional costs on maintaining of the additional hardware;
  • Back end part can be placed on the controllable server, or on a dedicated one;
  • Easily scalable.

Disadvantages:

- More complex.

* Note: Require developing of the back end web application and API services

4. Cloud Integration( SOAP??)

With Cloud Infrastructure as a Service, your organization actually
receives a private cloud that is quite similar to the classic
understanding of clouds but is used only for your company purposes and
has better security.

Features:

• Connect to a cloud using it’s services (API);
• User verification via simple/secure login/password;
• UI commands converted to cloud API commands.

Advantages:

  • Using of REST API;
  • Easy to develop the client side;
  • Can use external resources (servers, databases) using cloud services;
  • Can access all of the services provided in a cloud;
  • Can gain access to every computer in a cloud according to user permissions;
  • Extremely scalable;
  • Extremely reliable and solid.

Disadvantages:

- Very complex
- Require developing of a cloud services;
- Require maintaining of a cloud hardware;
- Time and cost consumable.

Shh! Don’t tell anybody! We just have opened you a secret of where
the information that got into your smartphones and tablets was stored in
reality. With no cables, no surgical manipulation, and no pigeon
express. It has been again all about high technologies.

As reported by world IT statistics and experts, the mobile industry
is on the rise and promises to continue evolving for several further
years at least. There are still many open challenges and a big space for
extension in mobile application development including the storage and
security spheres, but, hopefully, IT guys will amaze us with something
new :)

时间: 2024-11-10 00:14:15

mobile app 与server通信的四种方式的相关文章

*Android跨进程通信的四种方式

由于android系统中应用程序之间不能共享内存.因此,在不同应用程序之间交互数据(跨进程通讯)就稍微麻烦一些.在android SDK中提供了4种用于跨进程通讯的方式.这4种方式正好对应于android系统中4种应用程序组件:Activity.Content Provider.Broadcast和Service.其中Activity可以跨进程调用其他应用程序的Activity:Content Provider可以跨进程访问其他应用程序中的数据(以Cursor对象形式返回),当然,也可以对其他应

关于APP性能测试脚本录制的四种方法

大家好,近段时间很多人问我关于APP性能测试方面问题.一直是打算发表的,由于多方面的因素拖到现在,有次公司让我给客户讲解APP性能测试,回来后就一直觉得有必要写下.好了,不多废话. 目前版本LoadRunner12有图下4种方式生成脚本. Recording and Analyze Traffic Analyze Traffic Record Emulator Proxy Recording 第一种:Record and Analyze Traffic 在电脑上设置wifi热点,需将网络共享到该

.net core 2.x - 缓存的四种方式

其实这些微软docs都有现成的,但是现在的人想对浮躁些,去看的不会太多,所以这里就再记录下 ,大家一起懒一起浮躁,呵呵. 0.基础知识 通过减少生成内容所需的工作,缓存可以显著提高应用的性能和可伸缩性. 缓存对不经常更改的数据效果最佳. 缓存生成的数据副本的返回速度可以比从原始源返回更快. 在编写并测试应用时,应避免依赖缓存的数据.ASP.NET Core 支持多种不同的缓存. 最简单的缓存基于 IMemoryCache,它表示存储在 Web 服务器内存中的缓存. 在包含多个服务器的服务器场上运

Android——数据存储(四种方式之一)SharedPrefereces

Android--数据存储(四种方式) 1.SharedPrefereces   轻量级.XML  存储文件名,数据保存在data/data/basepackage/shared_prefs/myopt.xml中   实例-收藏-记住密码自动登录 //一种轻量级的数据存储方式//通过KEY 存入数据--putxxxx(key,value) 取出数据--getxxxx(key  default)   2.读写SD卡  SD的根目录  适用于数据流读写 3.SQLite  轻量级.dp文件多用于手机

Android中多线程的使用四种方式最全总结

当我们启动一个App的时候,Android系统会启动一个Linux Process,该Process包含一个Thread,称为UI Thread或Main Thread.通常一个应用的所有组件都运行在这一个Process中,当然,你可以通过修改四大组件在Manifest.xml中的代码块(<activity><service><provider><receiver>)中的android:process属性指定其运行在不同的process中.当一个组件在启动的

Android——数据存储(四种方式之二)读写SD卡

Android--数据存储(四种方式) 1.SharedPrefereces 只能保存一些简单的数轻量级.XML  存储文件名, 数据保存在data/data/basepackage/shared_prefs/myopt.xml中    实例-收藏-记住密码自动登录 //一种轻量级的数据存储方式//通过KEY 存入数据--putxxxx(key,value) 取出数据--getxxxx(key  default) 2.读写SD卡  SD的根目录  适用于数据流读写 实现步骤:加入读写SD卡权限

【Java EE 学习第80天】【调用WebService服务的四种方式】

不考虑第三方框架,如果只使用JDK提供的API,那么可以使用三种方式调用WebService服务:另外还可以使用Ajax调用WebService服务. 预备工作:开启WebService服务,使用jdk命令wsimport生成调用源代码 package com.kdyzm.ws; import javax.jws.WebService; import javax.xml.ws.Endpoint; @WebService public class MyWsServer { public Strin

VirtualBox虚拟机网络设置(四种方式)(转)

VirtualBox虚拟机网络设置(四种方式) 来自:  2010-11-10 23:30:11 VirtualBox的提供了四种网络接入模式,它们分别是: 1.NAT 网络地址转换模式(NAT,Network Address Translation) 2.Bridged Adapter 桥接模式 3.Internal 内部网络模式 4.Host-only Adapter 主机模式 第一种 NAT模式 解释: NAT模式是最简单的实现虚拟机上网的方式,你可以这样理解:Vhost访问网络的所有数

android 定位的四种方式

[原文] 开发中对于地图及地理位置的定位是我们经常要用地,地图功能的使用使得我们应用功能更加完善,下面总结了一下网络中现有对于介绍android定位的4种方式,希望对大家有帮助: android 定位一般有四种方法,这四种方式分别是:GPS定位,WIFI定准,基站定位,AGPS定位,                             (1)Android GPS:需要GPS硬件支持,直接和卫星交互来获取当前经纬度,这种方式需要手机支持GPS模块(现在大部分的智能机应该都有了).通过GPS方