avi.im
v
@avi.im
breaking databases @tur.so W1 '21 @recursecenter.bsky.social


excited about databases, storage engines and message queues
AEADs provide a verification tag after encryption. For each page, we need a nonce too. Both the nonce & the tag become metadata for an encrypted page

So where do you store them? We could store them separately, but it's much better & neater to store them in the page itself (1/5)
October 28, 2025 at 3:14 PM
Now, remember how I said cells start from the rightmost end? If you intentionally leave some space at that end before starting the cells, the B Tree would work exactly the same. That space can contain anything, and the B Tree would never touch it since there's no pointer to it. (7/9)

October 26, 2025 at 2:38 PM
The B Tree data structure fascinates me. Databases use B Trees to store data on disk, organizing everything into pages that typically range from 4kb to 8kb. All I/O operations happen in units of these pages.

The page looks like this... (1/9)
October 26, 2025 at 2:37 PM
Pro database tip: enable `SQL_SAFE_UPDATES` in MySQL to avoid accidental UPDATE/DELETE queries without a WHERE clause.

It forces you to use a key or a LIMIT, instead of wiping whole database by mistake at 2:19am.
October 22, 2025 at 3:19 PM
SQLite has a page where they explain why they use C. They specifically elaborate on why not Rust

www.sqlite.org/whyc....
October 17, 2025 at 4:33 AM
Lil trivia to remember when it comes to Snapshot Isolation

jepsen.io/consistenc...
September 23, 2025 at 4:41 AM
The correct answer is either. Transaction B gets a snapshot that may or may not include the changes from A.

SI does not provide real time guarantees. If you need that, you need Strict Serializability, which guarantees that transactions are ordered in real time.
September 18, 2025 at 2:19 PM
Published a new blog post: Setsum - order agnostic, additive, subtractive checksum

post - avi.im/blag/2025/setsum

code - github.com/avinassh/...
September 13, 2025 at 2:50 PM
This is the opening text of Transaction Processing: Concepts and Techniques by Jim Gray

"Six thousand years ago, the Sumerians invented writing for transaction processing."

September 7, 2025 at 1:38 PM
Published a new post: Oldest recorded transaction.

This totally could have been just a tweet (skeet?), but I wanted to publish something today.

avi.im/blag/2025/old...
September 6, 2025 at 2:33 PM
My extreme opinion is that anything other than serializable isolation is a scam. Database people haven't figured out how to make it fast, so we have ended up with other half baked isolation levels.
September 5, 2025 at 1:38 PM
This is the oldest transaction database from 3100 BC - recording accounts of malt and barley groats.

Considering this thing survived 5000 years (holy shit!) with zero downtime and has stronger durability guarantees than most databases today.

I call it rock solid durability.
September 4, 2025 at 1:38 PM
btw, the new semester of the database systems course is back! The first video is already out, with an assignment where you implement a Count-Min Sketch

15445.courses.cs.cmu.edu/fall2025/
September 4, 2025 at 4:49 AM
your priorities need to be in the right places if you want to pursue a database-centric lifestyle
September 3, 2025 at 1:38 PM
September 1, 2025 at 5:32 PM
Published a new blog post: Replacing a Cache Service with a Database

We already use databases, why can't we use them to replace caches as well? Will we ever replace caches entirely with databases? In this post, I will share some ideas, & discuss how we are moving toward this

avi.im/blag/2025/db...
August 31, 2025 at 2:55 PM
Published a new blog post: SQLite commits are not durable under default settings

avi.im/blag/2025/sq...
August 30, 2025 at 2:47 PM
as if the topic of databases wasn't hard enough alone, now we gotta decipher math with digital signal processing
August 23, 2025 at 6:07 AM
Weekend paper time! One more attempt to read this paper before I give up again

August 23, 2025 at 6:07 AM
A new theorem called the L2AW just dropped. It's kind of an alternative to the CAP theorem!

https://law-theorem.com
August 20, 2025 at 4:57 PM
thankfully this is not an issue for databases, as most of them have checksums and handle corruptions gracefully
August 20, 2025 at 4:40 AM
For example, here's pagination in notorious LIMIT/OFFSET style, but with streaming in Postgres

(got it from my fren claude)
August 17, 2025 at 1:05 PM
HN never disappoints 🫡

news.ycombinator.com...
August 14, 2025 at 7:04 AM
DuckDB on checksums:

August 9, 2025 at 12:46 PM
I always thought Go FFI was slow af. This is a common assumption in the Go community too. A couple of years ago, there used to be so many posts about how slow it is.

Turns out it may not be true and Go might have improved.
July 27, 2025 at 12:46 PM