-
Notifications
You must be signed in to change notification settings - Fork 103
db: use native SQL #917
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
Comments
cc @levmi for input re the two approach options EDIT: realised we do actually need to migrate. can discuss offline |
TODO(elle): possibly use uints for timestamps instead of TIMESTAMP |
With the way it works to |
Overview:
We should follow the example set by LND and migrate our kvdb stores to SQL. Luckily, LiTs set of tables is quite small and so this is quite a contained task. We also have never supported the kv schema in other backend options like sql or postgres and don't currently have any tables in any sql backend. This is nice because it keeps set of possible starting points to a size of 1: Migrate bbolt kvstore data to native sql stores (either postgres or sqlite). I think that since currently we only store LNC data in LiT's DB, nothing is critical and so I think we should force the migration at the end of the day and not necessarily let uses opt to not run the migration.
Getting started:
We can get started by:
The above can be done for the
accounts
,actions
,session
andfirewalldb
stores.We can get started on the work for the above and merge things well before we need to worry about the final switch to sql.
End goal:
By the end of the project, we want a single SQL backend with the following relations.
Action Plan/Progress tracking
Phase 1: Defining Schemas
By the end of phase 1, we want to be able to spin up LiT in
dev
mode with a full SQL backend.To do this, we will follow the following conversion strategy for each DB store:
We will do the above steps for each of the following and in the following order:
A) The Accounts store
B) Sessions store
C) rules kvstore
D) rules privacy mapper store
E) actions store.
Phase 2: Migration code
Here we will write the migration functions for each of the tables plus thorough tests for them. At the end of this phase, we are still not exposing any new functionality to a prod release.
Phase 3: Calling the migration code & handling user config
Finally, we will call the migration code & add some configuration values for switching to a new backend.
Progress Checklist
Phase 1 (Schemas):
Accounts:
Store
interface to be ready for a SQL implSessions:
Store
interface to be ready for a SQL impl #966KV stores
Privacy Pairs
Actions
Phase 2
TBC
Phase 3
TBC
The text was updated successfully, but these errors were encountered: