ets tables are the goto for data structures (for example the :digraph module that ships with elixir is built on an ets table, presumably because A* needs a mutable datatype)
Process dictionary is also an option.
Can always use a genserver as a data store (but only do that if lifetime shenanigans make it make sense)
Postgres is also an option. Sqlite if you don't want to stand up a service.
Think of ets as an arena. You can clear the whole table by yanking its owning process. This could even be made automatic by linking it to whatever process needs the ets table.
Process dictionary is also an option.
Can always use a genserver as a data store (but only do that if lifetime shenanigans make it make sense)
Postgres is also an option. Sqlite if you don't want to stand up a service.