2 ms·
If you can be guaranteed to have no forward references, wouldn't this mean that you can also not have cycles and therefore could make do with a much simpler ref
by WJW 6y ago
If you can be guaranteed to have no forward references, wouldn't this mean that you can also not have cycles and therefore could make do with a much simpler refcounting setup?
- reitzensteinm 6y agoYou 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.