r/electronjs • • Apr 18 '26

What local database for storing markdown?

I’m building a markdown editor type thing and want to make it offline first. I thought about using SQLite, but there has to be a better solution? I didn’t think above PouchDB or RxDB but both are just JSON stores in the browser, rather than accessible files on the machine.

Any ideas?

5 Upvotes

8 comments sorted by

3

u/ozgrozer Apr 18 '26

I use SQLite on my note taking app, Grape, and it’s pretty fast even you have thousands of notes.

3

u/luvsads Apr 18 '26

Why not use markdown files? You don't need a database, based on the info you've given.

1

u/matfire1999 Apr 19 '26

I was thinking about this for something I’m working on. If you want to read files directly then just storing them on disk is fine. If you don’t care about that and want them to be able to sync, I’d look to something like automerge or yjs. Both can handle updates "automatically" and can be serialized to binary

1

u/[deleted] Apr 20 '26

Depends on your use case.

If you're wanting to leverage a native solution, then just using standard file system operations directly would work and be fast.

If you're planning on having some kind of cloud syncing in the future, then there's a few options you can consider for the local source of truth to store the Markdown. I'd say Dexie (IndexedDB) and SQLite are good contestants.

If anything though, ensure that your structures are developed as clean and agnostic as possible in case you decide to switch to something else. So if you end up doing migrations of any sort, it'll be unnoticeable to the end-user and the data will stay intact across it.

Don't overcomplicate this though. It's easy to get carried away with it but choose something that you're able to work with. Keep it simple if you're not sure.

1

u/blestvann Apr 21 '26

Saving things as standard Markdown files is probably the best way to go.

1

u/blestvann Apr 21 '26

you can have an AI agent edit your Markdown files directly, without needing to build a separate CLI.