11 ms·
Micro-monolith anti-pattern
- xemdetia 10y agoThis blog post needs proofreading. There is obviously something interesting they want to talk about but the language is all over the shop!
- scarface74 10y agoI agree way too many typos. You can tell it was the lack of proofreading (not acceptable) not someone whose first language is not English (acceptable).
- bartab4u 10y agoIt's a .pl address, so I don't think English is his first language.
- scarface74 10y agoNow that I read it again, I noticed the sentence structure reads like a non native English speaker. At first I just paid attention to words that were wrong that was read like a bad autocorrection.
- kristianc 10y agoand that his name is Tomasz Fijałkowski.
- reallydontask 10y agoas English a name as John Smith
- kristianc 10y agoBut one that suggests English might not be his first language.
- ChristianGeek 10y agoI applaud the effort the author put into writing an article in a non-native language...it's hard enough to write well in your mother tongue. But if you're going to do so and publish it for public consumption, at least have a native speaker proofread it for you. If you don't know one, I'm sure plenty of HN readers would be happy to help out.
- scarface74 10y agoI agree with most of the article accept the idea that you shouldn't have a front facade controller and that each team should be responsible for their own UI. That isn't feasible in a lot of real world contexts. - what if the same service is used by web and mobile applications? - the backend services usually have access to data that shouldn't be exposed in the DMZ. By keeping all of the services that communicate with backend systems behind the firewall and having the front end services exposed in the DMZ, you have another layer of protection with the only port being opened between the DMZ and the internal network is port 80/443
- msluyter 10y ago"Another dangerous decision is to use a lib for reusing code. This is particularly bad if the lib contains domain logic." Question about this: if we're to take the above to heart, doesn't that imply that we may implement some common functionality multiple times? It seems there's a real tension here between "code re-use" as a generally laudable goal and the need to avoid sychronization of testing/deployments. I'm curious how others out there have dealt with this particular issue.
- maxxxxx 10y agoIn the end I think the idea of microservices as totally independent from each other is just a pipedream. There will always be dependencies between them. His solution to create more microservices for shared libs will create a whole other set of problems. In the end people just have to talk to each other and sometimes you just can't avoid that people have to synchronize their work.
- optimuspaul 10y agoI wrestle with this one all the time. A shared library creates a weak dependency between the systems that use the library. Making changes to that library may affect those other systems in unpredictable ways. In my opinion if you leave business and domain logic out of those libraries and have a well defined and tested service contract then it is reasonably safe to create shared libraries. I have found that maintaining backwards compatibility and using feature flags in these libraries goes a long way at making them relatively painless for the microservices that use them to deal with change. We also generally only use shared libraries for codifying best practices and conventions. But really, it's a constant struggle. Micro-service teams are semi-autonomous and are going to recreate functionality at will. That's a communication problem mostly though.
- lazulicurio 10y agoI'm currently struggling with dealing with shared libraries at work. I think the challenge is that the whole concept of dev-ops is fairly new[1], and from my experience Java, .Net, Python, etc. weren't designed for easy management of versioned dependencies. You have tools like Maven, Nuget, and Pip that pop up because it's a real problem, but they're add-ons to the ecosystem rather than built-in at a foundational level. And more to the point, if you want to set up your own package server[2], it can be a huge effort to integrate it into your build process[3]. [1] Disclaimer: I've only been programming for ~10 years, and professionally for ~3 years [2] Personally, I'm currently using Sonatype Nexus [3] I'm currently grappling with trying to automate building a multi-targeted assembly .Net assembly, and the co-dependency between VS, msbuild, and Nuget gives me agita
- rco8786 10y ago> A requirement of a specific framework for all services. Eh, I don't see this as an antipattern. Building disparate services but using the same frameworks/languages has tons of advantages and relatively few(none?) disadvantages. A few: - Engineers can move between teams and features more seamlessly - Infrastructure and common functionality can be shared - You will inevitably end up debugging someone else's code when it comes to on-call, that's gonna suck if it looks completely different/foreign to you than what you use day to day.
- marcosdumay 10y agoYet, that negates one of the few advantages services have for most people, that is the capacity of migrating between development tools without porting all the code, so they can use the best tool for the problem, or change away from obsolete tooling. As often is the case, the best place is normally between those extrema. You probably want to restrict languages and frameworks, but you probably do not want to dictate any single one. Or, if you want to dictate a single one, you'll probably want a monolith.
- philipov 10y agoTeams are highly coupled by their dependence on a common framework: they can't choose their own tools, and you are at high risk of having to coordinate with another team (the framework team) to release a new feature, all of which are things microservices are supposed to eliminate. Therefore, it's an antipattern.
- quantumhobbit 10y agoI've seen this happen where you develop a micro service and everything is working fine but the framework team makes a breaking change and doesn't tell you. Now your micro service is broken and it is somehow your fault because only your team is responsible for the micro service.
- yeukhon 10y agoYes, dependency management is never fun. I think the current approach we have in all languages fail short because we all depend on a text file declaring dependencies. We need to be able track the dependencies and versions. As part of the build process before merging code into a release branch or master branch, it's probably worth reading the flat file, parse the content, and check with a service (backed by a database). -> depends A -> B B -> C C -> nothing D -> A If A has changed, then on merging A, we should run D with new A. If C changed, then A, B, C, D are need to be tested. A flag or a tag for "non-backward compatible" should be added so on merging we can notify the developers (both producer of the library and consumer of the library) aware of breaking changes in their review queue. If breaking changes keep popping up, time for the tech leads and team managers of both sides to meet and understand how to avoid breaking changes so often. I don't know, someone working with large tech stack should comment on their experience. But we can't just use a text file and an email hoping someone would follow up or realize.
- tzakrajs 10y ago"That core advantages support quick delivery of new features." What?
- diminoten 10y agoThere are a number of typos and misspellings throughout the article, but it's possible to discern the general meaning anyway.
- ChristianGeek 10y ago"That" should obviously be "these."
- rb808 10y agoThis is a related issue and possible counter example - how do you define datastructures passed around microservices? Serialized objects ala protobufs? Versioned XML or JSON? Schema versioned docs? This is a great opportunity to have shared libraries or at least schemas across different microservices. In fact having each service write their own parsers or serializers would be a mistake for me.
- c0wb0yc0d3r 10y agoI think you would use protobuff, XML, JSON, etc. The idea would be that you encapsulate all of your services behind a gateway of sorts. External clients would interact with the gateway only, and internal services would just provide a one size fits all response. This way front end teams are responsible for their clients and there is very little change internally because every base is covered in the general purpose response.
- z3t4 10y agoi think a lot of people mix up micro services with distributed systems. two different services for example the smtp service and the http service should not need to communicate internaly. they should be able to deploy independent of each other. a mailform service will need to communicate with both, but a common language between all services is not needed. JSON is popular though.
- xg15 10y agoI'm not very experienced but the part about (non-)shared front-ends doesn't sound convincing to me at all. Why are some methods to combine front-end code bad (angular) but others are good (ESI tags, allegro)? If there is no coordination between front-ends, how do you get a unified user experience and a consistent design?
- z3t4 10y agoyou can have a design document with examples and inspiration.
- xg15 10y agoYes, but why? This seems to me the same principle as "no libraries, instead keep a spec and re-implement the domain logic in each service" discussed elsewhere in this thread. You still have a common dependency of all services (the spec/design doc) and you'll still have to modify them all if the dependency changes. Except now you also have heaps of duplicate code.
- z3t4 10y agoIt's easy to duplicate code. But hard to delete shared code.
- wheaties 10y agoI just want to call out that Akka doesn't require you only interopt between services also using Akka. If it did, it'd lose quite a lot of the benefits you want to get out of an Actor library. In truth, to interopt or not is a decision the developers make and it's also a decision they can (should) un-make.
- pnathan 10y agoI'm not persuaded that teams should be this independent. It always leads to a poor experience for the user. Further, duplicating code and allowing this kind of hairball growth builds a spaghetti code system, but without adequate oversight to have sufficient design.
- padobson 10y agoThis is why a good CTO or VP of Engineering or whoever the team leads are reporting to is important. Someone has to keep the big picture in mind, both from a product and engineering point of view. A good leader can guide teams in the right direction to eliminate bad user experiences or lots of repeating code or other problems that arise from organizations built around microservices.
- foobiekr 10y agothis. and frankly, probably the longest recognized anti-pattern in software engineering ever is when software architecture ends up materializing the management structure. Team = service pretty much concretizes that.
- dasil003 10y agoThere are a lot of truthy ideas here, but I feel like it still subscribes to this rosy picture of avoiding the pitfalls and winding up with an amazing scalable architecture that is an unmitigated win and fundamentally better than a monolith. The only problem is that microservices add overhead and require more tuning and control than monoliths. This is especially true if you give teams carte blanche to build things however they want with no shared standards. Being an early stage startup guy I am probably biased, but I would argue it's best to default to a monolith and try to keep things modular with an eye towards later extracting microservices as A) you find incongruent workloads and B) your team is growing and you need to create some isolation so not everyone has to know everything. Only once you understand the problem domain and workloads are you fit to draw service boundaries.
- lhnz 10y agoI agree and will add: it's a good idea to focus on defining or using common and simple protocols and contracts.
- ethbro 10y agoOr to put it another way: There is a time when every feature fits in one team. There is also a time when any given one single feature grows too large for one team. Recognize which time you're in and make the best choice for now (and some of your expected future). If everyone designed everything with the expectation of Facebook levels of traffic, nothing would ever get done (your team isn't big enough), and that overhead would be wasted in 99.9% of cases.
- lobster_johnson 10y agoThis seems to argue that any microsevice shared by many other microservices is an antipattern. Lots of apps use S3 as a common store. Is S3 an antipattern? The same goes for things like SQS, Google Pub/Sub, Google Datastore, etc. In my opinion, the idea that microservices must be isolated silos is misguided. There are many things that are top-down (high-level control plane, many small individual, stateless parts controlled by it), but the opposite of this is the bottom-up "shared substrate". Things like data storages and buses that have the responsibility of storing state or shuffling data between actors. In fact, I consider microservice that's a silo — that is, has its own private data store — to be an antipattern in many cases. To borrow an old phrase, data wants to be free. Today's backend patterns are very API-centric, with APIs acting as awkward gatekeepers to small amounts of data. It's a much better idea to invert this, Haskell-style: Let the data be first class, and orient your APIs to work on your data.
- t3soro 10y ago> The shared database hidden behind some kind of ACL (anti-corruption layer) is a short term solution. Wat