- Java EE 8 and Angular
- Prashant Padmanabhan
- 457字
- 2021-07-02 19:22:39
The bad parts, yes, there are a few
Implementing the microservices architecture leads to a change in organisational culture, and it is not an easy one to make. Seeing a few large companies achieving success by following this model doesn't necessarily mean it's the right option for your company's need. Before making any changes, it's best to make careful considerations of the benefits and challenges ahead. SOA or having a monolith haven't become obsolete patterns, and neither is microservices the ultimate solution. These points do not intend to drive you away from using microservice architecture, but to make you aware of the disadvantages and certain pitfalls that you'll need to pay attention to. You are probably going to run into rough edges when trying this out at first, but it's essential to be able to learn from your mistakes and decide what works and what doesn't for your team.
Modular services that are defined by business capabilities are not easy to do. There are concepts of DDD, such as bounded context and single responsibility, that help guide us, but these aren't easy to get right first time. It sometimes helps to start off by writing a monolith and then refactor it into microservices later. This helps with defining the business boundaries and modules to build, which is never clear at the beginning of a project.
Having multiple databases can be challenging. Transactions across services which affect various databases are not easy to work with. When a single request is made into the application, the same is often passed downstream to other services which participate in the request handling. Identifying the issue with a request becomes difficult when multiple services are involved. To allow tracing of such requests within the application, a correlation ID is generated at the start of the request and gets passed as a header to each service. The idea is not unique to microservices, and is often used in SOA or other service orchestration solutions.
No matter how much developers love to rewrite code following the next technology buzz, not all projects are candidates for migrating to microservices. With any form of distributed computing, there are challenges that are well-known in the computing world, such as:
- Administering and monitoring dozens or hundreds of services is hard
- Development and testing of distributed systems is not easy; thus, automation of testing and deployment is essential to have
- Decomposing may lead to violation of the DRY principle (duplication of code), which needs some analysis
- Another general issue is referenced as Fallacies of distributed computing, which is also well-documented in material found on the internet
When doing microservices development, it's best to avoid some common mistakes. Here are few Dos and Don'ts to consider, before we move on:

- 數(shù)據(jù)庫系統(tǒng)原理及MySQL應(yīng)用教程(第2版)
- Objective-C Memory Management Essentials
- PostgreSQL for Data Architects
- C語言程序設(shè)計學(xué)習(xí)指導(dǎo)與習(xí)題解答
- INSTANT Passbook App Development for iOS How-to
- 移動界面(Web/App)Photoshop UI設(shè)計十全大補
- AppInventor實踐教程:Android智能應(yīng)用開發(fā)前傳
- Mastering Xamarin.Forms(Second Edition)
- PHP從入門到精通(第4版)(軟件開發(fā)視頻大講堂)
- Spring Boot實戰(zhàn)
- Machine Learning With Go
- .NET 4.0面向?qū)ο缶幊搪劊簯?yīng)用篇
- jQuery從入門到精通(微課精編版)
- HTML5與CSS3權(quán)威指南
- 微信公眾平臺開發(fā)最佳實踐