Eventual Consistency
What is the primary characteristic of eventual consistency in a microservices architecture?
- Data is always immediately consistent across all services.
- Data consistency is guaranteed after a period of time.
- Transactions are atomic across all services.
- Rollbacks are immediately propagated to all services.
- All data modifications will result in an immediate error until all services are in agreement.
Database per Service
Why is the 'Database per Service' pattern generally preferred in microservices architectures?
- It reduces operational complexity by centralizing database management.
- It enhances fault isolation and prevents services from directly accessing each other's data stores.
- It improves performance due to centralized caching.
- It simplifies data consistency management across services.
- It ensures a uniform technology stack across the entire application.
Saga Pattern
Which pattern is commonly used to manage distributed transactions and maintain data consistency across multiple microservices?
- Two-Phase Commit (2PC)
- Saga Pattern
- Global Transaction Identifier (GTID)
- Distributed Lock Manager (DLM)
- Materialized Views
API Composition
What is API Composition primarily used for in a microservices architecture?
- Direct database access from multiple services
- Aggregating data from multiple microservices into a single response.
- Implementing a single global transaction across services.
- Replacing message queues with REST calls.
- Securing API access using a central authorization server.
Change Data Capture (CDC)
What is the main purpose of Change Data Capture (CDC) in the context of microservices?
- To encrypt data at rest.
- To automatically replicate data changes from one microservice database to another.
- To manage access control lists for microservice APIs.
- To monitor microservice performance metrics.
- To perform database backups on a scheduled basis.
Data Ownership
In a microservices environment, who should own the data within a service's database?
- A central DBA team.
- The team responsible for the microservice.
- A shared database team.
- All teams working on the application.
- The cloud provider.
Shared-Nothing Architecture
What is a key benefit of a shared-nothing architecture in microservices, particularly regarding data management?
- Reduced data redundancy.
- Improved scalability and fault tolerance.
- Simplified data synchronization.
- Easier transaction management across services.
- Lower operational costs due to shared infrastructure.
CQRS Pattern
What does CQRS stand for, and how does it relate to data management in microservices?
- Consistent Query and Reporting System; centralizes all data reads and writes.
- Command Query Responsibility Segregation; separates read and write operations, allowing optimization for each.
- Common Query and Result Standard; defines a universal data access language.
- Centralized Query and Reporting Service; provides a single point for data analysis.
- Command Query Retrieval Syntax; specifies a standardized way to interact with databases.
Data Versioning
Why is data versioning important when microservices share data through APIs or events?
- To reduce storage costs.
- To ensure backward compatibility and prevent breaking changes when data structures evolve.
- To improve data compression.
- To simplify data migration.
- To enforce data encryption.
Choosing the Right Database
When selecting a database for a specific microservice, what factor should be considered most important?
- The database's popularity.
- The database's compatibility with all other services.
- The database's ability to meet the service's specific data model and consistency requirements.
- The database's price.
- The database administrator's pre-existing knowledge.