• ChubakPDP11+TakeWithGrainOfSalt@programming.dev
    link
    fedilink
    arrow-up
    24
    arrow-down
    1
    ·
    edit-2
    3 months ago

    For anyone seeking to write their own database, I have one recommendation: the Tokyo Cabinet Library.

    Tokyo Cabinet abstracts away all the needs of writing your own serializers and deserilizers for binary formats. You can have hashtable databases , B+ trees and everything else all prepared for you under one roof.

    Of course that is if you have brain, and don’t use a text storage format like JSON. If you use shit like JSON and YAML — and add potentially hundreds of millisceonds of parsing time just to serialize data from text into machine-readable binary, then please submit your name and address to my council so we can get rid of you when we own the world.

    Cleansing of the undesirables aside (seriously, give me ONE good thing about text storage formats! They are EXCHANGE formats, not STORAGE formats!), Tokyo Cabinet is written in C so you can easily bind it with SWIG. But there’s probably bindings around if you look.