this post was submitted on 09 Jul 2024
7 points (100.0% liked)

Formal Methods

165 readers
3 users here now

founded 1 year ago
MODERATORS
7
Modeling B-trees in TLA+ (surfingcomplexity.blog)
submitted 3 months ago* (last edited 3 months ago) by armchair_progamer to c/formal_methods
 

Abstract:

I've been reading Alex Petrov's Database Internals to learn more about how databases are implemented. One of the topics covered in the book is a data structure known as the B-tree. Relational databases like Postgres, MySQL, and sqlite use B-trees as the data structure for storing the data on disk.

I was reading along with the book as Petrov explained how B-trees work, and nodding my head. But there's a difference between feeling like you understand something (what the philosopher C. Thi Nguyen calls clarity) and actually understanding it. So I decided to model B-trees using TLA+ as an exercise in understanding it better.

TLA+ is traditionally used for modeling concurrent systems: Leslie Lamport originally developed it to help him reason about the correctness of concurrent algorithms. However, TLA+ works just fine for sequential algorithms as well, and I'm going to use it here to model sequential operations on B-trees.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here