fuel-core icon indicating copy to clipboard operation
fuel-core copied to clipboard

Extract `Database` into its own `fuel-core-database` crate

Open xgreenx opened this issue 2 years ago • 1 comments

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.

xgreenx avatar Jan 31 '23 21:01 xgreenx

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.

freesig avatar Feb 02 '23 23:02 freesig