Is creating multiple PouchDB databases on the same application considered bad design?

╄→гoц情女王★ 提交于 2019-12-04 02:52:10

Is creating multiple PouchDB databases on the same application considered bad design?

In a word: No.

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

Consider a theoretical Offline-first/mobile app which tracks an agent's sales. It may have a database for inventory management purposes, which is synchronized with a central CouchDB server.

It will likely also have a per-agent database, with client and sales info for a given agent.

The PouchDB app will need both databases. And due to the design of CouchDB, there's no (easy, sane) way to keep those data sets in the same database, and keep agent's records separate from each other.

Databases in CouchDB/PouchDB are more like tables than databases in an RDBMS.

The only real limiting factor for creating additional databases in PouchDB (which doesn't apply to CouchDB), is that there's no easy way to list your existing databases, except with the use of plugin. This needn't be a real limitation--it just means you need to remember which databases you've created (you probably shouldn't be programatically creating randomly-named databases... but that would probably be a bad design anyway. ;-) )

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!