Persistence Implementation

From Adam Colton
Revision as of 14:55, 1 August 2018 by Adamcolton (talk | contribs) (Created page with "== Cache == This could be implemented with a combination of a memory limit and priority list (able to set priority to something like last accessed). But that requires somethin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Cache

This could be implemented with a combination of a memory limit and priority list (able to set priority to something like last accessed). But that requires something to watch access and estimate memory use.

Less clean, but easier is a weak map with uintptr.

Storage

I don't think sql does me much good. It handles indexing, but that's not a really hard problem. Some engines sort of handle NLP search, but the results are clumsy and inconsistent.

BoltDB is nice. There are some very interesting combinations of using many files and many sub-buckets.

A memory mapped file would really be cool. Could be one file per object, one file per object Type, some sort of file key (like User ID). The really tricky part here is that I would like to support slices and maps but I don't know how to map that to a memory mapped file.