Comments (2)
Both of those options sound great. It also doesn't sound like they're mutually exclusive and at some point both features could exist.
from jylis.
So, for context, persistence is currently done with append-only log files, where all operations that mutate state get their delta-state CRDT added to a log for that keyspace. This is very similar in concept to how Redis AOF files work (see Redis docs on persistence for more info). So, in other words, the data becomes available in the same it became available when first being written, following each of the same operations that were observed. Note that this may be different in practice from the order of timestamps in your TLOG
instance.
The append-only format would make it difficult to write the data in reverse order (it would become prepend-only at that point, which wouldn't have the same desirable characteristics in terms of dealing with file handles). It would also be fairly costly to try to read the data in reverse order, and doing so would significantly increase the time it takes to load the data from disk in general.
I think there are two general ways of alleviating this pain point, which would be better options:
-
1️⃣ Adding some kind of new
SYSTEM
command that lets you check when the disk data is fully loaded.- This could then be observed by the application when managing the pool of cluster connections, to avoid sending other commands to an uninitialized node.
- Doing this kind of model would also assist with other potential issues of directing production traffic to a node that is still initializing, like the fact that such traffic might have longer latencies while competing with the disk restore work.
-
2️⃣ Periodic compaction of the append-only log files, which would have a few desirable effects:
- Data after compaction would take up an amount of space on disk that is proportional to the amount of data in the database, instead of taking up a grow-only amount of space on disk with lots of additional overhead from storing the individual (sometimes overlapping) deltas.
- The overall time to load the data back into the database would be significantly faster.
- Data from a single large
TLOG
instance would be loaded all-at-once instead of incrementally, avoiding the original problem you talk about with not all data being available yet.
from jylis.
Related Issues (9)
- Roadmap HOT 5
- Replicated data is not synced to disk HOT 4
- Add equivalent of FLUSHALL command HOT 5
- Security: Option to disable (or opt in?) to some SYSTEM commands.
- Document the "stable" executable in the Makefile. HOT 2
- Investigate portability issues with the docker image and prebuilt binary. HOT 2
- Feature: TLOG cursor HOT 2
- TLOG experiences performance issues with large recordset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jylis.