In a microservices system, which statement best describes the role of an aggregate?
Think about how data consistency is maintained within a group of related objects.
An aggregate groups related entities and value objects to enforce consistency rules within its boundary. It acts as a single unit for updates.
Which option correctly explains how entities within an aggregate are identified?
Consider which entity is responsible for external references.
Entities within an aggregate have unique IDs internally, but only the aggregate root's ID is used outside to maintain encapsulation.
You have a microservice managing orders as aggregates. Each order aggregate contains multiple line item entities. What is the best approach to scale this microservice when order volume grows rapidly?
Think about aggregate boundaries and transactional consistency.
Aggregates should remain consistent units. Scaling by adding instances horizontally preserves aggregate boundaries and consistency.
What is a key tradeoff when designing very large aggregates containing many entities?
Consider how aggregate size affects database transactions and concurrency.
Large aggregates reduce calls but can cause contention and slow updates due to locking and transaction size.
A microservice manages a 'Customer' aggregate with 5 entities inside. Each aggregate update takes 100ms on average. The system must handle 1000 updates per second. What is the minimum number of microservice instances needed to meet this load without queuing?
Calculate how many updates one instance can handle per second, then divide total load by that.
Each update takes 100ms, so one instance can handle 10 updates per second (1000ms / 100ms). To handle 1000 updates, 1000/10 = 100 instances are needed.