Hacker News new | ask | show | jobs
by cletus 625 days ago
To paraphase [1]:

> Some people, when confronted with a problem, think “I know, I'll use micro-services.” Now they have two problems.

As soon as I read this example where there's users and orders microservices, you've already made an error (IMHO). What happens when the traffic becomes such an issue that you need to shard your microservices? Now you've got session and load-balancing issues. If you ignore them, you may break the read-your-write guarantee and that's going to create a huge cost to development.

It goes like this: can you read uncommitted changes within your transaction or request? Generally the answer should be "yes". But imagine you need to speak to a sharded service, what happens when you hit a service that didn't do the mutation but it isn't committed yet?

A sharded data backend will take you as far as you need to go. If it's good enough for Facebook, it's good enough for you.

When I worked at FB, I had a project where someone had come in from Netflix and they fell into the trap many people do of trying to reinvent Netflix architecture at Facebook. Even if the Netflix microservices architecture is an objectively good idea (which I honestly have no opinion on, other than having personally never seen a good solution with microservices), that train has sailed. FB has embraced a different architecture so even if it's objectively good, you're going against established practice and changing what any FB SWE is going to expect when they come across your system.

FB has a write through in-memory graph database (called TAO) that writes to sharded MySQL backends. You almost never speak to MySQL directly. You don't even really talk to TAO directly most of the time. There's a data modelling framework on top of it (that enforces privacy and a lot of other things; talk to TAO directly and you'll have a lot of explaining to do). Anyway, TAO makes the read-your-write promise and the proposed microservices broke that. This was pointed out from the very beginning, yet they barreled on through.

I can understand putting video encoding into a "service" but I tend to view those as "workers" more than a "service".

[1]: https://regex.info/blog/2006-09-15/247

1 comments

> Even if the Netflix microservices architecture is an objectively good idea (which I honestly have no opinion on

I have no opinion on that either, but at least this[0] story by ThePrimeagen didn't make it sound all too great. (Watch this classic[1] before for context, unless you already know Wingman, Galactus, etc.)

[0]: https://youtu.be/s-vJcOfrvi0?t=319

[1]: https://m.youtube.com/watch?v=y8OnoxKotPQ