Databases are for storing global variables. We usually call them “rows” or “records” instead, but they’re definitionally global variables: any part of your…
A database is a store for globals only if we don’t care too much about introducing complexity.
Globals often need to have the following properties:
Need to persist for the duration of the program.
Everybody needs the latest value out of the global variable.
Now both of these things don’t need to be explicitly a “global variable” in the programming sense. Logically speaking we just need code that implements the behaviour of the global variable well enough to satisfy our requirements.
most DBs are most often an overkill for our requirements of a global variable.
sqlite is a fantastic fit for this use-case if one wants some level of ACID properties.
One can go with a redis cache or some other kind of disk caching KV store.
Or simply just go with a global variable and measure how it does before doing all this crap.
A database is a store for globals only if we don’t care too much about introducing complexity.
Globals often need to have the following properties:
Now both of these things don’t need to be explicitly a “global variable” in the programming sense. Logically speaking we just need code that implements the behaviour of the global variable well enough to satisfy our requirements.
most DBs are most often an overkill for our requirements of a global variable.
sqlite is a fantastic fit for this use-case if one wants some level of ACID properties.
One can go with a redis cache or some other kind of disk caching KV store.
Or simply just go with a global variable and measure how it does before doing all this crap.