Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mobile App - Server Architecture

I want to start a mobile application however I got some questions. I am confused about database connection layer. Should I construct my architecture 2 layered; 1st layer is mobile app (making the database connection in mobile app), 2nd layer is just database. Or 3 layered; 1st is mobile app, 2nd is server (which handles the connection between database and app), 3rd is database.

What are the pros and cons of these two architecture? Thanks in advance

like image 986
Alaattin KAYRAK Avatar asked Feb 06 '12 18:02

Alaattin KAYRAK


People also ask

What is a server for mobile apps?

For mobile technology used by businesses, mobile application servers contain the software that provides access across device types and process important elements of that access such as authentication, security features, and updates.

What are the 3 layers of a mobile web architecture?

Mobile app architecture may incorporate several layers, but it consists of three layers in most cases. Those are the Presentation layer, the Business layer, and the Data layer.

Does a mobile app have a server?

You have to understand that for any communication between web application, mobile application or desktop application, there will always be a server. Even in file sharing applications like shareit, one mobile app works as server and same mobile app elsewhere works as client.

How does a mobile app work server?

What is a Mobile App Server. It's basically a regular server, the only difference is that it is not meant to talk with other computers, but instead, it was built to talk specifically with a single Mobile App (actually it is talking with the user's mobile device, based on interactions with the mobile app).


1 Answers

The only advantage of having the mobile app communicated directly with the database is that it might be faster to implement in the short run.

In the slightly longer run, three layers are a much better choice for several reasons:

  1. Flexibility - have the mobile app work against a service layer (for example, through some JSON APIs) that abstracts the database internals. This will make it much easier to make changes to your schema, even replace the entire data layer, without breaking the mobile clients. This is critical when you release new versions that involve changes to both your mobile app and your data layer, and have some apps out in the field that didn't update yet. A service layer will make support for multiple versions manageable. Working directly with the database would make it very nearly impossible.

  2. Security - managing user logins, permissions etc. is usually not as well supported in the DB as it is in a service layer.

  3. Scalability - should your app succeed and you'll need to scale the server side, a service layer would greatly increase your options (going back to no. 1 - flexibility).

  4. This should be enough to get you convinced, but I'm sure other replies will come up with more :)

Regarding your other questions - recommend a technology/architecture for the server, there are lots of viable options - Ruby, Python, PHP, Node. The "best" depends on what you're already familiar with.

like image 168
Elad Avatar answered Oct 27 '22 19:10

Elad