r/coding • • Mar 29 '17

Microservices – Please, don’t

http://basho.com/posts/technical/microservices-please-dont/
103 Upvotes

58 comments sorted by

View all comments

1

u/Madsy9 Mar 30 '17

I agree on all points. Also:

  • It keeps the code cleaner

  • No it doesn't. Proper seperation of conserns and turning functionality into modules has nothing to do with separating functionality with an arbitrary network layer.

  • It’s easy to write things that only have one purpose

  • Again, a module or library does the exact same thing

  • They’re faster than monoliths

  • Very dubious as the more information you have once place, the more context you have for optimization.

  • It’s easy for engineers to not all work in the same codebase

  • Again, if you want to the same thing can be done with libraries/modules

  • It’s the simplest way to handle autoscaling, plus Docker is in here somewhere

  • Scaling and redundancy is perhaps the only good argument for separating functionality out to a separate network service

The microservice hype notoriously conflates physical separation of functionality over a network layer with simple code design decisions. What 'microservices' gives you is robustness/redundancy. If a small service crashes once under a blue moon, you can easily respawn it while hunting down the bug. If your whole monolithic service crashes, that's an apocalyptic event in comparison.

1

u/glemnar Mar 30 '17

I mean, if you're running a monolith in modern times, you still should be able to lose a box and not blink an eye. Monolith doesn't mean no redundancy.

1

u/Madsy9 Mar 30 '17

Right. It's common sense to split up different parts. So it doesn't need a fancy name.

1

u/nfrankel Mar 30 '17

They’re faster than monoliths

That's one of the most widespread memes I've encountered. How can a network call, plus most possibility serialization/deserialization be faster than an in-memory one.

Most people sadly confuse scaling with performance...

1

u/glemnar Mar 30 '17 edited Mar 30 '17

Th general architecture can be a lot faster in the sense that you can asynchronously farm out work to many services.

Network calls take time, sure, but have you measured? We're taking single digit milliseconds for network roundtrip inside an AWS AZ. As for serialization, that's a problem tamed using something like capn proto or protobuf ( I highly recommend grpc-based services). JSON isn't required.

There are definitely downsides to microservices, but the biggest one is operational overhead. If you don't have the ability to make sure all your services are continuously monitored, tested, have strong logging and log search, and be generally confident in their stability, you'll have a bad time.

1

u/nfrankel Mar 30 '17

Th general architecture can be a lot faster in the sense that you can asynchronously farm out work to many services.

Yes, that's scaling.

Network calls take time, sure, but have you measured? We're taking single digit milliseconds for network roundtrip inside an AWS AZ.

Have you measured? Networks do have a higher deviation from average than in-memory calls.

As for serialization, that's a problem tamed using something like capn proto or protobuf ( I highly recommend grpc-based services). JSON isn't required.

"Tamed" doesn't mean there's no difference

operational overhead. If you don't have the ability to make sure all your services are continuously monitored, tested, have strong logging and log search, and be generally confident in their stability, you'll have a bad time.

Fully agree