About When Not to Do Microservices
When is it not a good idea to use microservices for your architecture? Learn about the situations when microservices are not the best choice.
Join the DZone community and get the full member experience.Join For Free
quick interlude to my last blog. as part of my last blog on low-risk monolith to microservice architecture , i made this statement about microservices and not doing them:
“microservices architecture is not appropriate all the time.”
i’ve had some interesting reactions. some of it along the lines of “how dare you.” i also poked at that a bit on twitter a month or so ago .
let me expand a little bit.
doing microservices, or monoliths, or soa, or microliths or whatever fancy term gets bandied about at present is not the point . businesses ideally will be looking for [new] ways to deliver customer value and technology can be a differentiator. the key problem we face as we journey down this path of “deliver value” is actually quite simple: uncertainty. we literally do not know what will deliver value. customers are also poor at articulating it. we have lots of ideas, good ideas sometimes, but we don’t actually know the what to deliver customer value until we experiment and try. microsoft published an awesome paper about experimentation that everyone should stop and go read right now. part of what they discovered is that 66% of the “good ideas” people have actually have zero impact (or even worse) on the metric it was intended to effect. the folks who are able to run cheap experiments, run lots of them, and learn what brings value to customers faster than their competitors are going to win.
microservices is about optimizing for speed. but there’s more to it:
the key statement from that tweet stream: "…when your current application/org architecture impedes this or has become a bottleneck."
many moons ago, simon wardley blogged an eye-opening piece (for me) about pioneers, settlers, and town planners . basically, pioneers focus on creating long-term options for an organization. their work is inherently rife with unknowns: who can predict what’s going to happen in 3 years or beyond? pioneers go off and experiment with wild, divergent approaches running many experiments hoping to reduce uncertainty about what may bring value to a company in 3+ yrs. this “pioneering” effort is intended to turn up a few decent options that we can build upon and take to the next level. the “settlers” end up doing this. they figure out how to scale the product engineering, scale marketing, sales, etc. and build the pieces of the organization to make this product a successful differentiator. ultimately over the years, as a result of competitive diffusion, etc. our new product is no longer uniquely differentiated but still delivers massive value. it will be around for a long time and there are things we can do to make it run more efficiently. we probably have lots of people working on this. these are the town planners in @swardley’s analogy.
so wtf? how does this tie in? well…where do you think you fit in your organization?
if you’re the pioneers, stick with monoliths
as pioneers, you have to move quickly. you have zero ideas whether a “thing” will bring value. you want to run cheap experiments as quickly as possible and learn. you may not even be writing any code! barry o’reilly has a great story about running experiments. he talks about starting an online picture-driven wine shop… but not by building it out, organizing suppliers, lining up distributors, etc. i’m pretty sure i’ve also heard him say the most inefficient way to test a hypothesis is to build it out completely. in his story, he talks about reducing uncertainty by coming up with a hypothesis like “people who take pictures of wine probably might want to buy that wine” and coming up with cheap experiments to test that hypothesis. for example, doing a quick scan on twitter/facebook/instagram for people who’ve posted pictures of wine and send them a response with a link to a page that allows them to buy that wine. the purpose of that experiment is just to see if people would even click on the link. running lots of these small experiments don’t require building out a complete product and absolutely reduces the uncertainty in your idea. you may, at some point, come to a point where you build a minimum viable product. but again, the point of the mvp is to test a hypothesis and elicit learning. an mvp is not product engineering. you’re not building this for scale. in fact, you’re doing the opposite. you’re probably going to be running many mvp tests and throwing them away. a monolith is a perfect way to attack this. a monolith will actually allow you to go faster because changing things quickly can be done all in a single place. doing microservices at this point is infinitely overkill and will distract you from your objective: figure out something that delivers value.
if you’re the settlers, you may need microservices
once you stumble upon something that delivers value, you will probably want to scale it. this involves creating a product team: product managers, testers, marketing, sales, etc. on the product side, you’ll want to be adding features and moving quickly, again, to run smaller tests about certain features. if your team is just getting started, small, etc, and you’re still figuring out the right boundaries of the business org and the technical features, don’t do microservices. this is still an immature stage of the product development path. you’re likely to optimize too early around apis, boundaries, etc and cause a world of hurt when you need to make changes. again, our goal is to make changes quickly to test them. once you find that your application has too many people working on it, you’re trying to get too many changes out that are stepping on each other, you’re probably at the point to optimize for microservices. microservices involves a lot of complexity. matt klein recently said , “don’t take on complexity when you don’t need to”. he’s absolutely correct.
if you’re the town planners, you may need microservices
if you’re working on the flagship product that has been around for a while you have to evaluate how quickly you’re changing the product and whether there are certain hotspots of change. you may also want to introduce new features to the existing monolith/product and just as described in the settlers section, you may be running into org and system architecture bottlenecks for doing this. in these cases, microservices may be a great fit for you. microservices help you optimize for “speed” in this case.
we’re currently experiencing a lot of “microservices envy” in our industry. it’s easy to lose track of our jobs as technologists to help find and cultivate customer value using technology. don’t over optimize and complicate things when you don’t need to. solve the problems you have, not someone else’s.
okay! back to the monolith to microservices migration discussion ! stay tuned!
Published at DZone with permission of Christian Posta, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.