
Ask HN: Best language for micro services for a startup - skar
I&#x27;m in a startup and we&#x27;re looking for the right language to build our micro services. Our Android&#x2F;iOs mobile apps and our website are accessing our database using their own respective PHP backends. We&#x27;re working on building a set of services which&#x27;ll serve as a common backend for all these. Our team has 15 odd developers ranging from newbies to people with 7 years of experience. Look at the linked google spreadsheet where I&#x27;ve jotted down certain options that I could. What&#x27;s your suggestion?<p>https:&#x2F;&#x2F;docs.google.com&#x2F;spreadsheets&#x2F;d&#x2F;1vfP9lF5Xeeov6_aRriDW2IyNZMcUKqQGxgqu5sn0Rks&#x2F;edit#gid=0
======
anonyfox
Elixir (or plain Erlang) by far.
[http://blog.plataformatec.com.br/2015/06/elixir-in-times-
of-...](http://blog.plataformatec.com.br/2015/06/elixir-in-times-of-
microservices/)

 _Edit_

A few more reasons:

\- Elixir/Phoenix outperforms quite everything for some usecases
[https://twitter.com/julianobs/status/614416512825323520](https://twitter.com/julianobs/status/614416512825323520)

\- Elixir Code is well suited for longer maintenance modes
[http://blog.plague-dev.de/posts/Maintainable-Code-in-
Elixir](http://blog.plague-dev.de/posts/Maintainable-Code-in-Elixir)

\- Elixir unions the advantages of monolithic apps and microservices and is
_very_ easy to scale [http://blog.erlware.org/monolith-vs-microservices-where-
to-s...](http://blog.erlware.org/monolith-vs-microservices-where-to-start/)

~~~
skar
The numbers are impressive for sure. One worry that I have is about how to
validate the message received from each of the microservices. We have a json
composed of different data types and some amount of nested collections in
there as well. With something like Go[1] or Scala[2], we can convert a json or
each of the objects inside a collection in the JSON into an object.

1\. [http://stackoverflow.com/questions/24812933/golang-null-
type...](http://stackoverflow.com/questions/24812933/golang-null-types-and-
json-decode) 2\. [http://stackoverflow.com/questions/11889907/how-to-
convert-j...](http://stackoverflow.com/questions/11889907/how-to-convert-json-
to-a-type-in-scala)

~~~
anonyfox
[https://hex.pm/packages?search=json&sort=downloads](https://hex.pm/packages?search=json&sort=downloads)
may contain something for your needs

------
eicnix
IMHO: Scala by far

\- You can use pretty much any JVM library

\- You can execute Scala applications in a JVM which is a pretty common
platform for other tools. Think CI, deployment on servers, etc.

\- Akka Cluster out of the box. On other systems you have to build your custom
communication pipelines for messaging between your multiple instances of the
services

------
kasey_junk
Every single thing in your spreadsheet is impossible to objectively measure
(I'd argue your Java row is laughably incorrect for instance).

From a business perspective picking a language just isn't that important, it
will _NOT_ be the thing that makes you (un)successful.

So I'd go the other way, what language do the most people want to work on and
has the least "I'll quit if we pick that" factor? Just use that.

------
tedyoung
One of the big advantages of "micro-services" is that for each individual
service, you can pick the best language suited for that service. If you're
going to pick a single language (and I agree with kasey_junk on which to
pick), then just make a single service, in one language, and split it when you
need the isolation or differences in scaling each piece.

------
olalonde
Why not keep using PHP and experiment with new languages on smaller and less
critical services?

~~~
skar
Yes, we tried it already and we have certain sinatra/rails based services, but
it's causing difficulties for the developers new to ruby and those who've
recently come in and been working only on ruby, since they know only part of
the stack. So we stuck to the PHP version and are averse to diversifying our
code base into multiple languages.

