Does multiple PouchDB databases create bad design in the same application?

I came from the background of Mysql and now I am using Pouchdb. I'm used to the SQL template, having 1 database and lots of tables for each application.

In pouchDB, this is different because data is not stored in tables, but in documents. So, in my application, I have a database for tasks created using:

var db = new PouchDB('tasks', {revs_limit: 1, auto_compaction: true});

This is the main database for my application, but now I also need to save the settings, such as "last_visit_date", "language_preference" and others.


So, I have 2 questions:

  • Should I create only one database and then store different data
    sets of sub-sites or can I create several databases to store this data. Are there any flaws in the second option?
  • While I do not synchronize with cloud or couchdb, but I will be in the future. If I have 2 databases (or more), will this make the synchronization process more complicated, slower or worse somehow?
+6
source share
1 answer

Does multiple PouchDB databases create bad design in the same application?

In a word: None.

Long answer: Databases in CouchDB / PouchDB are almost free. And some application projects require multiple databases.

Consider a theoretical standalone-first / mobile app that tracks agent sales. It may have a database for inventory management purposes that synchronizes with the central CouchDB server.

, , .

PouchDB . CouchDB (, ) .

CouchDB/PouchDB , .

PouchDB ( CouchDB) , , . - , , (, , ... , , .; -))

+7

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


All Articles