Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There are many problems with WAL, as acknowledged by Dr. Hipp in the recent olap/duckdb paper.

The chief problem that I see with WAL is that it breaks ACID with databases that are ATTACHed, as the documentation shows:

https://sqlite.org/lang_attach.html



What are the other problems?


OK, I'll download the PDF onto my phone and get the quote...

...I forgot how significant these problems are. These are quite serious.

"However, WAL mode has notable disadvantages. To accelerate searching the WAL, SQLite creates a WAL index in shared memory. This improves the performance of read transactions, but the use of shared memory requires that all readers must be on the same machine. Thus, WAL mode does not work on a network filesystem. It is not possible to change the page size after entering WAL mode. In addition, WAL mode comes with the added complexity of checkpoint operations and additional files to store the WAL and the WAL index."

https://vldb.org/pvldb/volumes/15/paper/SQLite%3A%20Past%2C%...

https://news.ycombinator.com/item?id=32684424


It also complicates backups. I have another process that .backups the database but even when opening it in read-only it creates a .wal file. My first version of the backup script didn't delete it afterwards and the normal process didn't have the right to overwrite the backup's wal file so opening the db failed


Maybe adjust the umask of the backup process?


How often is attach really used though?


How often are distributed transactions used elsewhere with two-phase commit?

All the time. I suspect this is similar.


Right but that’s bending SQLite a lot no? I mean it’s meant to be used as a file that has a sql interface. But I digress.


I wonder how many times SQLite has been passed over for a more complex solution because people thought they needed highly scalable distributed two phase commit or whatever when all they really needed was a file with an SQL interface


I'm guessing your response was sarcastic. I don't get it, though. If you need a distributed two-phase commit DB get one like CockroachDB or something like that. SQLite is not that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: