I’m currently looking at backend options for storing session cache data for Pow. I have a single server running on Gigalixir and I’m trying to keep it that way (for now) to keep costs low.
Looking through the Pow documentation, you can setup Mnesia - which is awesome. But in the case of a single node, it requires persistent disk storage for the cache to survive a pod/docker container replacement.
In the case of Gigalixir, file storage is ephemeral - so that means I have the following options:
- Switch my deployment method to hot upgrades to prevent the container from being destroyed
- Add a second node - then the cache can propagate itself as nodes go down and come back up
- Implement the cache using Redis and find a 3rd party service
At this point, it looks like point 1) is the most cost effective solution.
Point 2) would take me out of the free tier and increase cost. Also, I’m not familiar with the mechanics of 1 node coming up and the next node going down. Is there enough time to copy the session cache - particularly if you only have 2 nodes? Does that mean I’d need 3 nodes at minimum?
I looked into point 3) with Google Memorystore - that introduces a cost of $35 per month. I’m not familiar with the cost of other services. A 3rd party solution may have other trade offs to consider - like network traffic costs (I’m currently in Google Cloud) and speed.
Is there anything else I should be thinking about?