Skip to content

Comment on SQLite as a Document Database (2020)parent

Comments

Did it end up becoming more painful than just writing the SQL?

It almost always does. People put so much effort into building layers of abstractions to avoid using SQL, while just writing it directly would be much faster, easier, more readable, easier to maintain, modify, and debug. I do not get it.

It almost always does. People put so much effort into building layers of abstractions to avoid using SQL, while just writing it directly would be much faster, easier, more readable, easier to maintain, modify, and debug. I do not get it.

When your data is literally hierarchical and all you need to do is read/write one Big Object, "just using SQL" makes no sense.

I used SQLite because it makes a lot of sense to use as an application file format[1], i.e. as an alternative to writing directly to the filesystem.

The hierarchical data was a mix of parameters and huge blobs, so text-based JSON was a no-go, size-limited BSON was a no-go, at which point I asked myself if there was a reason to not just use SQLite, and found none.

[1] https://sqlite.org/appfileformat.html

No it did not. The data wasn't relational.

The ORM was the smallest part of it, I could have written/read from JSON too, but SQLite was just a far better choice for a mix of structured data and big blobs.

The thing it replaced was writing to a file at a predetermined offsets. Which became very fun as the file format changed between versions and backwards compatibility needed to be maintained.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.