←back to thread

353 points HunOL | 1 comments | | HN request time: 0s | source
Show context
mickeyp ◴[] No.45781619[source]
SQLite is a cracking database -- I love it -- that is let down by its awful defaults in service of 'backwards compatibility.'

You need a brace of PRAGMAs to get it to behave reasonably sanely if you do anything serious with it.

replies(2): >>45781956 #>>45781998 #
mkoubaa ◴[] No.45781998[source]
Seems like it's asking to be forked
replies(3): >>45782143 #>>45782341 #>>45783433 #
pstuart ◴[] No.45783433[source]
The real fork is DuckDB in a way, it has SQLite compatibility and so much more.

The SQLite team also has 2 branches that address concurrency that may someday merge to trunk, but by their very nature they are quite conservative and it may never happen unless they feel it passes muster.

https://www.sqlite.org/src/doc/begin-concurrent/doc/begin_co... https://sqlite.org/hctree/doc/hctree/doc/hctree/index.html

As to the problem that prompted the article, there's another way of addressing the problem that is kind of a kludge but is guaranteed to work in scenarios like theirs: Have each thread in the parallel scan write to it's own temporary database and then bulk import them once the scan is done.

It's easy to get hung up on having "a database" but sharding to different files by use is trivial to do.

Another thing to bear in mind with a lot of SQLite use cases is that the data is effectively read only save for occasional updates. Read only databases are a lot easier to deal with regarding locking.

replies(3): >>45783708 #>>45783826 #>>45790073 #
1. Kinrany ◴[] No.45783826[source]
> Read only databases are a lot easier to deal with regarding locking.

"A lot easier" sounds like an understatement. What's there to lock when the data is read only?