Microservices Unit1 ch1 and 2
Microservices Unit1 ch1 and 2
Chapter 1: Microservices
Q3)Adopting Microservices:
The microservice focus on building replaceable components.
In particular, after learning more about microservices methods, potential adopters
frequently identify the following issues:
1. They have already built a microservice architecture, but they didn’t know it had a
name.
2. The management, coordination, and control of a microservices system would be too
difficult.
3. The microservices style doesn’t account for their unique context, environment, and
requirements.
“What are microservices? Don’t I already have them?”
There is not one single definition for the term “microservice,” there are two:
1. Microservices are small, autonomous services that work together.
2. Loosely coupled service-oriented architecture with bounded contexts.
They both emphasize some level of independence, limited scope, and interoperability.
A microservice is an independently deployable component of bounded scope that supports
interoperability through message-based communication.
Microservice architecture is a style of engineering highly automated, evolvable software
systems made up of capability-aligned microservices.
If you are considering adopting a microservice architecture for your organization, consider
how effective the existing architecture is in terms of changeability and more specifically
replaceability.
Are their opportunities to improve?
Ex: If you’ve implemented DevOps practices you’ve already invested in automated
deployment.
“How could this work here?”
Microservice applications share some important characteristics:
• Small in size
• Messaging enabled
• Bounded by contexts
• Autonomously developed
• Independently deployable
• Decentralized
• Built and released with automated processes
The microservices stories we hear the most about are from companies that provide
streamed content.
While this is a domain with incredible pressure to remain resilient and perform at great
scale, the business impact of an individual stream failing is simply incomparable to a hotel
losing a reservation.
“How would we deal with all the parts? Who is in charge?”
Two microservices characteristics that you might find especially concerning are
decentralization and autonomy.
Decentralization means that the bulk of the work done within your system will no longer
be managed and controlled by a central body.
Embracing team autonomy means trusting your development teams to make their own
decisions about the software they produce.
The key benefit to both of these approaches is that software changes become both easier
and faster—less centralization results in fewer bottlenecks and less resistance to change,
while more autonomy means decisions can be made much quicker.
In a microservice architecture, the services tend to get simpler, but the architecture tends
to get more complex.
Asserting control and management of a microservice system is more expensive than in
other architectural styles.
Q4) The Microservices Way
More specifically, the real value of microservices is realized when we focus on two key
aspects—speed and safety.
Finding an effective balance between them at scale is what we call the microservices way.
Speed and Safety at Scale and in Harmony.
1. The Speed of Change:
The desire for speed is a desire for immediate change and ultimately a desire for
adaptability.
We could build software that is capable of changing itself.
Shorten the time it takes for changes to move from individual workers to a production
environment.
After deliberate effort and careful quality control, our software was burned into a
permanent state and delivered to users on tapes, CDs, DVDs, and diskettes.
Of course, the popularity of the Web changed the nature of software delivery and the
mechanics of releases have become much cheaper and easier.
Ease of access combined with improved automation has drastically reduced the cost of a
software change.
2. The Safety of Change:
Every change is potentially a breaking change and a system optimized purely for speed is
only realistic if the cost of breaking the system is near zero.
Most development environments are optimized for release speed, enabling the software
developer to make multiple changes in as short a time as possible.
On the other hand, most production environments are optimized for safety, restricting the
rate of change to those releases that carry the minimum risk of damage.
3. At Scale:
To build at scale means to build software that can continue to work when demand grows
beyond our initial expectations.
Systems that can work at scale don’t break when under pressure; instead they incorporate
built-in mechanisms to increase capacity in a safe way.
4. In Harmony:
Your life is filled with decisions that impact speed and safety.
How fast are you willing to drive a car to get where you need to be on time?
How does that maximum speed change when there is someone else in the car with you?
Is that number different if one of your passengers is a child?