A simple scenario. User logs in through the form baked by some high level framework (rails let's say) and starts chatting. Chat is erlang-written and only authenticated users can participate in. That means, every request (containing some session id) comming from client side needs to be verified (authenticated) inside erlang code somehow. Obviously erlang knows nothing about logged users and needs to ask framework for this information.
The question is how to design the communication between erlang and framework to not cause additional bottlenecks?
I was thinking about storing session ids in erlang as well. but additional effort related with synchronization (when new users log in) and session timeouts causes headache.
There is nothing like free lunch in this case. If you will keep authentication authority outside erlang you would have to deal with all this headache. You can provide some caching inside erlang to improve speed but it will be bottleneck and also you have to deal with all cache coherency issues. IMHO best solution is make erlang authentication authority and provide authentication for high level framework.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With