Full-stack development of retreats

Source: Internet
Author: User
Tags oauth drupal

When you want to develop an app, the following three choices are generally

One: own development of client and server all parts

1: Client (APP)

1.1 Local Development: iOS with Oc/swift development, Android with Java development; The need to invoke third-party lib (c/C + +): If you call too many functions, it is recommended to use Swig (especially Java calls C + +), you can save a lot of trouble: of course, more than a layer of function calls, performance is actually not much.

1.2 Hybrid development: For apps with low performance requirements (in addition to games/audio and video): Most can be mixed-use (mostly JS) support for iOS and Android, or more platforms. There are many kinds of hybrid development: Today's more popular open source is the Apache Cordova (Ionic on Angular on Cordova) and Facebook's react Native. The advantage of hybrid development is that a set of JS APIs (including UI and lower-level hardware calls) can support multiple platforms, and a JS developer can develop Ios/android/other apps at the same time. The downside is that the app user experience is not good for high performance. React native can directly invoke native API's mechanism is destined to be better than Cordova WebView performance, as for other mixed development or commercial software or support is not good, not to mention.

Note: If your app needs to integrate with third-party APIs, be aware that third-party APIs support JS

1.3 and server communication: Regardless of whether you are using local or hybrid development, you must first consider how to communicate with the server

1) Socket based communication

2) using sockets (or WebSocket)-based protocols: Xmpp/sip or MQTT

3) http/restful (need to use the server's custom interface): RPC has basically been replaced by rest

2: Server

Servers typically consist of three tiers, load balancing server clusters, Business Server clusters, database server clusters

2.1: Load Balancing: General open source use Lvs/nginx/haproxy cluster, commercial has F5; Communication with the client and 1.3 consistent

2.2 Business Server Clusters

1) Real-time end-to-end business: The cluster server needs to save the user's current connection server: For example, chat Server user 1 registered on Server A, user 2 registered in Server B, if 1 to call 2, server A need to know 2 is currently in

Server B has a TCP connection and sends the received User 1 signaling to the server b,b to 2; This kind of cluster generally holds the user's current connection data in one or several servers, and the Business Server needs direct communication .

2) non-real-time end-to-end business: 1 can be used to achieve the method; Because the delay of the message can be tolerated, the business Server can not communicate directly, by the message queue (ZEROMQ/NANOMSG,MESSAGEMQ, etc.) to process all the messages

3) Non-end-to-end business: For example, the Web site, the Business Server does not need any communication between the current business is popular to provide a rest interface for the app to call directly

2.3 Database Server

1) SQL

2) The Nosql:cap theorem divides Nosql into several types, choosing according to their needs

    • Consistency (consistency) (all nodes have the same data at the same time)
    • Availability (availability) (Ensure that each request responds regardless of success or failure)
    • Segregation tolerance (Partition tolerance) (loss or failure of any information in the system will not affect the continued operation of the system)

3) Real-time database: RETHINKDB

2.4 Cache server: Before the Business Server and database server can increase the cache server to improve performance: Redis/memcache, Nginx

2.5 Big Data Analysis Server: The user's behavioral data needs to be analyzed, when the data volume is very large, it needs the architecture of big data, this kind of server belongs to the internal business of the company, it is not necessary for many companies. The link below is what I see

Big data in the context of the more vivid, suitable for the concept of small white popularization, the technology of the Internet rapidly changing need to track new technology

http://www.zhihu.com/question/27974418

Two: Develop client UI yourself, two times develop server with client API

1: Client (APP)

1.1 and server communication:

1) based on the encapsulated socket communication: For example, ZEROMQ, the upper layer of the protocol needs its own design

2) using sockets (or WebSocket)-based protocols: Xmpp/sip or MQTT

3) Use the RESTful interface provided by the server

2: Server cluster

2.1 Load Balancing: Business-based cloud services

Web Services Some out-of-the-box framework can be selected Php:drupal js:express, etc., some framework integration of OAuth saves complex user authentication

Other business depends on the selection of technology

2.2 Business Server clusters and database server clusters

1) Integration of the two:

Web Services Some out-of-the-box framework can choose Php:drupal js:express and so on, some frameworks integrate OAuth saves complex user authentication, other business depends on technology selection

2) Separate: The database server cluster uses the commercial cloud service

2.3 Cache Servers: Cloud services for commercial use

Three: Develop client and server side with unified API

Up to now, some users feel that the development of the app is still more trouble, fantasy that the code written on a machine can be used at the same time on the client and server side, do not need to consider the interface between the two;

Is it possible? Of course, if your business is not very high performance requirements (can be developed with JS), with Meteor Bar, it was born.

The above is the concept of some of the nature of things, are also open source products, is only a beginner's introductory article. The following will be written in more detail: Client technology selection, server cluster technology selection, NoSQL technology selection, etc.

Full-stack development of retreats

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.