From 4b6c0e31385f5f27a151088c0a2b614495c4e589 Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Thu, 14 Oct 2021 12:47:50 -0400 Subject: initial commit, including theme --- .../2004-10-09-sqlite-db-locking-a-problem.html | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 content/posts/2004-10-09-sqlite-db-locking-a-problem.html (limited to 'content/posts/2004-10-09-sqlite-db-locking-a-problem.html') diff --git a/content/posts/2004-10-09-sqlite-db-locking-a-problem.html b/content/posts/2004-10-09-sqlite-db-locking-a-problem.html new file mode 100644 index 0000000..5c15e44 --- /dev/null +++ b/content/posts/2004-10-09-sqlite-db-locking-a-problem.html @@ -0,0 +1,24 @@ +--- +date: "2004-10-09T22:22:38Z" +title: SQLite DB-Locking a Problem? +--- + +

+I've been playing with SQLite for the last couple of days. I'm trying to figure out if it's a suitable replacement for the ad-hoc storage format I've got for Raggle. SQLite has a lot of benefits: it's fast, small (the , and free (public domain). It supports sub-selects, atomic transactions, and there's a complete set of Ruby bindings (which are available as a Gem, but not as a Debian package... go figure). Of course all this goodness doesn't come without caveats. Specifically, here's the one that might be a problem for me: +

+ +
+

+Locking in SQLite is very course-grained. SQLite locks the entire database. Big database servers (PostgreSQL, Oracle, etc.) generally have finer grained locking, such as locking on a single table or a single row within a table. If you have a massively parallel database application, you should consider using a big database server instead of SQLite. +

+ +

+Source: SQLite FAQ +

+
+ +

+Raggle isn't a "massively parallel database application", but it can have up to N threads (where N is the number of feeds a user is subscribed to) attempting to write to the feed list simultaneously. I can probably queue database inserts and limit the threads to SELECTing from their respective tables, but that smacks of hackery, which is what I was trying to avoid in the first place. I guess it's still a better solution than what Raggle does right now. Ah well, C'est la vie. +

+ -- cgit v1.2.3