Consider using sequelize + MySQL/SQLite for storage
pubsweet-backend
currently uses pouchdb
with several plugins: relational-pouch
, pouchdb-find
, pouchdb-upsert
.
PubSweet isn't making much of use of the relational features, or the revision/conflict features of PouchDB (it just uses last-write-wins) and we have to write all the code for keeping relationships in sync manually (see this MR for an example, which also needs the data to be saved in a transaction to avoid the data getting out of sync between User.teams
and Team.members
).
PubSweet also doesn't use pouchdb-server
or express-pouchdb
to expose the PouchDB interface directly to users, as this isn't a single user database.
Given that the data is relational, it probably makes sense to store it in a relational database and use an ORM to handle relationships and syncing changes to the database.
sequelize seems to be fairly mature, though it has lots of open issues and pull requests. There's an example of integration with express.