Anteru's blog
  • Consulting
  • Research
    • Assisted environment probe placement
    • Assisted texture assignment
    • Edge-Friend: Fast and Deterministic Catmull-Clark Subdivision Surfaces
    • Error Metrics for Smart Image Refinement
    • High-Quality Shadows for Streaming Terrain Rendering
    • Hybrid Sample-based Surface Rendering
    • Interactive rendering of Giga-Particle Fluid Simulations
    • Quantitative Analysis of Voxel Raytracing Acceleration Structures
    • Real-time Hybrid Hair Rendering
    • Real-Time Procedural Generation with GPU Work Graphs
    • Scalable rendering for very large meshes
    • Spatiotemporal Variance-Guided Filtering for Motion Blur
    • Subpixel Reconstruction Antialiasing
    • Tiled light trees
    • Towards Practical Meshlet Compression
  • About
  • Archive

SimpleDB

January 18, 2008
  • Programming
  • Projects
approximately 1 minutes to read

For a small project of mine, I needed a really simple DB (so simple, you can’t call it a DB actually ;) ). The requirements were: - Fast lookup - Storage of raw byte streams for both key/data - Pure MSIL - otherwise, I would have used the BerkeleyDB - Checksumming for each entry to detect long-term corruption

I ended up with writing a very simple DB in C# … the trickiest part was to get the paging right, as the pages get ref-counted just like everything else, but you do actually want to know when the last handle to them finishes and flush them to disk. The DB is ~16 kb large (Binary), allows storing/loading of entries (no update so far, delete does not compact) as long as the entries are smaller than the page size. All entries are hashed before storage, so data corruption can be detected. Moreover, the index and free page table can be recreated just from the storage file. I’m using it currently for a small mail storage system, where it works pretty fine and is really simple to use – something which was crucial to me as I often need just one simple tool for something totally different and I hate spending hours just to fiddle around with some complex solution – for example SQLite – to write a simple wrapper around it for my own little needs (plus, most C# wrappers require the original binaries, which often run only on x86 but not on x64 as there are no binaries for that, let alone porting it to Mono …).

Previous post
Next post

Recent posts

  • Data formats: Why CSV and JSON aren't the best
    Posted on 2024-12-29
  • Replacing cron with systemd-timers
    Posted on 2024-04-21
  • Open Source Maintenance
    Posted on 2024-04-02
  • Angular, Caddy, Gunicorn and Django
    Posted on 2023-10-21
  • Effective meetings
    Posted on 2022-09-12
  • Older posts

Find me on the web

  • GitHub
  • GPU database
  • Projects

Follow me

Anteru NIV_Anteru
Contents © 2005-2025
Anteru
Imprint/Impressum
Privacy policy/Datenschutz
Made with Liara
Last updated February 03, 2019