frzyc / genshin-optimizer

An Artifact optimizer for Genshin Impact.
https://frzyc.github.io/genshin-optimizer/
MIT License
775 stars 228 forks source link

go-next database design #2467

Open frzyc opened 5 days ago

frzyc commented 5 days ago

The current Optimizer database employs LocalStorage as a way to store key-value pairs(LocalDB), and a somewhat complicated in-memory manager system to ensure data coherency and validation. This is similar to a no-SQL database to to store data, with a lot of caveats. The design of this system is actually trying to simulate a relational database, with data for each element being somewhat flat, and nesting is done using unique keys.

On the migration to go-next with NextJS & supabase, which uses a postgres database, a more SQL-based database. This requires the loosely relational database to be structured in strict relational tables.

Some existing data structures have already been copied over: image Missing:

Note: there are several departures from the localDB-> backend db:

andrewdge commented 3 days ago

Dropping for visibility, index design page for when we have to think about how to do indexes