Suppose we have an application that may contain a large amount of heterogeneous data (text records, drawing on the screen, lists, photos, etc.). However, we certainly will not unload all the data at once, but only those that are needed at the moment.

In this case, is it worth trying to stuff all the data into one database with a large number of tables, or is it reasonable to make several databases and fewer tables?

  • What are we talking about a large number of this what ?? - elik
  • How many 10 thousand rows of columns are you talking about? - elik
  • Make it convenient for you there are no rules, but in order not to get confused it’s better to use a remote type Mysql database and it will have a background via php myadmin that will make it easier to manage - elik
  • “Large number” in this question means a large variety of data types that do not allow storing them in a single log. - Lateral Gleb

1 answer 1

In my opinion, everything should be stored in one database. But I saw that sometimes people make two databases. This approach has both pros and cons.

Minuses:

  • It is necessary to store two singleton, which will work with their SQLiteOpenHelper.
  • If you need to link data from different databases, then you will need to make at least two queries to different databases.

Pros:

  • Sometimes this database is locked error occurs. And if you write from two streams of different connections, an error will occur - your data will not be written to the database, and the application will crash with a SQLiteDatabaseLockedException. I have seen how two problems are solved with the help of two databases.

But in my version this plus is dubious.

  • Thank you for your reply! The first minus is, of course, substantial. - Bokov Gleb
  • one
    Well yes. But it seems to me just not logical for one application to do different databases. I have a library to display the database, and they wrote about how I would display several databases. github.com/pavel163/ProbeTools - pavel163