Live data from Hacker News

Modules, not microservices

blogs.newardassociates.com

361–370 of 671 posts

Re: Modules, not microservices

#361
I've been thinking for a while about how to architecture systems and I wonder if perhaps we could generalize something like Fuchsia's device driver stack design [1] for arbitrary systems and eliminate this monolithic vs microservice applications debate altogether.

In Fuchsia, the device driver stack can be roughly split into three layers:

* Drivers, which are components (~ libraries with added metadata) that both ingest and expose capabilities,

* A capability-oriented IPC layer that works both inside and across processes,

* Driver hosts, which are processes that host driver instances.

The system then has the mechanism to realize a device driver graph by creating device driver instances and connecting them together through the IPC layer. What is interesting however is that there's also a policy that describes how the system should create boundaries between device driver instances [2].

For example, the system could have a policy where everything is instantiated inside the same driver host to maximize performance by eliminating inter-process communication and context switches, or where every device driver is instantiated into its own dedicated driver host to increase security through process isolation, or some middle ground compromise depending on security vs performance concerns.

For me, it feels like the Docker-like containerization paradigm is essentially an extension of good old user processes and IPC that stops at the process boundary, without any concern about what's going on inside it. It's like stacking premade Lego sets together into an application. What if we could start from raw Lego bricks instead and let an external policy dictate how to assemble them at run-time into a monolithic application running on a single server, micro-services distributed across the world or whatever hybrid architecture we want, with these bricks being none the wiser?

Heck, if we decomposed operating systems into those bricks, we could even imagine policies that would also enable composing from the ground up, with applications sitting on top of unikernels, microkernels or whatever hybrid we desire...

[1] https://fuchsia.dev/fuchsia-src/development/drivers/concepts...

[2] https://fuchsia.dev/fuchsia-src/development/drivers/concepts...

Re: Modules, not microservices

#362
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…

You shoot yourself in the foot pretty hard regarding point 2 (scalability) if you have your microservices share a DB.

Microservices, by definition, do not share a DB. If they do then you just have multiple processes in the same larger service.

Re: Modules, not microservices

#363
post #107

Earlier quoted context omitted.

Unfortunately this is also partly correct - The team was young and people were eager to play around and learn how to work with microservices.

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…

My experience of being the old guy in the team (older also than the manager) was that the young whippersnappers[0] drive new tech adoption regardless of the views of the old fart; the manager waves it through to keep the young-un's happy, and the old fart doesn't find out until it's a fait accompli.

My experience was also that the young manager was very suspicious of the old fart. I've never had any problem working for managers younger than me; but some young managers don't know what to make of a team member that knows more than they do.

[0] No insult intended; almost everything I learned after the first 10 years, I learned from people younger than me.

Re: Modules, not microservices

#364
The best experience I've had with modular code in the java space was osgi. Very cool to be able to upload a new jar and have it start working just like that. Microservices and eda... not really a fan. Yes you can release faster but operationalizing is a massive nightmare to me. Of course one size doesn't fit all but I'm pretty convinced this is only a popular solution for now.

Re: Modules, not microservices

#365
post #332

As a senior software engineer, the most tiresome type of software dev to deal with is not the junior developer, it's the highly opinionated intermediate-level dev. They say things like "we'll obviously build the system using modern microservices architecture using node.js" before they even know the requirements.

They’re likely just trying to pad their resume for the next gig.

Re: Modules, not microservices

#366
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…

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 shocked at how much a single beefy server running efficient code can do.

Re: Modules, not microservices

#367
post #174

Earlier quoted context omitted.

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

Github got absolutely enormous as a Rails monolith, plus some C extensions in a few hot paths.

From what I can tell, Github transitioned over to micro-services ~2020 (https://www.infoq.com/presentations/github-rails-monolith-mi...). By this point it had already grew to a scale that very few companies will ever reach.

I'm not sure at what point the monolith codebase became absolutely enormous, but I would bet that GitHub grew to 1M active users with a monolith just fine.

Micro-services might be necessary for the companies like Github, Twitter, Google that grow to be huge, but monoliths seem to work just fine for the vast majority of other companies.

Re: Modules, not microservices

#368

Earlier quoted context omitted.

I used to be monolith-curious, but what sold me on micro-services is the distribution of risk. When you work for a company where uptime matters having a regression that takes down everything is not acceptable. Simply using separate services greatly reduces the chances of a full outage and justifies all other overhead.

> Simply using separate services greatly reduces the chances of a full outage and justifies all other overhead. or maybe run redundant monolith fail over servers. should work the same as micro services.

then you need to hotfix you need to re build a giant monolith that probably has thousands of tests and a 20-30 minute regression suite easily.

Re: Modules, not microservices

#369

Earlier quoted context omitted.

> there is no need to have the microservices built along Conways Law This is a misunderstanding of Conway's Law. Your code _will_ reflect the structure of your organization. If you use microservices so will their architecture. If you use modules, so will the modules. If you want a specific architecture, have your organization reflect the modules/microservices defined in that architecture.

But, I am trying to feel my way towards the idea that that was true when managers arranged systems for workers to follow , and then we came along to automate the current process. But if we have a system where the workers are the CPUs, then the people doing the managing are the coders. The point ebing is that if workers are CPUs and coders are managers, then why worry about how the managers of the coders are arranged.…

Managers arranging work is _not_ why Conway's law is true though. I think it behooves one to look at the actual text of the "law":

> Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization's communication structure.

It doesn't matter WHO defines or does the work (the coders themselves in a team or the manager). It matters how communication is arranged. And communication naturally aligns itself along organizational and team boundaries.

When a group/person/whatever writes an API they are MOSTLY writing a document for other human beings. That is an act of communication. If you meet with someone everyday in a stand-up you're likely to put a less structured API between yourselves than if you meet with someone once a month, or once a year. You're also going to create a finer grained subdivision of the API for them as you're likely working on closely related posts of the problem.

Organization creates communication, and communication creates architecture. Therefore organization creates architecture.

> Plus conway is just a ... neat idea, not a bound fate

It is in fact bound fate. Code is written to communicate with others.

People come together, they decide to solve a problem. They divide up that problem and create functions (an API), objects (an API), modules (an API), and services/microservices (an API). At each later they've written something that communicates with others. The structure of that code reflects the necessary communication to the other parties for their part of the problem. This the code is structured following the lines of communication in the organization.

Organization is how we structure communication (that's it's primary point) and thus organization = architecture + some wiggle room for communication paths defined outside that (say a SAFE feature team).

Re: Modules, not microservices

#370
post #261

Earlier quoted context omitted.

> That problem? Not using statically typed languages. TDD was invented by a Java programmer. How does that fit into your world view?

Java's original type system, while static, was far from being powerful enough to provide strong guarantees of safety. Saying age is an int is great, but Java doesn't let you say age is an int ranging from 0 to 130. You can of course create an age object, but the constraints on that object cannot be expressed within the type system. So you have to add unit tests instead, the unit tests in effect extend the type system…

> Java doesn't let you say age is an int ranging from 0 to 130

This sounds good on paper, but good luck passing your custom types to third party libraries. Or even doing something as simple as calculating average age.

You do realize the more powerful the type system is, the more closely it is going to resemble programming language, which means that structures you build on top of it will contain bugs? You're not really solving bugs, you're just pushing them to another layer.

Post reply on HN