janjagusch/easy-way

Define backend persistence layer 🏦

Closed this issue · 0 comments

I've been thinking a little more about this problem and realized, that we don't really need classes for this.

We can define articles, supermarkets and supermarket_article_sections as dictionaries and (de)serialize them as .json or .yml.

Graphs and distance/path matrices we store as hash(supermarket).pkl.

At startup, the server checks, whether all graphs and matrices exist or otherwise calculates and persists them.

The nice thing about using hash here is that everything gets recreated automatically whenever we change anything about a supermarket.

What do you think, @kiranvasudev?