Ch 1: What are Microservices? Flashcards
1: What is the main purpose of this book?
This book as a whole is designed to give a broad overview of the impact that microservices have on various aspects of software delivery.
2: What are microservices?
Microservices are independently releasable services that are modeled around a business domain. A service encapsulates functionality and makes it accessible to other services via networks—you construct a more complex system from these building blocks.
3: Name one advantage of microservice.
They are technology agnostic, which is one of the advantages they offer.
4: Explain and draw how are microservices treated from the outside.
From the outside, a single microservice is treated as a black box. It hosts business functionality on one or more network endpoints (for example, a queue or a REST API, as shown in Figure1-1)
5: Since internal implementations of microservices are hidden, what effect this has on databases? How is this concept called?
This means microservice architectures avoid the use of shared databases in most circumstances; instead, each microservice encapsulates its own database where required.
Microservices embrace the concept of information hiding.1 Information hiding means hiding as much information as possible inside a component and exposing as little as possible via external interfaces.
6: What principle should be kept in mind when adding changes to a microservice?
Changes inside a microservice boundary (as shown in Figure1-1) shouldn’t affect an upstream consumer, enabling independent releasability of functionality.
7: What is a service-oriented architecture (SOA) and what is the meaning of the service in this context?
Service-oriented architecture (SOA) is a design approach in which multiple services collaborate to provide a certain end set of capabilities. (A service here typically means a completely separate operating system process.)
8: What are the usual problems when trying to implement SOA?
Many of the problems laid at the door of SOA are actually problems with things like communication protocols (e.g., SOAP), vendor middleware, a lack of guidance about service granularity, or the wrong guidance on picking places to split your system.
9: What is the difference between SOA and microservices?
You should think of microservices as being a specific approach for SOA in the same way that Extreme Programming (XP) or Scrum is a specific approach for Agile software development.
10: What are the key concepts of microservices?
- Independent Deployability
- Modeled Around a Business Domain
- Owning Their Own State
- Size
- Flexibility
- Alignment of Architecture and Organization
11: What is the meaning behind Independent Deployability concept?
Independent deployability is the idea that we can make a change to a microservice, deploy it, and release that change to our users, without having to deploy any other microservices.
12: What it means that to ensure Independent Deployability microservices must be loosely coupled?
To ensure independent deployability, we need to make sure our microservices are loosely coupled: we must be able to change one service without having to change anything else.
13: What is the meaning behind Modeled Around a Business Domain concept?
By modeling services around business domains, we can make it easier to roll out new functionality and to recombine microservices in different ways to deliver new functionality to our users.
By making our services end-to-end slices of business functionality, we ensure that our architecture is arranged to make changes to business functionality as efficient as possible.
14: What is the meaning behind Owning Their Own State concept?
One of the things I see people having the hardest time with is the idea that microservices should avoid the use of shared databases. If a microservice wants to access data held by another microservice, it should go and ask that second microservice for the data.
Hiding internal state in a microservice is analogous to the practice of encapsulation in object-oriented (OO) programming.
15: What is the meaning behind Size concept? (How big should a microservice be?)
When you get into what makes microservices work as a type of architecture, the concept of size is actually one of the least interesting aspects.
“a microservice should be as big as my head.”
The rationale behind this statement is that a microservice should be kept to the size at which it can be easily understood.
the goal of microservices is to have “as small an interface as possible
I urge people not to worry about size. When you are first starting out, it’s much more important that you focus on two key things. First, how many microservices can you handle?
Second, how do you define microservice boundaries to get the most out of them, without everything becoming a horribly coupled mess?
16: What is the meaning behind Flexibility concept?
Another quote from James Lewis is that “microservices buy you options.” Lewis was being deliberate with his words—they buy you options. They have a cost, and you must decide whether the cost is worth the options you want to take up.
17: In what context are microservices most often discussed about?
Microservices are most often discussed as an architectural approach that is an alternative to monolithic architecture.
18: What is considered as monolith in this book?
When I talk about monoliths throughout this book, I am primarily referring to a unit of deployment. When all functionality in a system must be deployed together, I consider it a monolith.
19: What are the usual variants of monolith architecture?
- the single-process monolith,
- the modular monolith,
- and the distributed monolith
20: What is the single-process monolith?
A system in which all of the code is deployed as a single process.