11. Design the cloud data platform for an online gaming analytics workload.
Select ingestion for gameplay and purchase events, durable raw storage, distributed transformation, session and match tables, historical warehouse or lakehouse storage, and low-latency leaderboards or operational aggregates. Include bursty launches, player and match keys, late results, replay, anti-duplication, schema evolution, access controls, workload isolation, and retention cost.
I would separate durable event capture from analytics serving: Kinesis absorbs bursty gameplay traffic, S3 keeps the replayable source of record, and Spark builds governed Iceberg tables. Redshift serves historical SQL, while Redis serves low-latency leaderboards, trading extra platform complexity for workload-specific performance and isolation.
Game clients and servers continuously produce gameplay and purchase events, while analysts and product teams need both historical analysis and fast operational views such as leaderboards. One-off pipelines are not enough because launches can create sharp traffic bursts, events can arrive late or more than once, schemas evolve, and different workloads compete for compute. I would build a reusable event-to-analytics platform with a durable raw recovery boundary, distributed processing, governed lakehouse tables, separate historical SQL and low-latency serving paths, and cross-cutting access, observability, isolation, and retention controls.
- How fresh must leaderboards and operational aggregates be compared with historical analytics?
- What ordering guarantees matter: per match, per player, or only eventual correctness after late results arrive?
- How long must raw gameplay and purchase events be retained before lifecycle policies move or delete them?
- Which datasets contain sensitive player or purchase information that needs finer access restrictions?
- How much isolation is required between BI, data-science, transformation, and operational serving workloads?
- Are schema changes expected to be backward compatible, or must the platform support controlled breaking changes?
The platform has two producer types: game clients and game servers. They emit gameplay and purchase events. Each event carries event_id for deduplication, player_id and match_id for business grouping, event_time for event-time processing, and schema_version for evolution. The platform must absorb bursty launches without making downstream analytics systems the ingestion bottleneck. It must also preserve durable history so data can be replayed when transformation logic changes or downstream tables must be rebuilt.
I would treat the immutable S3 raw archive as the system of record. Kinesis is the near-real-time transport layer, not the final recovery boundary. If downstream processing fails, durable raw events remain available for replay and recomputation.
Game clients and servers send near-real-time events into Amazon Kinesis Data Streams. The stream uses on-demand mode for variable traffic. Records use match_id or player_id as the partition key, depending on the required grouping and ordering scope. A match-oriented key is useful when events for the same match should stay together; a player-oriented key is useful for player-centric processing.
The architecture branches the Kinesis event flow toward Spark processing and toward durable raw S3 storage. For known launch spikes, the design allows pre-warming and requires throttled retries rather than uncontrolled producer retry storms.
A highly skewed partition key is an important ingestion risk. I would observe stream throughput, throttling, and consumer lag and revisit the key strategy if a small number of matches or players dominate traffic.
Every ingested event is retained in Amazon S3 as immutable raw data. The archive is organized by date and hour and by event type, matching the design. It preserves the original event payload so a bad transformation does not destroy the recovery source.
This is the platform's replay boundary. If Spark logic is wrong, a curated table becomes incorrect, or a derived table needs to be rebuilt, Spark can read the raw S3 data and recompute the affected output. Replay must remain idempotent: event_id is used to identify duplicate business events so replay does not count the same event twice.
S3 lifecycle policies move older raw objects to lower-cost storage tiers as access frequency falls. This controls long-term retention cost without making the warehouse or Redis serving layer responsible for archival history.
Apache Spark running on Amazon EMR Serverless owns distributed transformation. It processes stream events during normal operation and can also process raw S3 data during replay or recomputation.
Spark deduplicates by event_id before events affect business aggregates. It uses event_time rather than arrival time for time-dependent calculations. Watermarks bound how long streaming state waits for late results. Malformed or invalid records are validated and quarantined instead of being silently published as trusted data.
The Spark jobs create and update curated session and match data. Session records contain player_id and session_id. Match records contain match_id and player_id. Late match results can update the appropriate logical record through the curated upsert or merge path rather than creating an unrelated duplicate result.
EMR Serverless automatically scales compute for variable processing demand. Separate EMR Serverless applications provide workload isolation where different teams or workload classes should not contend inside the same application boundary. Operators observe job failures, processing lag, malformed-event counts, and data-quality alerts.
Spark writes curated tables to Amazon S3 using Apache Iceberg. Iceberg provides the logical table layer over S3 files and supports schema evolution, snapshots, and time-travel access. AWS Glue Data Catalog stores catalog metadata for these tables; it does not store the production records themselves.
The key curated products shown in the architecture are sessions and matches. Sessions contain fields such as player_id and session_id. Matches contain match_id and player_id. These keys preserve the business grain required for gaming analytics and let later processing find the records affected by delayed results.
Schema evolution is handled at the Iceberg table boundary rather than by rewriting the raw archive. The schema_version field remains part of the producer event contract, Spark validates supported versions, and malformed or unsupported records should not be published as valid curated data.
Iceberg snapshots help operators inspect earlier table states after an incorrect write. The immutable raw S3 archive remains the deeper recovery source when a full recomputation is required.
Amazon Redshift Serverless is the SQL-oriented analytics serving layer for historical data and aggregates. Game analysts, product teams, and executives use it for BI-style analytical queries rather than sending complex historical queries to Redis or the ingestion stream.
The design uses separate Redshift workgroups for workload isolation, for example separating BI from data-science workloads. This reduces noisy-neighbor effects between those query classes and gives the platform distinct operational boundaries. Access to the underlying data is still governed through the platform's identity and permission controls.
If the Redshift analytics workload fails or becomes saturated, historical SQL consumers are affected, but Kinesis ingestion, raw S3 retention, Spark processing boundaries, and the replay source remain separate. That limits the blast radius.
The low-latency path is separate from historical SQL. Spark computes real-time operational aggregates and writes them to Amazon ElastiCache for Redis. Redis stores leaderboard-oriented structures such as sorted sets for top-player rankings and other frequently read operational aggregates.
Redis is a serving layer, not the source of truth. Its contents must be reconstructable from durable data. If the cache loses state or an aggregate becomes incorrect, the affected leaderboard state is rebuilt from the durable lakehouse or raw-event history instead of treating Redis as authoritative.
Consumers that need fast leaderboard reads use Redis, while consumers that need historical analysis use Redshift or the governed lakehouse path. This keeps low-latency serving work away from historical analytical workloads.
AWS IAM and AWS Lake Formation form the access-control boundary shown in the architecture. Identities receive least-privilege access to the systems and cataloged S3 data they need. Lake Formation provides fine-grained permissions on governed cataloged data, while IAM controls service and workload identities and their allowed actions.
AWS Glue Data Catalog owns table metadata. The platform also tracks schema management and evolution so producers and consumers can understand which contracts and table schemas are valid. Production records stay in the data plane; the catalog stores metadata about them.
Access rules should distinguish producer workloads, transformation jobs, BI users, and other consumers. Audit evidence comes from monitoring and logging rather than from assuming that catalog registration alone creates complete governance.
Monitoring and logging cover the full architecture: ingestion pressure, Spark failures, replay activity, malformed records, data-quality alerts, warehouse workload behavior, Redis health, and downstream freshness. Lineage connects curated outputs back to upstream data so operators can identify affected consumers after a bad transformation or schema change.
The main correctness checks include duplicate detection, schema validation, freshness, completeness, and reconciliation after replay or recomputation. Restarting a failed task is not enough by itself; recovered outputs should be checked before they are treated as trusted again.
Cost attribution and retention policies are cross-cutting platform concerns. Raw S3 data moves to lower-cost storage tiers as it ages. EMR Serverless scales processing compute with workload demand. Separate EMR Serverless applications and separate Redshift workgroups provide explicit workload-isolation boundaries where contention matters.
The normal flow is: game clients and servers send events to Kinesis; the stream branches toward raw S3 storage and Spark; Spark validates, deduplicates, handles event time, and publishes curated Iceberg session and match tables; Spark also writes real-time aggregates to Redis; Redshift provides SQL analytics on historical data; BI and analytics users consume the historical analytics results while leaderboard consumers use the low-latency Redis serving layer.
For a Spark failure, durable raw data remains available for replay or recomputation. For duplicate delivery or replay, event_id identifies duplicate business events so the output logic can remain idempotent. For late match results, event-time handling and the curated merge path update the appropriate match or session state. For malformed data, validation and quarantine prevent incorrect records from entering trusted curated tables.
For a Redis failure, leaderboards can become temporarily unavailable or stale, but the serving state can be rebuilt from durable data. For a bad curated write, Iceberg snapshots support historical inspection and recovery of table state, while a complete recomputation can start from the raw S3 event archive.
Producer teams own correct gameplay and purchase event creation, including the agreed identifiers, event timestamp, and schema version. The shared data platform owns reusable ingestion, raw retention, Spark execution boundaries, catalog integration, governance controls, observability, replay mechanisms, and serving patterns. Data-product owners own the business meaning and validation of sessions, matches, and leaderboard or analytical aggregates.
This prevents each game or analytics team from rebuilding ingestion, storage, deduplication, access controls, replay, monitoring, and workload isolation independently. Domain-specific definitions, such as exactly how a session or leaderboard score is calculated, remain with the corresponding data-product owner.
The first trade-off is simplicity versus workload fit. A single store would be easier to operate, but burst ingestion, durable retention, distributed transformation, historical SQL, and low-latency leaderboard reads have different needs. This architecture uses more components so those workloads can scale and fail independently.
The second trade-off is freshness versus cost. Streaming Spark processing and Redis provide fast operational results, while S3 carries durable history more economically. The platform therefore reserves the low-latency serving layer for operational aggregates instead of placing all retained history there.
The third trade-off is shared efficiency versus isolation. Shared serverless services can use capacity efficiently, while separate EMR Serverless applications and Redshift workgroups reduce contention between workload classes. Greater isolation creates more operational boundaries to manage and attribute.
The final trade-off is late-data correctness versus processing-state cost. A longer watermark accepts more delayed results inside the streaming path but holds event-time state longer. A shorter watermark reduces state but increases the chance that very late results require an explicit replay or correction path.
- Define the event contract: event_id for deduplication, player_id and match_id for business grouping, event_time for late-data processing, and schema_version for evolution.
- Put Amazon Kinesis Data Streams at the near-real-time ingestion boundary and use match_id or player_id as the partition key according to the required ordering and grouping scope.
- Branch events to immutable Amazon S3 raw storage so replay and recomputation do not depend on downstream analytical or serving systems.
- Run Apache Spark on Amazon EMR Serverless for distributed stream processing and S3 replay. Validate records, deduplicate by event_id, use event-time watermarks, quarantine malformed data, and compute session, match, and operational aggregates.
- Publish curated session and match tables to Apache Iceberg on S3 and register their metadata in AWS Glue Data Catalog. Use Iceberg schema evolution and snapshots for controlled table evolution and historical inspection.
- Use Amazon Redshift Serverless for historical SQL analytics, with separate workgroups where BI and data-science workloads require isolation.
- Write low-latency leaderboard and operational aggregates to Amazon ElastiCache for Redis. Treat Redis as rebuildable serving state, not durable truth.
- Apply IAM and Lake Formation permissions to workloads and cataloged data. Track schema changes, lineage, data-quality alerts, cost attribution, and retention policies.
- Isolate transformation workloads with separate EMR Serverless applications where needed and observe ingestion pressure, processing state, data quality, warehouse behavior, cache health, and cost.
- Recover by replaying or recomputing from durable S3 data, use event_id to make business outcomes idempotent, and validate rebuilt outputs before republishing them.
The first scaling pressure is ingestion during a game launch. Kinesis must distribute traffic across partition keys without allowing one very hot match or player key to dominate the stream. Spark compute grows with event throughput, transformation work, replay volume, and the amount of state retained for event-time processing. Longer watermarks can accept more late results but keep more streaming state.
S3 storage grows with retained raw events and curated lakehouse data, so lifecycle policies matter for old history. Iceberg metadata and table maintenance also grow as files, snapshots, and schema changes accumulate. Historical SQL cost depends on Redshift workload and concurrency, while Redis cost depends on how much low-latency aggregate state must stay available for serving.
Separate EMR Serverless applications and Redshift workgroups reduce noisy-neighbor risk but create more operational boundaries. Replay temporarily increases S3 reads and Spark compute, so operators should control replay concurrency rather than allowing recovery work to overwhelm normal processing.
There is no single big-O expression that describes the whole platform. In simple terms, event-processing work grows roughly with the amount of data processed, while retained storage grows with the amount of history kept by retention policy. The architecture deliberately spends extra platform complexity to separate burst ingestion, durable recovery, historical analytics, and low-latency serving.
This question tests whether a Data Engineer can turn different gaming workloads into one coherent platform. The important judgment is separating burst-tolerant event ingestion, durable event history, distributed transformation, historical analytics, and low-latency serving while still handling duplicates, late data, replay, schema changes, access control, noisy neighbors, and retention cost. It also tests whether the candidate understands that the raw S3 event archive is the recovery boundary and that a cache or warehouse should not become the only copy of important gameplay data.
A common mistake is sending events directly to the warehouse and making it both the ingestion system and the recovery source. That makes burst handling, replay, and workload isolation harder. Another mistake is treating Redis as durable truth even though leaderboard state should be rebuildable from durable data.
Candidates also often say 'exactly once' without defining an end-to-end correctness boundary. This design instead uses event_id-based deduplication and idempotent replay behavior. Another mistake is using processing arrival time for match results and ignoring late events; the design uses event_time and watermarks, with replay or correction for results outside the normal streaming window.
Other mistakes include confusing AWS Glue Data Catalog metadata with production records, assuming Iceberg snapshots replace the immutable raw archive, ignoring producer schema compatibility because Iceberg supports schema evolution, or assuming a partition key provides complete workload or tenant isolation.
It is also weak to put every workload into one shared compute boundary. The architecture explicitly uses separate EMR Serverless applications and separate Redshift workgroups when stronger workload isolation is needed. Finally, candidates should not ignore retention cost: raw S3 history needs lifecycle policies, while Redis should contain only operational aggregates that benefit from low-latency serving.
Explain the design as four boundaries rather than as a vendor list: burst-tolerant ingestion, durable replayable truth, governed analytical processing and history, and workload-specific serving. Then trace one gameplay event end to end and explain duplicates, a late match result, a Spark failure, and a Redis rebuild.




