I hope I am asking the question the right way here.
I’m curious as to the benefits of introducing additional GenServer usage for internal state management within an API build around phoenix framework. Does it offer any additional benefits over validating state using database constraints?
I see concurrency and fault tollerance mentioned with GenServers too, but doesn’t Phoenix already take care of this?
An example scenario:
I am a student.
I want to be able to create a study groups.
I want to make sure that a student can only be in one study group per subject they study
I want to be able to invite other students to the group I have created
All this to me, can be locked down at the database layer and the only thing I see the GenServer introducing is a bottleneck that all my group related actions have to go through.
And if I wanted to scale the app, it behaves the same. The database still manages concurrency and validation.
Is there something I am missing with this here?
edit: ah hell, something just dawned on me. If I want to allow multiple people to add people to the group in the future I am going to have issues aren’t I?