[erlang-questions] Erlang microservice architecture ?

Chandru <>
Sat May 16 11:11:22 CEST 2015


Hi Thomas,

All the approaches you outlined below are valid and workable. The exact
answer depends on your particular set of requirements around system
integration, failure handling, load balancing, scalability, performance
required etc. Further comments inline below.


On 16 May 2015 at 02:59, Thomas Elsgaard <> wrote:

> Hi list
>
> If you should recommend the architecture for an microservice
> implementation with around 20 Erlang microservices implemented on separate
> servers, how would you implement it ?
>
> 1) using gen_servers on each server and use rpc calls between services ?
>

The downside to using RPC is lack of flow control. When using RPC there is
no (easy) way for the server end to put back pressure on the clients. The
upside is obviously convenience. This approach probably has the lowest
barrier to entry so ideal for prototyping.



> 2) using web servers like yaws or webmachine on each server, and use http
> + json/xml between services ?
>

This approach is fine up to a certain point. Things to consider here are:
- Is strict ordering required between messages?
- What is the transaction volume? For very high volumes, the overhead of
HTTP becomes significant. HTTP isn't the best designed protocol either.
Sure, client libraries exist (I myself maintain one) which can hide this
for you, but the ugliness is still there.
- The upside is that integration between components (written in different
languages) is easy


> 3) roll my own erlang applications + message parsing on each server ?
>

This takes the most effort (compared to the rest, but still quite easy to
do in Erlang), but will also deliver maximum control and performance for
you. You can either roll your own protocol, or use things such as Thrift or
Protobuffs if integration between systems written in different languages is
important.


>
> Or any better ideas ?
>
> At some point, thing like service discovery will also be interresting
>

If the topology of your network of erlang nodes can be expressed in a few
hundred lines of config, I would say things like service discovery are less
useful I wouldn't spend time up front providing support for service
discovery.

cheers,
Chandru



>
> Thomas
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150516/56e162a1/attachment.html>


More information about the erlang-questions mailing list