Live data from Hacker News

Don't start with microservices – monoliths are your friend

arnoldgalovics.com

201–210 of 468 posts

Re: Don't start with microservices – monoliths are your friend

#201

Earlier quoted context omitted.

lol this is how it works at a startup - 1. auth? probably an internal service, so don't expose it to the outside network. 2. monitoring? if the service is being used anywhere at all, the client will throw some sort of exception if its unreachable. memory problem? it should take 3. deployment? if its a go service, literally a bash script to scp over the binary and an upstart daemon to monitor/restart the binary. rollb…

I agree more or less with 1 and 4 mostly. But for monitoring either you would have to monitor the service calling this microservice or need to have a way to detect error. > if it does have memory leaks anyways, just basic cpu/mem usage monitoring on your hosts Who keeps on monitoring like this? How frequently would you do it? In a startup there are somewhere in the range of 5 microservice of that scale per programmer…

My larger point is basically just against dogma and “best practices”. Every decision has tradeoffs and is highly dependent on the larger organizational context.

For example, kubectl rollout assumes that your service is already packaged as a container, you are already running a k8s cluster and the team knows how to use it. In that context, maybe your method is a lot better. But in another context where k8s is not adopted and the ops team is skilled at linux admin but not at k8s, my way might be better. There’s no one true way and there never will be. Technical decisions cannot be made in a vacuum.

Re: Don't start with microservices – monoliths are your friend

#202
post #30

I keep trying to do K8S at home but each time hit a wall of complexity and conclude this is ridiculous. I’m sure has its place for bigger applications though I do like a modular approach though (think docker rather than k8s) which I suppose is partial micro services

It has the disadvantages of lock-in, but this is why I love ECS. 80% of the advantages of K8S for 20% of the complexity. Even hosted K8S requires a lot of config and concepts that are just baked into ECS.

Re: Don't start with microservices – monoliths are your friend

#203

Earlier quoted context omitted.

Yes I acknowledged OTP apps as a valid structure. An umbrella app is project that builds multiple OTP apps.

No, you do not even need OTP functionality on the child project, that's my point. Not everything uses OTP. Edit: We may be talking past each other, from Sasa Juric: "It’s worth noting that poison is a simple OTP app that doesn’t start any process. Such applications are called library applications." Which is what I'm thinking of. He also says "Finally, it’s worth mentioning that any project you build will mix will gen…

Each separate child project is still an OTP application, even if you do not use "OTP" features in them. OTP app is just the term for that artifact, similar to assembly or archive in other languages but it is not only terminology, each one will have `start` called when the VM starts, even if they don't spawn any servers.

Re: Don't start with microservices – monoliths are your friend

#204
post #26

Unless you have a strong technical or organizational reason to use microservices, using microservices is just more work to achieve the same results. Organizational reason would be multiple people/teams who don't want or can't talk much to each other, so they develop pieces of a larger system as relatively independent projects, with clear API and responsibility boundaries. Frontend/backend style web development is an…

> no good reason How about deployment speed? If I’ve got a microservice collecting events off a queue and writing a csv out to S3 on a schedule, it’s really nice to be able to add a column and deploy in minutes without having to rebuild and deploy a giant monolith. It also allows for fine grained permissions: that service can only read from that specific queue and write to that specific bucket. People throw around “d…

>>> If I’ve got a microservice collecting events off a queue and writing a csv out to S3 on a schedule

I call this a worker.

Re: Don't start with microservices – monoliths are your friend

#205

Earlier quoted context omitted.

No, you do not even need OTP functionality on the child project, that's my point. Not everything uses OTP. Edit: We may be talking past each other, from Sasa Juric: "It’s worth noting that poison is a simple OTP app that doesn’t start any process. Such applications are called library applications." Which is what I'm thinking of. He also says "Finally, it’s worth mentioning that any project you build will mix will gen…

Each separate child project is still an OTP application, even if you do not use "OTP" features in them. OTP app is just the term for that artifact, similar to assembly or archive in other languages but it is not only terminology, each one will have `start` called when the VM starts, even if they don't spawn any servers.

Yup which I'm not sure if you replied before I finished my edit or not but I came to the same conclusion.

Re: Don't start with microservices – monoliths are your friend

#206
In these discussions, people tend to forget the unsexy problem: coordinating work between humans. The reason an architecture is chosen is often purely a result of Conway's law. Just like the code organized on disk is often purely a result of how your language or build tool prefers you organize your code. Subconscious bias controls a lot of what we do, so designing systems partly requires an understanding of psychology and management techniques.

If that sounds crazy, just ask W.E. Deming. The reason Toyota came up with TPS was not because they were geniuses, or the discovery of some "magical architecture". They just focused on how to always be improving quality and efficiency - which at first makes no sense at all, and sounds exactly like premature optimization. But the proof is in the pudding.

Re: Don't start with microservices – monoliths are your friend

#207

I wonder why no one ever talks about architectures in the middle between those two - modular monoliths. The point in time where you're splitting your codebase up in modules (or maybe are a proponent of hexagonal architecture and have designed it that way from the beginning), leading to being able to put functionality behind feature flags. That way, you can still run it either as a single instance monolith, or a set o…

I agree with your position, I'm a big fan of the modular monolith approach. I took a look at your post. This is one thing that jumped out to me:

> Because the people who design programming languages have decided that implementing logic to deal with distributed systems at the language construct level... isn't worth it

I'm not sure if this is just a dead end or something really interesting. The only language I really know that [does this is Erlang](https://www.erlang.org/doc/reference_manual/distributed.html), though it's done at the VM / library level and not technically at the language level (meaning no special syntax for it). What goes into a language is tricky, because languages tend to hide many operational characteristics.

Threads are a good example of that, not many languages have a ton of syntax related to threads. Often it's just a library. Or, even if there is syntax, it's only related to a subset of threading functionality (i.e. Java's `synchronized`).

So there might not be much devotion of language to architectural concerns because that is changing so much over time. No one was talking about microservices in the 90s. Plus, the ideal case is a compiler that's smart enough to abstract that stuff from you.

Re: Don't start with microservices – monoliths are your friend

#208

Earlier quoted context omitted.

I've argued for a long time that microservices should grow out of a monolith like an amoeba. The monolith grows until there is a clear section that can be carved off. Often the first section is security/auth, but from there it's going to be application specific. A modulith could be just another step in the carve up process. But, there is no right answer here. Application domain, team size, team experience, etc... all…

In my experience with enterprise software one of the things that cause most trouble is premature modularization (sibling to the famous premature optimization). Just like I can't understand how people can come up with the right tests before the code in TDD, I can't understand how people can come up with the right microservices before they start developing the solution.

> premature modularization

I'm stealing that. I have seen soo many small projects crumble due to sheer unnecessary complexity introduced by modularization dogmas.

Re: Don't start with microservices – monoliths are your friend

#210
post #77

Earlier quoted context omitted.

I am 100% not interested in ops. Deploying is handled by other way more qualified than I. I never expect a JS expert to build elixir, I don't expect an elixir expert to write bash, and I don't expect a bash expert to know about switches and cabling. I don't understand where you draw the line.. Should the designer who also crafts the css do ops too? I think high quality comes from specialists. Sharp knives in the hand…

The goal is to sustainably build software, which only can be done if ops and maintenance is regarded a goal, a pillar to build upon. Like TDD the design of software changes when you have experience with ops/maintenance. Take logging/tracing: what to log or trace is first and foremost a matter of experience with maintenance/ops! Building in logging/tracing/monitoring from the get-go because you know that you want to k…

[deleted]
Post reply on HN