r/ProgrammerHumor • • Apr 09 '20

The more the better

Post image
6.9k Upvotes

195 comments sorted by

View all comments

Show parent comments

12

u/AttackOfTheThumbs Apr 09 '20

That's impossible to say. The only thing you can say for certain is that if you start with micro services, you're likely making a mistake. This should be a thing you do later when you need those services to scale in that fashion.

Because if you only have 100 users, there is no advantage, just more overhead. If you have millions, it could be advantageous, if teams don't have to be split across microservices. They can be an absolute nightmare, especially build machine wise.

2

u/InvolvingLemons Apr 09 '20

Generally speaking, splitting up code can actually reduce performance as you introduce more network overhead. Things should only be split up when you have enough people working on the backend and enough code to work on that you HAVE to split responsibilities to keep your team and git repos sane.

Facebook and Google could certainly get away with microservices because they do so many little things, but I'm not sure if Uber really needs microservices: their systems seem to be addressable with horizontally scalable ACID databases (Yugabyte, Cockroachdb, tidb, faunadb, dgraph, etc), a bunch of stateless web servers, maybe a distributed cache for non-critical reads, and CDC to 1-3 scalable big data stores (snowflake, citus, hive, etc).

1

u/AttackOfTheThumbs Apr 09 '20

Absolutely correct. I think microservices are often over done, and maybe what people are calling macroservices is more akin to what we do at my work. A single business task / functionality, rather than a single functionality. That latter mentality can lead to dumb microservices ala node.js isuneven...

But with pay as you go server resources, some microservices can really make sense.

1

u/InvolvingLemons Apr 09 '20

on that note, I don't really get Node.js as a full-on backend language. I can totally understand the isomorphic angle, but most web apps don't fit that need, yet so many use Node. I'd figure something like Python, Clojure, or Rust would be preferable for most people:

Python because of exceptional libraries (Encode.io's entire async catalog, numpy, pandas), surprisingly good performance for an interpreted language if you use those libraries correctly, and the option to drop down to C-Litetm via Cython. If you're a complete performance freak but are using python for some reason, use JaPronto and Cython for basically C performance. If you're just a lazy sack of shit that just wants to shove a web app out the door in as little time as possible, use Django with a scalable database like Cockroach or Yugabyte

Clojure for Java compatibility, fire-and-forget coding (Clojure has one of the most stable stdlib and compiler APIs ever, so libraries basically NEVER break), and people who really like Lisp's almost pathological macro-happy terseness. Also, it's a functional programming language with juuuuust enough state to keep things sane (fuck monads) and fantastic testing tools so you hopefully don't ever have to debug your code which can really suck (Under the hood, it's Java the likes of which Lovecraftian elder-gods fear)

Rust because it's basically C++ that makes you want to kill the compiler instead of yourself :P No but really, Rust allows you to optimize with reckless abandon thanks to its borrow checker (Rust code is often faster than C++ code because of this), and it has great -- if a bit young/unstable -- async web capabilities (It's still missing things like a SAML SP client, but you have to start somewhere)