Live data from Hacker News

The costs of microservices (2020)

robertovitillo.com

381–390 of 410 posts

Re: The costs of microservices (2020)

#381

Earlier quoted context omitted.

The reality of this situation is that the tool everyone is using to build microservices is Kubernetes. It imposes a huge tax on communication between services. So your aspiration as to improving performance fly out of the window. On top of this, you need to consider that most of the software you are going to write will be based on existing components. Many of these have no desire to communicate over network, and your…

Microservices definitely predate k8s, but sure, lots of people use k8s. I don't know what penalty you're referring to. There is a minor impact on network performance for containers measured in microseconds under some configurations. Maybe Kubernetes makes that worse somehow? I think it does some proxying stuff so you probably pay for a local hop to something like Envoy. If Envoy is on your system and you're not doubl…

On Kubernetes impact on network performance: well... on one hand, Kubernetes doesn't come with its own networking. So, it's unfair to say that it affects networking, because it simply cannot do it. On the other hand, it requires external networking component to do certain things in certain ways. So, indirectly, it does affect networking.

So, here are some concerns that affect performance, they mostly come from the need of various translations done by either iptables, eBPF analogues, arpatables, DNS server(s). If you read about benchmarks of Calico and Cilius, you'll see that they concentrate on performance of eBPF code necessary to do all these translations. My claim about performance tax is based on the idea that w/o Kubernetes you wouldn't need such translations (but, of course, you could build your own version of Kubernetes networking with a lot of software-defined virtualization, in which case you'd be in the same boat).

> Kafka

Is as horrid as it sounds. It's awful performance-wise on all counts. I'm not sure what point are you trying to make. Can you choose a better example? I mean, Kafka performs very poorly in all configurations, so, to think that it can be a good example of software that wants to achieve good resource utilization is just bound to give you bad results.

> You get isolation at the service layer. I don't see why that would be contentious, it's obvious. If you're saying you want more isolation, ok, you can write your code to do that if you'd like.

You either genuinely didn't understand what this is about, or pretend to not understand something really simple. "Micro" in microservices means that your services are small. There aren't any meaningful isolation tools or approaches when it comes to microservices, because isolation at the level of service doesn't matter / is trivial to achieve by many other means / is not a problem in real-world programs.

> Yep, the actor model is very low level.

This is simply a nonsense statement. Low on what scale? Your answer reads as if it was generated by a chatbot. I.e. words from the same general domain strung together, but make no sense.

> Microservice architecture has been far more successful than actor based systems

How did you count? How do you even tell if something is a microservice-based? This is just as absurd of a claim as saying "78% of enterprises use Kubernetes" (I believe I saw this unfettered inanity on cloud-native foundation's Web site). How do you tell if it's successful? What if actor model is a more generic description which beside other things, also captures microservices?

I mean, in more simple language, this is talking out of your rear. It's not a real argument anyone should pay attention to.

Re: The costs of microservices (2020)

#382
post #380

Earlier quoted context omitted.

Network calls are a powerful thing to introduce. It means that you have an impassable boundary, one that is actually physically enforced - your two services have to treat each other as if they are isolated. Isolation is not anything to scoff at, it's one of the most powerful features you can encode into your software. Isolation can improve performance, it can create fault boundaries, it can provide security boundarie…

It's also something else that breaks. A lot more than function calls.

Sure, but breaking isn't always bad. I realize that sounds a bit crazy, but it's true.

a) Intermittent failures force you to treat systems as if they can fail - and since every system can fail, that's a good thing. This is why chaos engineering is great.

b) Failures across a network are the best kind - they're totally isolated. As I explain elsewhere, it's impossible to share state across a network, you can only send copies of state via message passing.

These things matter more or less depending on what you're doing.

Re: The costs of microservices (2020)

#383

Earlier quoted context omitted.

Microservices definitely predate k8s, but sure, lots of people use k8s. I don't know what penalty you're referring to. There is a minor impact on network performance for containers measured in microseconds under some configurations. Maybe Kubernetes makes that worse somehow? I think it does some proxying stuff so you probably pay for a local hop to something like Envoy. If Envoy is on your system and you're not doubl…

