Building a database buffer pool in Zig using io_uring's new fixed-buffer mode
gavinray97.github.io
gavinray97.github.io
I have been "in my spare time" (that is, never finishing) building out a page buffer mgmt system based on the one in the Umbra paper (see https://db.in.tum.de/~freitag/papers/p29-neumann-cidr20.pdf) which has a kind of novel approach where they essentially allocate the same physical address at multiple virtual addresses but with different block/slab sizes so that they can reduce fragmentation and still support dynamic page sizes. Anyways, it seems this author is also on the same "page" (sorry) as me but focusing more on exploiting `io_uring`. Nifty.
I'm working in Rust, not Zig, but a lot of nice stuff to read through here.
I will have to read through this in more detail later when I have more brain-space available.
I had the pleasure of hearing Neumann present the Umbra architecture on the CMU DB series webinar recently.
I'm slowly working through re-implementing the Coroutines async buffer pool paper. Blocked on trying to properly implement and understand "Morsel-Driven Parallelism":
https://db.in.tum.de/~fent/papers/coroutines.pdf
I have the async, io_uring buffer pool written in Kotlin using it's native Coroutines but the scheduling and morsel stuff I'm still trying to understand
Are you getting paid to work on this kind of thing, anywhere? Do you want to be?
> Are you getting paid to work on this kind of thing, anywhere?
My dayjob is a fair bit higher level. I work on a sort of query engine on the JVM that translates an internal query IR/AST into dialect-specific SQL + other languages so you can query anything with the same frontend language:https://techcrunch.com/2022/06/28/hasura-now-lets-developers...
I think it'd be neato to work on a database, but my dayjob is also pretty interesting to me.
> I'm working in Rust, not Zig, but a lot of nice stuff to read through here.
FYI, Datadog has a Rust library for scheduling things to run thread-per-core with io_uringIt'd be really useful for DB use cases:
I also came across another fellow who was inspired by the optimistic locking btree presented in LeanStore Umbra: https://github.com/NeowayLabs/bplustree
Jens Axboe corrected me on this, fixed buffers have existed for a while apparently!
https://twitter.com/axboe/status/1581392910687567873?t=gx_tQ...
Never did I hear about it and suddenly people talk about it.
What happened
Next few months will be "built X with Zig" with hundreds of upvotes.
But this whole `built with X` is in my opinion just some 'i try to appear cool by using x language' and i don't really like it.
Don't get me wrong, i absolutely love rust, zig and go, but i believe, that you shouldn't pick a technology based on such subjective matter. A language is just a tool to solve problems, and you don't really want to screw in a screw with a hammer, do you?