zoukankan      html  css  js  c++  java
  • 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.
    Direct_connection

    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.
    Server_side_application

    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.
    Web_application
    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.
    Cloud_Integration

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

  • 相关阅读:
    Android 拍照 代码实例
    利用Android手机里的摄像头进行拍照
    看视频时,类加载器没太理解,现在再整理下几个要点
    关于java设计模式与极品飞车游戏的思考
    【Mood-3】心声
    源自梦想 eclipse快捷键整理
    2020重新出发,JAVA语言,JAVA的诞生和发展史
    2020重新出发,序章: 语言的诞生
    2020重新出发,JAVA学前了解,DOS常用命令
    2020重新出发,JAVA学前了解,Windosws常用快捷键
  • 原文地址:https://www.cnblogs.com/stephen-init/p/4007987.html
Copyright © 2011-2022 走看看