码迷,mamicode.com
首页 > 移动开发 > 详细

mobile app 与server通信的四种方式

时间:2014-10-06 11:26:00      阅读:310      评论:0      收藏:0      [点我收藏+]

标签:des   style   http   color   io   os   ar   for   strong   

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.
bubuko.com,布布扣

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.
bubuko.com,布布扣

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.
bubuko.com,布布扣
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.
bubuko.com,布布扣

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 :)

mobile app 与server通信的四种方式

标签:des   style   http   color   io   os   ar   for   strong   

原文地址:http://www.cnblogs.com/stephen-init/p/4007987.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!