News for hackers. Stuff that matters.
Re:Monoliths Are the Future by closeparen on Thursday January 30, 2020 @01:36PM (#22193929)
My employer adopted microservices for a very specific reason: it became nearly impossible to deploy the monolith. With hundreds of commits trying to go out every day, probability that at least one would break something approached 1. Then everything had to be rolled back. Getting unrelated concerns into separate deployable artifacts rescued our velocity.

It came with many of its own challenges, too! A great deal of infrastructure had to be built to get from O(N) to O(1) infrastructure engineering effort per service. But we did build it, and now it works great.

There is a reason monoliths were traditionally coupled with quarterly or even annual releases gated by extensive QA.

Re:Monoliths Are the Future by tootie on Thursday January 30, 2020 @03:33PM (#22195243)
The solution to this is just writing modular code and using an artifact repository. It's a model I've rarely seen attempted even though it's much easier than microservices and serves the same purpose.

You can have individual dev teams, with their own repo ,backlogs, own stakeholders, etc all working at their own paces. They build modules (jars, nuget packages, npm modules) and deploy semver versioned artifacts to a repo like Nexus or JFrog. Any frontend/consumer applications can build towards versions of those modules and upgrade on their own schedule. Only the consumers need to worry about deployment.

This gives you the organizational flexibility but not the infrastructure overhead.

The discriminating factor that makes microservices necessary if these individual services have divergent hardware needs.

Re:Monoliths Are the Future by therealdrag0 on Thursday January 30, 2020 @03:49PM (#22195401)
My favorite project to work on was a modular monolith. It was a single deployable but each component (vertical) had its own maven-module.
Re:Monoliths Are the Future by tootie on Thursday January 30, 2020 @03:58PM (#22195498)
When developers complain about being verbose and not a great language for coders, I counter that it doesn't exist to solve programming problems, but rather organizational problems. The killer feature that launched Java wasn't crap like checked exceptions, it was javadoc. Strict, self-documenting APIs are 10X more valuable than any intrinsic language feature.
Re:Monoliths Are the Future by timwaagh on Thursday January 30, 2020 @05:48PM (#22196754)
i dont care about it not being great. its good enough as a language. but maven... but websphere... java is a hellish platform that ordinarily would not win from interpreted languages or those which focus on fast compilation. But it runs literally everywhere, including your toaster, but more importantly on mainframes which also run the real mvp aka Cobol. run once, run anywhere remains a killer feature no other platform has replicated as well.
Re:Monoliths Are the Future by sk5t on Thursday January 30, 2020 @10:48PM (#22198852)
I think you are putting Java in the pillory today, for the worst aspects of its ecosystem a decade ago.

Outside of perhaps stodgy banks, technical folks are not choosing to run their JVM projects today on Websphere. Gradle is pretty darn nice.

Re:Monoliths Are the Future by timwaagh on Friday January 31, 2020 @10:19AM (#22202332)
It's what my employer uses, they dont really have much choice because they're running on IBM hardware.
Re:Monoliths Are the Future by james_s_tayler on Thursday January 30, 2020 @06:53PM (#22197354)
Good old websphere. Good old maven.

Yeah. Not my favorite things either. Luckily there are alternatives in the Java world.

Re:Monoliths Are the Future by tootie on Thursday January 30, 2020 @09:01PM (#22198295)
Maven is great. Better than any competitor I've seen. WebSphere is long dead and was crappy even when it was new.
Re:Monoliths Are the Future by closeparen on Thursday January 30, 2020 @11:07PM (#22198944)
How does that solve the deployment-rollback problem?
Re:Monoliths Are the Future by i_dursun on Friday January 31, 2020 @02:10AM (#22199748)
You can still deploy a new version of the monolith with a downgraded module.
Re:Monoliths Are the Future by jrochkind1 on Thursday January 30, 2020 @06:17PM (#22197045)
Interesting. Ie, just the way the larger community (ie open source) ecosystem works, but just inside your company instead.

That makes an obvious kind of sense, when your number of contributors have grown too large to operate like a monolith... why not operate using models well-established for very large inter-entity communities?

I wonder why more very large companies don't do this, if they don't.

Re:Monoliths Are the Future by titanomachy on Thursday January 30, 2020 @10:43PM (#22198830)
I work at a very large company where each team builds and deploys its own production artifacts, but we always build everything off of head rather than choosing versions of each dependency and upgrading on our own schedule. The choose-your-own-adventure approach seems like it might be nice until you write (e.g) a critical security patch and you have to go nag N teams to upgrade their version of your library. With our system it goes out in everyone's daily or weekly release.

The system only works because of very good integration testing infrastructure and a culture of being able to roll back almost any change that broke you.

Re:Monoliths Are the Future by closeparen on Thursday January 30, 2020 @11:58PM (#22199202)
Absolutely, "go nag N teams" is a huge problem in a microservices environment. It's mitigated somewhat by building all the services from a monorepo.
Re:Monoliths Are the Future by jrochkind1 on Friday January 31, 2020 @09:24AM (#22201856)
That makes sense.

If for some reason the more traditional versioned release dependency approach made more sense for other reasons (as the GP suggested they were using it) -- it shouldn't be too hard to write automated tooling to go tell everyone to upgrade for a security release, or even make PR's dependabot-style; if an org already has "very good integration testing infrastructure", adding that tooling for security updates of dependencies is perhaps within the capacities.

Re:Monoliths Are the Future by nitwit005 on Thursday January 30, 2020 @04:57PM (#22196202)
My previous company went this direction. I wouldn't recommend it.

Say you version each module and pull in specified versions. It'll work fine, right up until two modules both try to pull different versions of a third module. In practice, you have to update multiple modules at once to avoid conflicts, which, in turn, can require updating other team's code.

It also turns out some tools like Maven don't prevent conflicts by default. You can end up exploring pom.xml files in Eclipse, trying to add exclusions, or figure out which repo is dragging them in.

Re:Monoliths Are the Future by mr_tristan on Thursday January 30, 2020 @07:35PM (#22197689)
Yeah, it sure seems like Maven, by design, tries to avoid dependency locking and version resolution configuration, but in turn, becomes kind of a bear to manage once you get fairly large.

I've switched to Gradle, and one of the first things I do is usually flip on dependency locking, and then even go so far to reject and/or flag anything that doesn't have a clear semantic version scheme.

Gradle's documentation can be a little overwhelming, but there's a lot more to these topics that developers usually overlook:

https://docs.gradle.org/current/userguide/dependency_locking... https://docs.gradle.org/current/userguide/resolution_rules.h...

Many companies would benefit from real dependency locking, and making sure they have reproducible builds. It's tricky, but, it can be a lot easier than "containerization", which I've often heard touted as a solution. (Containers are useful, but you should fix your CI separately.)

Re:Monoliths Are the Future by takeda on Saturday February 01, 2020 @01:19PM (#22212123)
Also the way I see containerization being implemented (just Dockerfile) instead of relying on deploying the same image essentially kills the reproducibility part.
Re:Monoliths Are the Future by pmoleri on Thursday January 30, 2020 @05:19PM (#22196437)
That's what semver is for, right? Breaking changes go in a major, same major means that the latest is always compatible. You'll have the same issue with microservices if you introduce breaking changes.
Re:Monoliths Are the Future by nitwit005 on Thursday January 30, 2020 @06:05PM (#22196938)
That would have let you know when to expect the impact, but not eliminate the impact itself.

Occasionally people versioned their module's APIs, which seemed like a cleaner way to handle the module update, as you don't have to update everything at once. They only went to that effort when they realized they'd have to update thousands of callers.

Re:Monoliths Are the Future by rohan-ramchand on Thursday January 30, 2020 @05:39PM (#22196668)
Yeah, but even with semver library owners have problems. If you need to make a critical change (e.g. a security update), you can either (a) wait until everyone does a version bump on their own schedule, or (b) do the version bump yourself, which means you're deploying every app that relies on your library. (a) might not be feasible for critical things, and (b) means that you might be deploying changes that the app isn't ready for yet.

For example, if master is v1.5.0, and I'm an app that uses v1.1.0, then if the library owner bumps to 1.5.1 for a critical update, I need to go from 1.1.0 -> 1.5.1, which might involve changes I'm not ready for yet. I better have phenomenal integration testing to make sure the update is safe to do.

Re:Monoliths Are the Future by klez on Thursday January 30, 2020 @06:41PM (#22197248)
> For example, if master is v1.5.0, and I'm an app that uses v1.1.0, then if the library owner bumps to 1.5.1 for a critical update, I need to go from 1.1.0 -> 1.5.1, which might involve changes I'm not ready for yet. I better have phenomenal integration testing to make sure the update is safe to do.

That could be solved by backporting security fixes to version 1.1.

Of course at a certain point you should deprecate older versions of your package. At which point it's the client's responsibility to upgrade (like for any third party library they would be using).

Re:Monoliths Are the Future by tomphoolery on Thursday January 30, 2020 @08:06PM (#22197947)
My company does this in a sense. We build a (mostly) open-source eCommerce platform with almost 100 public repos and a lot more proprietary ones for larger retailers. It's not "microservices", but it's definitely a lot of packages to manage, and we have frequently had trouble keeping them all organized and in sync with the latest changes to the core platform. The core platform is designed internally with a modular, domain-driven architecture, and the applications made with the platforms are monoliths, but the features of the platform are distributed amongst a couple hundred RubyGems. It's a lot to keep track of, but it's still a great compromise between a modular, plug-and-play architecture, and a monolithic application with all those features installed at once (which would be really hard to maintain). We're looking for ways to reduce our workload in that sense, because our team is rather small (about 6 people) and as I was saying, it's a little difficult to manage all those repos. So we've been thinking about keeping the modular architecture but keeping everything in a monorepo, so it's easier to release new versions and figure out what's changed (or what needs to change).
Re:Monoliths Are the Future by takeda on Saturday February 01, 2020 @12:42PM (#22211810)
Yep, that approach works best. I think microservices can still be introduced for things that are quite separate and don't require internal communication (the biggest thing that people underestimate when going with micro services is that communication between services is not an easy problem) between components. Although not every business will have such situations.
Re:Monoliths Are the Future by closeparen on Thursday January 30, 2020 @07:08PM (#22197490)
Try again with a lower dependency version is not that different from try again with the offending commit reverted.
Re:Monoliths Are the Future by Hendrikto on Thursday January 30, 2020 @07:34PM (#22197681)
Yes it is, because service A can depend on service B v2.3.4, while service C, at the same time, depends on service B v2.1.7.
Re:Monoliths Are the Future by ptero on Thursday January 30, 2020 @02:35PM (#22194607)
If you have the problem for which microservices are the better solution (as you describe in your example), great!

But I have seen people try to build a solution using microservices "because this is the way to go". But this often trades the problems of commits and unit verification for problems of architecture. It can take a lot of work and skill to design a robust architecture using microservices and architectural bugs and failures can be a lot harder to debug, understand and resolve. Pick your poison.

Re:Monoliths Are the Future by stock_toaster on Thursday January 30, 2020 @03:40PM (#22195308)
> With hundreds of commits trying to go out every day, probability that at least one would break something approached 1. Then everything had to be rolled back. Getting unrelated concerns into separate deployable artifacts rescued our velocity.

Software tends to reflect the structure of the organization that creates it, so this makes sense to me. If you have multiple teams contributing to a stack, eventually it is easier to have the teams work on their own (micro-)service(s).

I recommend to most people that stacks should start out as monoliths though, and move to microservice architectures only when they encounter enough pain. I think starting out with microservices from the get-go just reduces initial velocity with little payoff until you hit a certain scale.

Re:Monoliths Are the Future by andrewprock on Thursday January 30, 2020 @06:45PM (#22197284)
I think you are missing the intermediate step of libraries.

1. monolith 2. libraries 3. services

If you skip step 2, there is a high probability that the services you end up with are going to be just as disorganized as the monolith which is causing grief.

Re:Monoliths Are the Future by stock_toaster on Thursday January 30, 2020 @07:17PM (#22197542)
yup, agreed. I generally would consider your step2 as part of the lifecycle of a well architected monolith, but calling it out as a separate step is certainly clearer, and does reflect more of what I have seen "work well" in the real world too.
Re:Monoliths Are the Future by tomphoolery on Thursday January 30, 2020 @08:01PM (#22197901)
This is the right reason why an organization would want to adopt microservices, in my opinion. If you have hundreds of commits going out every day, you're probably dealing with a relatively large team, yes? Microservices makes sense for large companies, because it allows for organization of developers into teams that manage each microservice rather than having them all under the umbrella of the same application. But if your team was smaller, say, 6 people...managing 20 different services becomes a real chore and adds a lot of overhead. In this case, a monolithic application is a way better choice, because it allows all the developers to work together on the same codebase instead of spread out and distant amongst a bunch of different applications with varying degrees of quality.
Re:Monoliths Are the Future by simiones on Thursday January 30, 2020 @02:17PM (#22194408)
My company is currently moving to microservices, but for different reasons.

The problem you raise was in fact fixed years ago in our org simply by properly decoupling our "monolithic" app into modules. The top-level build was simply a collection of all pre-built modules. After each dependency update, an automated regression would run, and if pass rate was less than X%, the change was not pushed upstream.

Really, microservices give you 2 things better than that: 1, the ability to combine more technologies; 2, much simpler (horizontal) scalability, since properly done microservices naturally scale well with multiple copies running on multiple machines. Of course, the costs are there, in terms of more debugging difficulties, more complex logging needs and usually a higher minimum overhead.

Re:Monoliths Are the Future by bcrosby95 on Thursday January 30, 2020 @02:29PM (#22194532)
I've horizontally scaled plenty of monoliths. Tends to be easier. Less to monitor. You don't have to worry about "what" you're scaling. You just scale it all. Just throw another server on the pile, it reduces resources used by everything on the existing servers.

If you have a process that takes up a lot of a particular resource that others don't (e.g. disk throughput), maybe spin that into its own service. But in my experience, lots of things are just fine being lumped together and don't really exhibit resource use profiles that are all that different from eachother.

Re:Monoliths Are the Future by mypalmike on Thursday January 30, 2020 @03:26PM (#22195155)
Modules help some, but being tied to a deployment cadence with say, hundreds of other developers, can be very painful. Having to delay my team's features because another team broke the build doesn't help my customers. Isolating CI pipelines by team can help that somewhat, but you still end up sharing fate with teams with whom you might have no real interdependencies.
Re:Monoliths Are the Future by huherto on Friday January 31, 2020 @11:10AM (#22202766)
I think this is pretty much it. You can have one microservice per team. Then you can do whatever you want in terms of tools, languages, deployment workflows, etc. As long as you honor your API contracts.
Re:Monoliths Are the Future by tsimionescu on Thursday January 30, 2020 @04:01PM (#22195529)
I guess this also depends a lot on the type of product you build. For me, we are building a piece of software that we ship to customers, so the release cadence is limited by many factors outside engineering anyway.

But I can see how on a live service-type product, microservices would help a lot more on this front.

Re:Monoliths Are the Future by chillacy on Thursday January 30, 2020 @04:24PM (#22195811)
Feature toggles are a solution this. That lets you do feature releases independent of code deployment. Doesn’t work 100% of the time but I can’t imagine doing a large monolith without feature toggles.
Re:Monoliths Are the Future by wobblegong on Thursday January 30, 2020 @02:33PM (#22194583)
Our company migrated for very similar reasons - I'm surprised that people aren't mentioning this pain point more. Maybe the overall execution of microservices is poor, so people generally would rather go back to the old thing.
Re:Monoliths Are the Future by aianus on Thursday January 30, 2020 @03:19PM (#22195087)
We deployed to prod 30x a day at Coinbase, precisely for this reason.

It worked great and I was honestly shocked when I worked for other companies that plan their releases like they're shipping shrink-wrapped CDs in 1999.

Re:Monoliths Are the Future by 0x445442 on Thursday January 30, 2020 @02:41PM (#22194670)
I've found it to be much harder to manage and deploy multiple projects that it was to deploy a war. It's also been a huge PITA to test the newer architecture because all these serverless artifacts need to be deployed together. What we have now is a distributed monolith, just like the article refers to.
Re:Monoliths Are the Future by notJim on Thursday January 30, 2020 @03:26PM (#22195156)
Wouldn't continuous deployment and rolling forward be better than switching your entire application architecture?

In this scenario, you deploy ~30 times a day. If there's a bad commit, you revert it, and then do another deploy. So there's no rollbacks, you don't lose as much velocity, and since deploys are safe and a reverted commit is just a new commit, the revert is safe too.

Re:Monoliths Are the Future by closeparen on Thursday January 30, 2020 @07:06PM (#22197469)
It took at least 4 hours to deploy if everything went well; not sure if that was policy or an infrastructure limitation, but in any case more than 2 deploys per workday would have been impossible.
Re:Monoliths Are the Future by huherto on Thursday January 30, 2020 @08:22PM (#22198067)
But how big are your microservices ? How many did you build ? A monolith that has hundreds of commits is very worth separating it. But do you break it on 10, 100, 1000 microservices ? We have a case where we have 20 people managing 40 microservices. Way too granular. In the general literature there is not good consensus finding boundaries and rightsizing. Many authors just duck the question.
Re:Monoliths Are the Future by warpdrive on Thursday January 30, 2020 @02:29PM (#22194540)
Hi, We are also moving to microservices for similar reasons. Do you have any more info to share on learnings and best practices?
Re:Monoliths Are the Future by closeparen on Thursday January 30, 2020 @02:56PM (#22194840)
Have a solid, standardized base/framework layer for your services, and a way to roll out changes to it that doesn’t involve manual work for each service. Migrations are the devil. You will have an extraordinarily difficult time evolving cross—cutting concerns like auth, tracing, metrics, profiling, health checking, RPC encoding, discovery and routing, secrets, etc. without it.

And definitely don’t start migrating stuff that matters until you have mature implementations and operations around all those things, and probably many others too.