Live data from Hacker News

SQLite's File Format

sqlite.org

31–40 of 86 posts

Re: SQLite's File Format

#31
post #18

Any recommendations from HN for a write-once (literally once), data storage format that's suitable for network storage? sqlite docs recommend avoiding using it on network storage, though from what I can gather, it's less of an issue if you're truly only doing reads (meaning I could create it locally and then copy it to network storage). Apache Parquet seems promising, and it seems to support indexing now which is an…

SQLite does work on NFS even in read-write scenario. Discovered by accident, but my statement still holds. The WAL mode is explicitly not supported over network filesystems, but I guess you don't expect it to :)

Re: SQLite's File Format

#33

> From the official SQLite Database File Format page. The maximum size database would be 4294967294 pages at 65536 bytes per page or 281,474,976,579,584 bytes (about 281 terabytes ). Usually SQLite will hit the maximum file size limit of the underlying filesystem or disk hardware long before it hits its own internal size limit.

The kioxia lc9 is sold with capacities up to 245TB, so we are like 1 year max away from having a single disk with more than 281TB

Re: SQLite's File Format

#34
post #4

Earlier quoted context omitted.

"Usually"? I'm not saying there are literally no computers in existence that might have this much space on a single filesystem, but...has there ever been a known case of someone hitting this limit with a single SQLite file?

That's just 10 30TB HDDs. Throw in two more for redundancy and mount them in a single zfs raidz2 (a fancy RAID6). At about $600 per drive that's just $7200. Half that if you go with 28TB refurbished drives (throw in another drive to make up for lost capacity). That is in the realm of lots of people's hobby projects (mostly people who end up on /r/datahoarder). If you aren't into home-built NAS hardware you can even d…

Last week I threw together a 840TB system to do a data migration. $1500 used 36-bay 4U, 36 refurbished Exos X28 drives, 3x12 RAIDz2. $15000 all in.

Re: SQLite's File Format

#35
post #27
post #23

Earlier quoted context omitted.

> poorly designed storage layer, poorly designed column formats, and a terrible SQL implementation Is this opinion shared by others?

Dr. Hipp has said several times that nobody expected a weakly-typed database to achieve the pervasiveness that is observed with SQLite. At the same time, strict tables address some of the concern of those coming from conventional databases. Dates and times are a core problem to SQLite not seen elsewhere as far as I know, but this does evade UTC and constantly shifting regional time. My OS gets timezone updates every…

While nobody expected it … it should not be unexpected.

Typically, the Lowest-Common-Denominator wins mass appeal/uasge.

By not having safety checks and even typing enforcement, SQLite caters to actually more use cases than less.

Re: SQLite's File Format

#36

SQLite is a great example of a single factor mattering more than everything else combined. A database contained in a single file is such a good idea that it outweighs a poorly designed storage layer, poorly designed column formats, and a terrible SQL implementation. If craftsmanship is measured by the long tail of good choices that give something a polished and pristine feel, then SQLite was built with none of it. An…

Firebird also fits the bill, I think, but never took off. Firebird even supports client-server deployments.

Re: SQLite's File Format

#37
post #18

Any recommendations from HN for a write-once (literally once), data storage format that's suitable for network storage? sqlite docs recommend avoiding using it on network storage, though from what I can gather, it's less of an issue if you're truly only doing reads (meaning I could create it locally and then copy it to network storage). Apache Parquet seems promising, and it seems to support indexing now which is an…

SQLite does work on NFS even in read-write scenario. Discovered by accident, but my statement still holds. The WAL mode is explicitly not supported over network filesystems, but I guess you don't expect it to :)

My experience has been the opposite... Lots of db lock and corruption issues. The FAQ doesn't call out WAL specifically, just says don't do it at all: https://www.sqlite.org/faq.html#q5

Re: SQLite's File Format

#38
post #18

Any recommendations from HN for a write-once (literally once), data storage format that's suitable for network storage? sqlite docs recommend avoiding using it on network storage, though from what I can gather, it's less of an issue if you're truly only doing reads (meaning I could create it locally and then copy it to network storage). Apache Parquet seems promising, and it seems to support indexing now which is an…

Parquet files are what I use.

Re: SQLite's File Format

#39

The neatest thing i seen is you can put a sqlite db on a http server and read it effectively using range requests

In my experience, this works when the db is read only.

And in these read only cases I'd use Parquet files queried with Duckdb Wasm.

Re: SQLite's File Format

#40
post #19

SQLite is a great example of a single factor mattering more than everything else combined. A database contained in a single file is such a good idea that it outweighs a poorly designed storage layer, poorly designed column formats, and a terrible SQL implementation. If craftsmanship is measured by the long tail of good choices that give something a polished and pristine feel, then SQLite was built with none of it. An…

Digital Equipment Corporation sold a SQL database known as Rdb that could also run as a single file. It was the first database to introduce a cost-based optimizer, and ran under both VMS and Digital UNIX. Oracle bought it, and VMS versions are still supported. https://www.oracle.com/database/technologies/related/rdb.htm... https://en.m.wikipedia.org/wiki/Oracle_Rdb (My employer is still using the VMS version.)

Oh! RDB was the first database I worked with. I forgot all about it. I do remember refactoring the data layer so that it also worked with Berkeley DB, which is also owned by Oracle now. Or maybe it was the other way around? There was no SQL involved in that particular application so it was just a K/V store. Working with a local data file was the primary design goal, no client/server stuff was even on the radar. SQLite would have been perfect if it had existed.
Post reply on HN