Building Microservices: Designing Fine-Grained Systems
Rate it:
Read between December 20, 2018 - January 14, 2019
22%
Flag icon
your service, and avoids the duplication of code required to consume the service itself.
26%
Flag icon
One of the key advantages of this approach is that the same team that makes changes to the services can also be in charge of making changes to those parts of the UI.
26%
Flag icon
Backends for Frontends
26%
Flag icon
A common solution to the problem of chatty interfaces with backend services,
26%
Flag icon
the need to vary content for different types of devices, is to have a server-side aggregation endpoint, or API gateway.
26%
Flag icon
A model I prefer and that I’ve seen work well is to restrict the use of these backends to one specific user interface or application, as we see in Figure 4-10.
26%
Flag icon
This pattern is sometimes referred to as backends for frontends (BFFs).
27%
Flag icon
My clients often struggle with the question “Should I build, or should I buy?” In general, the advice I and my colleagues give when having this conversation with the average enterprise organization boils down to “Build if it is unique to what you do, and can be considered a strategic asset;
27%
Flag icon
Many tools that enterprise organizations purchase sell themselves on their ability to be heavily customized just for you. Beware!
28%
Flag icon
with your own service that provides the website to the outside world, as shown in Figure 4-11. Treat the CMS as
28%
Flag icon
Most CMSes also provide APIs to allow for content creation, so you also have the ability to front that with your own service façade.
28%
Flag icon
Figure 4-11. Hiding a CMS using your
28%
Flag icon
Many implementations of CRM tools I have seen are among the best examples of adhesive (as opposed to cohesive) services.
28%
Flag icon
The Strangler Pattern
28%
Flag icon
A useful pattern here is the Strangler Application Pattern. Much like with our example of fronting the CMS system with our own code, with a strangler you capture and intercept calls to the old system.
28%
Flag icon
Capturing and redirecting the original calls can become more complex in this situation, and you may require the use of a proxy to do this for you.
28%
Flag icon
Avoid database integration at all costs.
28%
Flag icon
Understand the trade-offs between REST and RPC, but strongly consider REST as a good starting point for request/response integration.
28%
Flag icon
Prefer choreography over orc...
This highlight has been truncated due to consecutive passage length restrictions.
28%
Flag icon
and the need to version by understanding Postel’s Law and usi...
This highlight has been truncated due to consecutive passage length restrictions.
29%
Flag icon
Effectively with Legacy Code (Prentice-Hall), Michael Feathers defines the concept of a seam — that is, a portion of the code that can be treated in isolation and worked on without impacting the rest of the codebase.
29%
Flag icon
But I would strongly advise you to chip away at these systems. An incremental approach will help you learn about microservices as you go, and will also limit the impact of getting something wrong (and you will get things wrong!).
29%
Flag icon
Pace of Change
29%
Flag icon
Team Structure
29%
Flag icon
Security
30%
Flag icon
Tangled Dependencies
30%
Flag icon
This brings us to what is often the mother of all tangled dependencies: the database.
30%
Flag icon
The Database
30%
Flag icon
Handling problems like these is not easy, and there are many answers, but it is doable.
30%
Flag icon
Example: Breaking Foreign Key Relationships
31%
Flag icon
The problems around the consistency of data remain, although experience has shown that it is far easier to push out changes to configuration files than alter
31%
Flag icon
I’d try to push for keeping this data in configuration files or directly in code, as it is the
31%
Flag icon
Refactoring Databases by Scott J. Ambler and Pramod J. Sadalage (Addison-Wesley).
31%
Flag icon
Staging the Break
32%
Flag icon
Abort the Entire Operation
32%
Flag icon
Then we’d also need to report back via the UI that the operation failed. Our application could handle both aspects within a monolithic
32%
Flag icon
consider what we could do when we split up the application code. Does the logic to handle the compensating transaction live in the customer service, the order service, or somewhere else?
32%
Flag icon
for handling distributed transactions — especially short-lived transactions, as in the case of handling our customer order — is to use a two-phase commit. With a two-phase commit, first comes the voting phase.
33%
Flag icon
Data Retrieval via Service Calls
34%
Flag icon
At this point you’ll be saying, “But Sam, you said having lots of programs integrating on the same database is a bad idea!” At least I hope you’ll be saying that, given how firmly I made the point earlier! This approach, if implemented properly, is a notable exception,
34%
Flag icon
To start with, the data pump should be built and managed by the same team that manages the service. This can be something as simple as a command-line program triggered via Cron.
36%
Flag icon
We decompose our system by finding seams along which service boundaries can emerge, and this can be an incremental approach.
41%
Flag icon
that they inevitably constrain technology choice. You have to buy into a technology stack. This can limit not only the technology choices for the implementation of the service
41%
Flag icon
Single Service Per Host
42%
Flag icon
Platform as a Service
42%
Flag icon
At the time of writing, most of the best, most polished PaaS solutions are hosted. Heroku comes to mind as being probably the gold class of PaaS.
43%
Flag icon
Vagrant is a very useful deployment platform, which is normally used for dev and test rather than production.
45%
Flag icon
Terraform is a very new tool from Hashicorp, which works in this space.
45%
Flag icon
First, focus on maintaining the ability to release one service independently from another, and make sure that whatever
45%
Flag icon
I greatly prefer having a single repository per microservice, but am firmer still that you need one CI build per microservice if you want to deploy them separately.