Hi everyone, in an effort to understand GenServers and Registry, I put together a small URL shortener service, without a database. Each “link” is registered using
Registry, with the shortcode as a key to find the process. I am aware that this probably would not be a suitable approach for a production system, but it was fun to mess around with GenServer and Registry.
I would love some feedback on it:
- what is good
- what is bad
- if my tests are relevant
This actually made me think about how your architecture changes when you bring in OTP patterns in your app design from the start, especially with persistence strategies. If you can store state inside a process, then how do you decide when to persist? What data to persist? I can definitely see a CQRS/ES type of architecture, with the event stores inside a DB, and having the read models in-memory as processes. Would this be a valid approach?