The Winamp Skin Museum is powered by a SQLite3 database with 1.2GB of metadata
twitter.com
twitter.com
https://spotiamp-lightweight-spotify-player.en.uptodown.com/...
(Required paid Spotify account)
It was interesting, seeing all of the clocks tick, one above another, second after second.
https://github.com/DustinBrett/daedalOS/blob/b1681546a2ce990...
We really need this counter culture in software development that emphasis simplicity over the "Start with Kafka-on-k8s" madness.
What about a real-world workload? For example, I have 10 users a day on my new next.js app so I clearly need a RDS cluster for burst traffic.
Can read more here: https://tailscale.com/blog/database-for-2022/
So if people comment based only on the first paragraph, would they even get to the /s in the end ?
It is hard to do right.
A site like this which is mostly a read-only archive is a perfect use case for SQLite.
Since it's SQLite, it's also trivial to just copy the database file as a snapshot for separate OLAP queries if necessary.
Of course, you can still drive those using a separate snapshot for the read side, to generate an ID set for a follow-up write on the business layer. But now you're doing CQRS — less trivial. You're not getting any of the ACID benefits of doing the OLAP and OLTP queries together in a single transaction; so your data model has to be designed for that (by e.g. having all tables be temporal tables.)
The allowed writer can also impact readers, depending on the WAL mode setting.
For DSS uses, where a data store is published once a day, SQLite is wonderful. For OLTP, look elsewhere.
sqlite has a "busy handler" mechanism which tells it how to respond to blocks and most apps use the builtin one with which they can tell it "wait for X milliseconds before failing on a lock."
The Fossil SCM (https://fossil-scm.org), the SCM in which sqlite itself is hosted, is an sqlite application which serves thousands of users per day, many of them in write transactions. Its forum is a separate sqlite3 instance. sqlite3's own forum is another... all of those serve many users, many of whom are writing, and in 14 years of using/contributing to fossil-scm.org, almost on a daily basis, i've hit exactly two locking errors.
In this case, I doubt there are any writers at all.
You'll want a read cache to avoid repeatedly rendering the same HTML, etc in the frontend, where most CPU is spent. That'll accidentally reduce database load.
Assuming 10% writes (which is really, really write heavy), that'll get you to 1M page views per second. After that, you'll need to rearchitect.
(MySQL and Postgres are probably better choices, but I'd evaluate all three if I was setting this up for real.)
If you have 10k writes a second and 90k reads a second then SQLite is an awful choice.
Given modern commodity servers and no network overhead I’d buy it not being a problem.
My intuition is you are right but given the operational simplicity improvements it would be worth exploring.
I'm currently trying to shame some people at work into acting on the fact that they wrote some code that should take about 1µs per call that is instead taking over 100. If you're stupid with cycles then you get to be stupid with cores too, and then you get to be stupid with locking semantics.
Also I’ve worked on commercial aviation software, and maybe three of us even knew the meaning of the word, so I’m curious what domain you saw it in.
I recently used lmdb for webhighlighter.com (specifically the wrapper: https://www.npmjs.com/package/node-lmdb), and it was a fantastic decision.
A lot of people here say "use SQLite for small projects". But even using SQLite can be significant over-engineering. Running migrations? Writing SQL? That's too much effort for me.
For example: In my application, people can leave comments on a (what is effectively) a post. A SQL-native solution might have a table for comments, with foreign keys to post IDs. That's 10x more engineering then I want to do for an MVP. I just store all the comments as an array on a post. This means reads read all the comments and writes require reading all the comments, appending, and then re-writing. That's totally fine, and will probably scale me to 100x my current traffic.
LMDB-JS is great. It allows you to serialize arbitrary JS objects to LMDB using the message pack encoding system. This makes for some super concise code.
Here's my entire data layer: - Interface: https://github.com/vedantroy/grape-juice/blob/main/site/app/... - Implementation: https://github.com/vedantroy/grape-juice/blob/main/site/app/...
TL;DR -- I won't use SQLite, for, I don't know, my first 10K users?
KV stores are fun but you end up writing a lot of queries and indexes manually
Key-value stores are not a replacement for SQL, they solve a simpler problem. If you actually can do with a key value store I would argue a SQL table with two columns key and value with key being a primary key will do just fine. And using it needs simple select and 'insert on duplicate key update' statements. The effort for migrations won't be higher than whatever you had to configure for your key-value store.
However, if you can't actually do with a key-value store you will end up writing a lot of the features SQL provides in application code. Indices, joins, grouping, ordering, etc. You might not notice it at first, but you will blow up complexity in your business logic reinventing existing SQL features and chances are high you're doing it worse and less performant than what e.g. Postresql offers out of the box.
SQL is just such a powerful tool that is at the same time incredibly easy to use for simple scenarios.
Added benefit of using SQLite, you can migrate to a more powerful SQL database later without having to reengineer your whole data layer.
https://github.com/kriszyp/lmdb-js/discussions/170
I think there's a reason Tail Scale used a literal JSON file for up till 150 MB. of data: https://tailscale.com/blog/an-unlikely-database-migration/
So, I think the unconventional wisdom is correct.
* https://github.com/LMDB/sqlightning
* https://github.com/LumoSQL/LumoSQL
SQLightning was the initial project combining SQLite3 with an LMDB backend. It seemed to be more an experimental/Proof-of-Concept thing, and isn't maintained.
LumoSQL is an alternative project (maintained), providing a SQLite3 front end with various optional storage backends. One of which is LMDB.
Note - I'm not affiliated with either project, I just remembered they exist. :)
I think I saw a used x86-64 server with 512GB of RAM for sale for $1700 recently.
Where? Sounds like a terrific bargain, my old supermicro only has 384GB.
(It is true for clients of scale out NFS servers, for what it's worth.)
If you can stand several 100s of milliseconds of latency on every write then writing a 1.2gb flat file is not a problem.
There's a bug in webamp though, choosing "Options -> Double Size" only enlarges the player and equalizer. The playlist remains the same size.
Fly.io does a decent job, but hoping it gets cheaper/simpler with D1.
Great work
All of these are used for search (text is indexed into Algolia) and ranking:
Most likes/retweets are shown first, then approved, then rejected. NSFW skins are deprioritized as well.
The Winamp Skin Museum is powered by a sqlite3 database containing 1.2gb of metadata about 86,000 Winamp skins.
It's all exposed in this explorable GraphQL endpoint
https://api.webamp.org/graphql
A bit about the data...
It includes:
* Original filenames and md5 hashes of each skins
* Names/metadata of all files compressed WITHIN the skins (file size, date, filename)
* Text content of all text files found within the skins
* URL/likes/retweets if the skin was share by @winampskins (or on Instagram)
* Full metadata/info about each skin's @internetarchive page
* Info about manual reviews (good to tweet? NSFW?)
* URLs to download skin files or screenshots
Kind [of] fun data to comb though (if you're like me).
If anyone is interested in getting the raw DB to play with, or has ideas for extra stuff to expose in the graph, get in touch.
Using a medium with 140^W 280 symbols limit to convey things larger than that is...
It’s what Twitter web should be.