I have been rewriting the API of TECTRA Ltd’s system for Product Data Management from Python to Elixir, as an exercise in learning Elixir, and Phoenix and GenServer in particular.
In the currently deployed, production versio in Python: an asyncio loop monitors a CSV file for modifications and (re-)loads it into an in-memory data structure. Queries for the various FastAPI endpoints take place with list comprehensions.
In the experimental Elixir version: a GenServer
utilizes a FileSystem
watcher on a path and asynchronously loads (and, upon file modifications reloads) a CSV file with all product items into a Mnesia database, which can be queried with Memento.Query
functions.
Memento is a simple and powerful interface to the Mnesia distributed database that comes standard with Erlang.