This library solves the problem of implementing microservices with Erlang.
Your code just needs to add the behaviour gen_microservice
to your
module, implement a couple of callbacks, and you will have a
microservice ready to use in your stealth startup.
We bring you the magic that let WhatsApp scale to millions of users and dollars, here, for free.
Distributed Systems are the talk of the day. The more users your TODO app has, the more scalability and distributed consensus you will need. This library anticipates this problem by being written in Erlang, the only language where distributed systems problems have been really solved.
Your module needs to implement several callbacks:
init/1
: this function will be called by your microservices
orchestrator system to launch your gen_microservice.monolithic_call/3
: if your code still uses synchronous calls,
then those functionalities should be implemented using this
callback.modern_async/2
: if you have a modernized app, your app logic will
mostly reside inside these callbacks.handle_info/2
: your microservice will receive external messages
via this callback.code_change/2
: the magic for reloading and upgrading your
microservice live in production happens here.terminate/2
: called when it's time to scale down and decommission
your microservice instance.Check the example on doc/kitty_gen_microservice.erl
.
See LICENSE.md