3. Microservices Advanced Concepts Flashcards
What is one of the best strategies for dealing with reducing latency in microservices-based systems?
To not rely on a purely synchronous communication model. Leveraging event-driven, asynchronous communications is a great way to improve system health as well as support long-term objectives of moving large amounts of data over long distances in a timely fashion.
What can be said about error conditions in dealing with a Microservices architecture that leverages asynchronous communications?
Learning how to appropriately handle and respond to error conditions is critical to keeping the system healthy.
What do people often refer to when it comes to asynchronous communications in a Microservices architecture, and how does that work?
Event-driven microservices.
In this model, the services put a message into an asynchronous message broker or a temporary data store and then derive events from this new state. The downstream event processors will process the data and eventually cause the data to be stored in its final data store. Conversions will then occur through either distributed data patterns or subsequent event processing.
What is another alternative to event-driven microservices, and how does it work?
Stream data platforms — a very strong pattern when building out a large system, especially with many different but interesting operations.
In a stream data platform, events are written to a central message broker. These events then trigger listener operations that take action on that data if it applies to them, such as formatting the data, causing other downstream events, or various other activities.
What is the advantage of stream data platforms over event-driven microservices?
They are highly useful in large distributed systems because events often trigger multiple operations and not just one. By leveraging this platform, you can do more work with less overall stress on the system, which improves overall performance, especially in activities like logging, auditing, or inspections.
What must be taken into consideration in regards to messages that fail to be processed in a microservices architecture that takes an asynchronous approach?
You need to take care to handle error states correctly and recover from them. If messages cannot be processed for any reason, you cannot simply ignore them. Dead letter queues must be monitored and action must be taken to process the messages, even if it’s manual processing.
What makes evaluating call chains and aggregating logging particularly hard in a Microservices architecture, and what must be done to tackle this?
When an issue arises in a Microservices architecture, it can become very difficult to see all of the moving parts, because your calls span across multiple virtual machines or containers, and separate sessions.
Early on in the process, you must plan for unified logging strategies across your entire platform.
In what situations do logging become useful?
- Day-to-day operations
- Troubleshooting
- Maintenance
- Investigations
- General tasks
What particular characteristics of a Microservices architecture makes logging challenging?
- Larger volume of artifacts
- Agile nature
- Different teams — different logging strategies
How does moving onto a distributed system affect the need for logging?
As we move onto a distributed system, there is an increased need to have some sort of convergence in our logging behaviours.
When do log aggregators come into the picture for an appropriate method for logging, and what requirements do they bring?
They make more and more sense than traditional file-based logging as the system size grows.
Log aggregators make uniformity of logging practices much more critical so that you can coalesce them and scan them more easily.
What is tracing in the context of logging?
Tracing is based on the concept of creating a unique token called a trace and using that trace in all internal logging events for that call stack by embedding this value in all of the logging and timing output for all of the services involved.
Each service uses the trace and then passes it downstream to all of the service calls that it makes. Each of those, in turn, do the same.
What does tracing help us achieve in a Microservices architecture?
Aggregation of sets of log messages and timings when looking at call metrics and behaviour. Determining the behaviour from a single client interaction through a system in a microservices architecture is hard, but tracing makes this process much simpler.
What makes continuous delivery particularly critical in a microservices architecture?
Microservices-based architectures have so many moving parts that the chances of success greatly decrease if you don’t have an automated way of building and deploying these services.
What is Hierarchical Service Architecture?
It’s a hybrid architecture that should be used only as a middle step between a monolithic architecture and a microservices one, which helps prevent circular dependencies in the network. In this architecture model, you define rules about which service types can or cannot consume other service types. It models an n-tier architecture via services instead of modules.