Practice
Solution
Step 1: Identify Consistency role
Consistency ensures database state adheres to all defined rules and constraints after transaction commits.Step 2: Differentiate from other ACID properties
Atomicity ensures all-or-nothing commit, Isolation controls concurrent access, Durability ensures persistence, but only Consistency enforces business rules.Final Answer:
Option A -> Option AQuick Check:
Consistency enforces schema and business rules post-commit [check]
Solution
Step 1: Identify durability and scale needs for raw uploads
Raw uploads require durable, scalable storage that can handle large binary files and high concurrency. Redis (Use an in-memory cache like Redis to store raw uploads temporarily) is in-memory and not durable for large files. Relational DBs (Store raw uploads directly in a relational database for strong consistency) are inefficient for large blobs and scale poorly. CDN edge caches (Use a CDN edge cache to hold raw uploads before transcoding) are for delivery, not upload storage.Step 2: Recognize object storage suitability
Distributed object storage like S3 provides durability, scalability, and cost-effective storage for large files, making it ideal for raw uploads before transcoding.Final Answer:
Option C -> Option CQuick Check:
Object storage ensures durable, scalable raw upload storage [check]
Solution
Step 1: Trace Database Proxy behavior at Step 4
Upon detecting primary failure, the proxy marks it unavailable and waits for leader election to complete before routing queries to the new leader.Step 2: Eliminate other options
Forwarding immediately to old primary (A) causes timeouts; queuing indefinitely (C) stalls clients; returning errors without retry (B) reduces availability.Final Answer:
Option A -> Option AQuick Check:
Proxy reroutes queries only after leader election [check]
Solution
Step 1: Identify component capabilities
Load Balancers typically operate at transport layer and may support SSL termination but lack detailed HTTP header manipulation; API Gateways add overhead and are less optimized for raw throughput; DNS load balancing does not handle SSL termination.Step 2: Match requirement to component
Reverse Proxy operates at HTTP layer, supports SSL termination and header manipulation efficiently, suitable for high throughput.Final Answer:
Option A -> Option AQuick Check:
Reverse Proxy = HTTP layer control + SSL termination [check]
Solution
Step 1: Understand queue's role in message deduplication and buffering
Queues often provide deduplication and buffering to ensure exactly-once or at-least-once delivery.Step 2: Consequence of removing the queue
Without the queue, messages may be duplicated due to lack of deduplication and buffering mechanisms.Final Answer:
Option B -> Option BQuick Check:
Removing queue causes message duplication due to missing deduplication [check]
