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 :)
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。