B
B
Barnie Savington2018-03-08 03:00:36
Data storage
Barnie Savington, 2018-03-08 03:00:36

How to properly store relatively static data?

Hello, I'm interested in the following question: what is the best way to store relatively static data - in the database or in the code, or can it be combined?
For example, we have a list of countries, they do not change every day, and on the one hand, they can not be shoved into the database, but stored as an array, numbered manually, or even use 2-character country codes.
Then we complicate it, we now have infa from the Google geocoder, we have place_id and extreme points of the country (bounds), this is also kind of immutable data, but it looks like they should be stored in the database along with everything else that relates to countries.
Let's complicate it a little more, now we need to deploy the application on another machine, let's say we have a list of countries, but there is no information from Google, and making 200+ requests as some part of the migration is also not an option ..
And there can be many such examples, some are more complicated, others are simpler - currencies, languages, different types and types of something.
I would like to hear some of your approaches, reflections, best practices. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Mirilaczvili, 2018-03-09
@2ord

Static data or dynamic data - it doesn't matter. It almost always makes sense to keep data separate from code. The program needs to implement the data update logic.
You can think of a mechanism for updating the database via the Internet from some update server that supports several versions. On it, you can store versions of the database with the necessary data included.
Another option, more complicated: the client connects to the update server, downloading the delta and rolling it into the local database.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question