Live data from Hacker News

Modules, not microservices

blogs.newardassociates.com

491–500 of 671 posts

Re: Modules, not microservices

#491

Earlier quoted context omitted.

If the file only contains static methods, it doesn't matter too much. However a class with mutable state should be kept pretty small imo.

This only applies to OOP, no?

Or module level state (Go, Python) which is in many ways even worse

Re: Modules, not microservices

#492

Earlier quoted context omitted.

You know, I don't really think microservices are fundamentally more scalable. Rather, they expose scaling issues more readily. When you have a giant monolith with the "load the world" endpoint, it can be tricky to pinpoint the the "load the world" endpoint (or, as is often the case, endpoint*s*) is what's causing issues. Instead, everyone just tends to think of it as "the x app having problems." When you bust the mon…

It sounds like creating problem, then spending time=money on fixing it and calling it a win? There is a point when it all starts to make sense. But that point is when you go into billions worth business, hundreds of devs etc. And going there has large cost, especially for small/medium systems. And that cost is not one off - it's a day-to-day cost of introducing changes. It's orders of magnitude chaper and faster (hea…

> It sounds like creating problem, then spending time=money on fixing it and calling it a win?

It sort of is.

It's not a perfect world. One issue with monoliths is that, organizations like to take a "if it ain't broke, don't fix it" attitude towards things. Unfortunately, that leads to spotty service and sometimes expensive deployments. Those aren't always seen as being "broken" but just temporary problems that if you pull enough all nighters you can get through regularly.

It takes a skilled dev to be able to really sell a business on improving monoliths with rework/rewrites of old apis. Even if it saves money, time, all nighters. It's simply hard for a manager to see those improvements as being worth it over the status quo. Especially if the fact of running the monolith on big iron masks the resource usage/outages caused by those APIs.

Re: Modules, not microservices

#493
post #174
post #72

Microservices, while often sold as solving a technical problem, usually actually solve for a human problem in scaling up an organization. There's two technical problems that microservices purport to solve: modularization (separation of concerns, hiding implementation, document interface and all that good stuff) and scalability (being able to increase the amount of compute, memory and IO to the specific modules that n…

Twitter seems to have adopted Microservices in 2014, and in 2013 they had ~200M MAU (presumably using a monolith architecture). Even if Microservices are better for scale, most companies will never experience the level of scale of 2013 Twitter. Are Microservices beneficial at much smaller levels of scale? Ex: 1M MAU

> most companies will never experience the level of scale of 2013 Twitter

I fully agree with your argument. Then again, as mentioned elsewhere in this discussion, microservices are often not introduced to solve a scalability problem but an organizational one and there are many organizations that have more engineers than Twitter (had).

Personally, I still don't buy that argument because by solving one organizational problem one risks creating a different one, as this blog post[0] illustrates:

> […] Uber has grown to around 2,200 critical microservices

Unsurprisingly, that same post notes that

> […] in recent years people have begun to decry microservices for their tendency to greatly increase complexity, sometimes making even trivial features difficult to build. […] we experienced these tradeoffs first hand

I'm getting very strong Wingman/Galactus[1] vibes here.

[0]: https://web.archive.org/web/20221105153616/https://www.uber....

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

Re: Modules, not microservices

#494

Earlier quoted context omitted.

This is one of the reasons I dislike working in teams that lack 'old people'. Young devs still have a lot of mistakes to make that old devs have already made or seen. The young ones seem to see them as slow and difficult, but they also create stability and control. In a start-up, having a team of young people will allow you to move fast, pivot and deliver. What you usually end up with though, is a tower built from sp…

Agreed. This is a corollary of the Second-system effect [1]. By the time developers design their third system they have become relatively "old". [1]: https://en.wikipedia.org/wiki/Second-system_effect

This is funny, I'm currently working on a second system that replaced the first. It's awful and I think we need to build the third version.

Re: Modules, not microservices

#495
post #73

I am working on a project that uses a microservice architecture to make the individual components scalable and separate the concerns. However one of the unexpected consequences is that we are now doing a lot of network calls between these microservices, and this has actually become the main speed bottleneck for our program, especially since some of these services are not even in the same data center. We are now attem…

> However one of the unexpected consequences is that we are now doing a lot of network calls between these microservices

I wouldn't call that entirely unexpected. :-) It's a rather well-known issue:

  Microservices

  grug wonder why big brain take hardest problem, factoring system correctly, and introduce network call too

  seem very confusing to grug
(from https://grugbrain.dev)

Re: Modules, not microservices

#496

I really like modular designs, but this article is missing some key limitations of monolithic applications, also if they are really well modularized (this is written mostly from the perspective of a Java developer): * they force alignment on one language or at least runtime * they force alignment of dependencies and their versions (yes, you can have different versions e.g. via Java classloaders, but that's getting tr…

> unless you apply a large degree of discipline and engineering excellence to only rebuild changed modules while making sure no API contracts are broken

Isn't that exactly what's required when you're deploying microservices independently of each other? (With the difference of the interface not being an ABI but network calls/RPC/REST.)

Re: Modules, not microservices

#497
post #447

Earlier quoted context omitted.

I don't understand the argument around microservices purporting to fix scalability. Say your system has modules A, B and C in one app, and that A requires more resources while B and C are relatively unused. Won't B and C just run less and thereby use appropriately fewer resources from within the same system as A? Are microservices just an aesthetic separation (it feels nice to know you're "only" scaling up A)?

It doesn't necessarily fix it but has less resource waste or is easier to manage than the bin packing needed otherwise.

[deleted]

Re: Modules, not microservices

#498

Earlier quoted context omitted.

Sure, but not all micro-services are vital. If your "email report" service has a memory leak (or many other noisy-neighbor issues) and is in a crash loop then that wont take down the "search service" or the "auth service", etc. Many other user paths will remain active and usable. It compartmentalizes risk.

Proper design in a monolith would also protect you from failures of non-vital services (e.g. through exception capture). So it seems like we’re trying to compensate bad design with microservices. It’s orthogonal IMO.

How does exception capture protect from all failures? The most obvious one I don't see it relating to is resource utilization, CPU, memory, threadpools, db connection pools, etc etc.

> we’re trying to compensate bad design

No I think we're trying to compensate for developer mistakes and naivety. When you have dozens to hundreds of devs working on an application many of them are juniors and all of them are human and impactful mistakes happen. Just catching the right exceptions and handling them the right way does not protect against devs not catching the right exceptions and not handling them the right way, but microservices does.

Maybe you call that compensating for bad design, which is fair and in that case yes it is! And that compensation helps a large team move faster without perfecting design on every change.

Re: Modules, not microservices

#499

Earlier quoted context omitted.

Depends entirely on the org. My org actually broke SOA (thousands of services and some intense technical debt) and is now in a years long process of moving toward a centralized service orchestration model. This couldn’t have happened without PE, Sr PE and DE involvement.

Now that sounds interesting. I assume you're not counting each API endpoint as a service, so can you shed any more light on this? The scale sounds mind-boggling. Thousands of separate services being pulled (more) together. Can you give an idea of the size or scope of these services?

>1000 services, each with many APIs :)

Amazon's warehouses have incredible domain complexity which drives the complexity of the software architecture. It's also one of the oldest parts of the company with a direct lineage going back 20+ years. (for example, our inventory databases still have the same schema and are still using a RDBMS, albeit RDS Postgres instead of Oracle).

About five years ago we started rearchitecting to a centralized orchestration service which is being used to abstract this complexity from process teams. This is to avoid projects where 20+ service teams must be engaged just to launch a new solution.

Re: Modules, not microservices

#500

Earlier quoted context omitted.

I just want to point out that for the second problem (scalability of CPU/memory/io), microservices almost always make things worse. Making an RPC necessarily implies serialization and deserialization of data, and nearly always also means sending data over a socket. Plus the fact that most services have some constant overhead of the footprint to run the RPC code and other things (healthchecking, stats collection, etc.…

Microservices are less efficient , but are still more scalable . Servers can only get so big. If your monolith needs more resources than a single server can provide, then you can chop it up into microservices and each microservice can get its own beefy server. Then you can put a load balancer in front of a microservice and run it on N beefy servers. But this only matters at Facebook scale. I think most devs would be…

You can have more than one server per monolith.

I don't think you actually understand what microservices are. You don't put a load balancer to load balance between different services. A load balancer balances trafic between servers of the same service or monolith.

Microservices mean the servers of different services run different code. A load balancer only works together with servers running the same code.

Post reply on HN