Cache and ETS
Moz fetched all of their data up front using a databaseless strategy. Another company called Ministry of Games kept mutable data in-memory and persisted it to the database at specific moments and time intervals.[61] Those are great examples of leveraging the power of Elixir to design optimal solutions.
You can also leverage the tooling provided by the VM machine on simpler problems, such as caching. A cache allows you to store the result of a computation and re-use it several times, perhaps by multiple entities. Caches are a classic example of ephemeral data. If you lose the cache, you can just rebuild it again.
In Elixir, when you need to store shared data across multiple processes, you can use ETS,[62] which is the Erlang Term ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access