status-im / status-protocol-go

Status Protocol implementation in Go
Mozilla Public License 2.0
0 stars 1 forks source link

Consolidate all databases in a single one #35

Closed cammellos closed 5 years ago

cammellos commented 5 years ago

As a user I would like to have all the data consolidated in a single db So that performance are improved on starting up the library

Description

Currently is quite expensive to open an sqlcipher database, especially on slower devices. Although architecturally we'd rather keep them separate, the performance toll is probably to much to justify the decision, so we should consolidate everything in a single database.

Acceptance criteria

Notes

Currently sessions database is the only one that has data that needs to be kept, while messages and transport can be safely removed.

cammellos commented 5 years ago

@adambabik could you have a glance at the issue and give me a thumbs up or otherwise comment if there's anything that's missing we should change? thanks!

adambabik commented 5 years ago

@cammellos looks good to me. I would add that we probably want to keep migrations in their respective packages to have the clarity what belongs where but we can share a database instance. It should be configurable pretty much, either a dir is provided or a shared *db.DB instance.

Do you want me to work on this tomorrow?

EDIT: generally, I guess we will have two databases in status-go: encrypted and unencrypted. We can pass to Messenger an instance of the encrypted one (plus verify that it's encrypted), apply migrations and use it.

cammellos commented 5 years ago

@adambabik sounds good, yes, if it can be passed by status-go it would be better so we can share a single database and we don't have to run two kdfs, feel free to work on this if you'd like sure, thanks!