-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"pluggable" data structure/object/interface/abstraction for DAG/unit (especially re: SQL/storage) #43
Comments
One big benefit of this approach is that an SQL database is overkill for an append-only data structure. Decoupling would allow a change in backend. Lengthy syncing time is likely related to SQL inserts/appends of one transaction at a time. |
good advise, the SQL way is a fast implementation, "pluggable" backend will |
@iamliqiang a big job indeed, i think the current approach is to get more unit tests in place for existing functionality, then see what can be proposed |
Obyte database is not strictly with "append-only" structure. It kind of is append-only if you take account only everything that is stable already, but all the data that is not stable gets updated a lot to figure out the next stability point. Data feeds are append only, but Autonomous Agent state is not. Both of these are now moved to RocksDB because it makes more sense for key/value data. Address definitions are not strictly append-only either, these are appended to separate table when they become public (when it is spent from them). Address definitions can be changed to different public key too. Obyte full nodes have state and history of UTXOs (outputs table), which get updated with the is_spent=1 when they are spent. Archival nodes would be more strictly "append-only", but Obyte full nodes are not archival nodes because they have current state, not all history states. |
Taking #42 a few steps further...
This repo is intended to be a library for clients to use, but all the logic in the library is tightly coupled to SQL.
It's hard (for me) to see (upon casual inspection of the code) what code is implementing the ByteBall white paper so clients don't have to re-invent (and possibly screw up) key algorithms, and what code is just implementing SQL queries.
This causes a few issues:
I think that if a goal was set to simply make the SQL storage backend pluggable and quarantine all SQL queries out of the "white paper logic", maybe even going as far as making the SQL storage backend a separate repo that is simply used "by default" here, then that would already help things a lot.
The text was updated successfully, but these errors were encountered: