Shared database

Asked

Viewed 947 times

1

First of all, I have no experience with databases. Well, my question is the following, how to create a database for an android application, in which data registered in it, could be accessed by all those who have the app installed? I have to find a server to host this right bank?

  • You need a BD that can be accessed online, so you sync the local BD of the users device with the online BD whenever possible.

  • You would have to look for a Database Hosting and Management Service, "www.rackspace.com" offers this type of service, among other hosting companies.

1 answer

0


Using a database directly over the Internet is possible, but very risky in terms of security and reliability. I believe that traditional Mysql-like banks assume a stable connection between client and server.

You need a "three-Tier" architecture, or three layers, where the phone connects to an application server, which in turn talks to the database (which can run on the same server machine).

The state of current technology encourages using the following solution: an HTTP server, which can be written in PHP or Node.js; a JSON protocol between client and server (you would have to design this protocol, but there are plenty of examples to imitate, it might be worth checking the REST and CRUD patterns that might apply to your case).

The use of JSON as the basis of the protocol, and HTTP as a network service, makes things easier because you’ll find the tools easily. Every language has a JSON parser and facilities for communicating via HTTP. The other advantage is that each HTTP request is a separate TCP/IP connection, which helps a lot with the issue of reliability (the Internet only needs to be active at the time of the request, not during the time the user is using your app, as would be the case if your app connected directly to a remote Mysql server)

Finally, there may be databases with HTTP direct interface, REST or CRUD style, which would save you from developing the application HTTP server. I also found this product; http://www.slashdb.com/ that basically does this (adapts any database to an HTTP API). I’d rather create an intermediate application server so my app wouldn’t get too tied to a particular database, but each project has its priorities.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.