fuel-core
fuel-core copied to clipboard
Extract `Database` into its own `fuel-core-database` crate
The primary purpose of a separate crate for Database
is to make the fuel-core
cleaner. With the extraction of it, the fuel-core
will have only the logic of connecting all services without mixing with the database. Also, maybe it will provide to us more flexibility regarding the dependencies with the ability to use ideas from https://github.com/FuelLabs/fuel-core/issues/529.
Another purpose is to make Database
a reusable standalone crate with several different databases. It will have an abstraction that can be reused by fuel-core
or other projects. It also will force us to think about Database
as a reusable crate and introduce proper and clean API with comments.
Also, the crate could have performance benches and some utils for unit tests/benches.
It is related to the refactoring done by https://github.com/FuelLabs/fuel-core/issues/809, but because it is not related to ports and adapters, we have a separate issue for it.
I wonder if we can try and do this in two steps. 1. move the database as is. 2. do refactors. Because it will be a lot cleaner to review these things independently. Last time we did a refactor we combined the steps into single prs and it made things a lot harder.