Sql lite vs mysql db

In android development, and when is it useful to use sql lite vs web server db? If a person uninstalls an application or updates my application, then db will be deleted if I use sql lite?

Thank you very much

+4
source share
3 answers

Use sql lite. Android supports it.

The sqlite database is just a file on an SDCard. It is not tied to the application, so uninstalling and / or updating the application does not affect the database. (if you did not write an update code to update your db :))

Sqlite is easy to use, compact and, obviously, can be easily stored on an SDCard. The ability to connect to it, etc. Runs in android.

You only need a web server database if you are going to share information from your application between devices / people. If data is only needed for your local device, then definitely use sqlite.

+4
source

It will not be deleted. Instead, the onUpgrade method will be launched so that you can check the database versions and make the correct changes in the current database (updates, data migration, etc.).

The presence or absence of a service in the cloud, to which you can synchronize it with a question that you must answer yourself. This question may help you understand the correct answer.

  • Does your product / service need to share data with other applications?
  • Will your product / service be cross-platform?
  • Is this an advantage of your product / service for exchanging data with other services?
+2
source

It depends on the application you are building. If you want to create an application that will update or save data in the cloud, then yes use mysql on the web server. If you want to create an application where data will only be available locally on your phone, use SQLite.

0
source

Source: https://habr.com/ru/post/1432578/


All Articles