4 ms·
You could definitely do it with refcounting, but I'm not sure it's simpler when not in memory. You need to be able to defer the cost of freeing objects, otherw
by reitzensteinm 6y ago
You could definitely do it with refcounting, but I'm not sure it's simpler when not in memory.
You need to be able to defer the cost of freeing objects, otherwise updating a root object will randomly be very expensive as you free 20gb of garbage before acknowledging the write.
This deferred queue is going to need to live in the database, and be processed in atomic chunks that pop an item off the queue, update the refcounts, and add any further work items. Otherwise if the power goes out, your refcounts are left in who knows what state.
That doesn't exactly sound hard, but the system I built was pretty simple too. And my preference leans towards not mutating object metadata after it's been written to.