rafaelespinoza / standardnotes

standardnotes sync server, golang
MIT License
1 stars 0 forks source link

Replace database? #1

Open rafaelespinoza opened 4 years ago

rafaelespinoza commented 4 years ago

I'm thinking that this project needs something more robust for production, even if there's just one user in a self-hosted environment. This project uses sqlite now because that's what was used in github.com/tectiv3/standardfile before I started working on this. It turns out I really like it for development. But everything is stored in one file, so it's a little scary that your data is one rm away from obliteration.

If there were ever several users, then the writes incurred during item syncs (especially initial item syncs when a user first logs in to a device) might result in noticeable slowness for all users in those moments. Thinking into the future, any introduction of a network boundary between the db and the application server could bring other issues, such as a dependence on a networked filesystem; from what I understand, the quality of those is not too consistent from platform to platform. This syncing server should not be held back by data corruption concerns when there are tools available.

Not saying these things need to be addressed now, in the near future or ever, but it's something to be aware of. By the way, here's a good article on using sqlite.

John3 commented 4 years ago

(I came here just by chance looking to self-hosted sn)

I don't know the cons of using SQLite I not self-host SN. But what I found very nice in other note taking apps, is precisely that, everything in one file (sqlite), is way more easy to backup or do some management. I try to avoid those note taking apps that just trough everything in one folder with hundred of files.

I think you need to define your target user, single user or multi-user, and how will be hosted. If you use other DB like Mariadb for instance, not everyone can easily self-hosted in their PC.

Singleuser, sqlite, one executable will be a nice goal for any user to run a SN server.

rafaelespinoza commented 4 years ago

All good points. Thanks for your input.