On Kubernetes impact on network performance: well... on one hand, Kubernetes doesn't come with its own networking. So, it's unfair to say that it affects networking, because it simply cannot do it. On the other hand, it requires external networking component to do certain things in certain ways. So, indirectly, it does affect networking. So, here are some concerns that affect performance, they mostly come from the ne…

> Kubernetes doesn't come with its own networking. So, it's unfair to say that it affects networking, because it simply cannot do it.

You're the one who brought it up?

> My claim about performance tax is based on the idea that w/o Kubernetes you wouldn't need such translations (but, of course, you could build your own version of Kubernetes networking with a lot of software-defined virtualization, in which case you'd be in the same boat).

You don't need any of those and I don't know why you think otherwise. You can just use the host network and do whatever you want, as with any container.

> I'm not sure what point are you trying to make.

That Kafka's architecture allows you to put data into partitions and route it based on that data, which allows for "shared nothing" architectures. But whatever, you're clearly not going to get this point from this example. To be clearer, your point of "you pay a cost here so you're losing performance" ignores that you can get performance elsewhere.

> There aren't any meaningful isolation tools or approaches when it comes to microservices, because isolation at the level of service doesn't matter / is trivial to achieve by many other means / is not a problem in real-world programs.

Not true at all. Services that own a domain of work are a great place to perform isolation and security boundaries.

> Low on what scale?

As in an actor is a foundational primitive for asynchronous computation. You have to build up protocols on top of actors, hence all of OTP.

> I.e. words from the same general domain strung together, but make no sense.

I think that's because I actually know what I'm talking about and you're finding it hard to keep up?

> How did you count?

Because it's obvious? Like it's not even close. Actor based systems are exceedingly rare, microservices are not.

> I mean, in more simple language, this is talking out of your rear. It's not a real argument anyone should pay attention to.

One of us actually knows what they're talking about and I doubt we'll agree who ti is.

Re: The costs of microservices (2020)

#384
post #371
post #301

Earlier quoted context omitted.

> OSGi and Java Modules would like a word. OSGi is the one that's deprecated and Java Modules is the one that can't actually provide that functionality yet, right? Or is it the other way round? Either way you get the point.

Java modules are doing alright since Java 9, are the foundation for Java's linker and code stripping on AOT, while Eclipse keeps using OSGi just fine.

That's right. OSGi predated the Java Module system, and in many cases, informed its design. I think it's unfortunate that when they were including the Module system into Java, they didn't just import OSGi whole.

OSGi has an in-VM service registry which allows late binding of "services" by interface. This means you can do a lot of sophisticated mixing and matching of capabilities with OSGi, including the ability to load and use incompatible versions of the same library (if need be) in different parts of your code.

More than a decade ago, I built an app server system that used an OSGi base for server-side products and agent systems. I even had a flavor of JBoss running on OSGi (with dramatically faster start up times) before JBoss went OSGi on its own.

But now my teams do their work in Node. Isolation is by process, hopefully, maybe, and we're right smack back in version hell.

Re: The costs of microservices (2020)

#385

Earlier quoted context omitted.

Well now that you mention it I think it does all come down to 'separating data from logic'. I was working backwards from the premise of: "what if we want a monolithic in-process application to have the same cognitive simplicity as an API-based client-server model?" If you want to enforce a clean interface between an in-process client and server (i.e. a piece of code calling a library interface), then the best model i…

I see, thanks. My original interpretation was that by "separating data from logic" you meant data-oriented programming where you intentionally give up on encapsulation. "which is that if you're passing behavioral inheritance from a "server" to a "client", then it gets harder and harder to predict how that client is going to use it" You mean a "server" returning the base class object whose methods are overridden by a…

Yep. Mentally it's rather like the unpredictable behavior you'd get if an API server was passing code to the client for it to execute.

Re: The costs of microservices (2020)

#386
Testing hugely via expensive integration tests or E2E is needed no matter which software you have. And you could easily fall into doing that for microservice architectures. However, a common way is rather having contract tests. Google Fowler's article for it

Re: The costs of microservices (2020)

#387
post #371

Earlier quoted context omitted.

Java modules are doing alright since Java 9, are the foundation for Java's linker and code stripping on AOT, while Eclipse keeps using OSGi just fine.

That's right. OSGi predated the Java Module system, and in many cases, informed its design. I think it's unfortunate that when they were including the Module system into Java, they didn't just import OSGi whole. OSGi has an in-VM service registry which allows late binding of "services" by interface. This means you can do a lot of sophisticated mixing and matching of capabilities with OSGi, including the ability to lo…

So many "modern" things in cloud are just relearning Java application servers (and .NET) by people that never used them.

Re: The costs of microservices (2020)

#388

Earlier quoted context omitted.

At 30 years of coding professionally in great engineering-focused organizations, and that on top of nearly a lifetime of having coded for myself, I’ve concluded code reviews barely work. I agree with everything you say here, but honestly it’s quite ineffective. I wish we had found something better than unit tests (often misleading and fragile) and the ability of a qualified reviewer to maintain attention and context…

IMO catching bugs is a nice side-effect of code reviews. The primary value I've seen across teams has been more on having shared team context across a codebase, if something goes bump in the night you've got a sense on how that part of the codebase works. It's also a great opportunity for other engineers to ask "why" and explain parts that aren't obvious or other context that's relevant. We'll find the occasional arc…

Yes, I don’t disagree, I just think in practice they do the job very poorly. I’ve tried many things over the years trying to make this work but honestly have found nothing that works at the high end.

At the low end of engineering, yeah, code reviews matter a ton and do catch bugs even if they’re basically just peephole inspections.

Re: The costs of microservices (2020)

#389
post #366

Earlier quoted context omitted.

"You will still need API docs" Been free in my IDE since I compiled the code... "E2E integration tests" I can mostly run these on my machine, no need to stand up a cluster to get it running (bonus points if you virt multiple machines on one and still don't need the cluster for complex distributed scenarios). "you will need some other kind of persistent message queue" var queue = new Queue(); // then sometime later...…

> var queue = new Queue(); // then sometime later... queue.Save(); // or queue.EmplaceAndSave(); ... queue.Pop(); Yeah, no... you'll lose data for sure, you'll have race conditions or no cooperative queuing between multiple instances of the application. This is exactly the kind of half-assery that people resort to when they say monoliths are so much less complex than microservices. A good monolith still requires all…

Eh?

Default queue implementations come with co-operating queuing out of the box. I suppose you could use some hand-rolled queue with no internal locking, but this is disingenuous.

> you'll have race conditions or no cooperative queuing between multiple instances of the application.

You're thinking micro-service again here. There's no need to have multiple "instances" at all. Any concurrency is handled internal to the application itself with use of e.g. fibers, threads, etc. A good argument to why monoliths have drawbacks can't be "well its not a microservice". :)

> A good monolith still requires all the same hard decisions about modularity, high-availability etc.

Never said it didn't. What it doesn't require is all the tech stack to support that over many instances, because there's one instance. A large majority of µServices is just re-implementing what your runtime gives you for free.

Re: The costs of microservices (2020)

#390
post #331
post #330

The article touches on it a bit, but in my experience microservices multiply operational problems (especially at startups where you don't have big, dedicated infrastructure teams). All of a sudden you have 5-10x things getting built in CI and deployed. You need some way to debug issues so usually distributed tracing comes up. Now that you have 10x as many of everything, you obviously want to try to centralize things…

A typical startup with 20k DAU: "We need scale, microservices, k8s, CDNs, etc!". Stackoverflow: "We run a single .NET-based multi-tenant web app running across just nine web servers, at 5% to 10% of capacity" [1]. Hacker News: "HN still runs on one core, at least the part that serves logged-in requests, and yes this will all get better someday...it kills me that this isn't done yet but one day you will all see." [2].…

In all fairness, HN and SO are fairly straight forward CRUD apps (esp HN) with a limited amount of 3rd party integrations.

On the other end, you have companies like Zapier that integrate with 6k+ external services. With something like that in a monolith you'd be constantly redeploying to fix changes and you'd have a pretty wild dependency tree if you wanted to use official SDKs

Post reply on HN