Explain when data size, arrival rate, and variety make a single-machine design impractical.
Choose a data layout that supports reliable storage and efficient queries.
Trace how a distributed job partitions work, exchanges data, and recovers from failure.
Distinguish batch processing from stream processing and reason about event time and late data.
Calculate storage, transfer, and processing costs from explicit assumptions.
Apply data quality, privacy, and access controls across a data pipeline.
Choose an architecture from workload requirements and explain its trade-offs.
§1 · Definitions
Core concepts
This section defines Big Data, distributed systems, records and datasets, and two common processing modes.
An online shop might produce orders, page visits, and inventory updates. Its order dataset may fit on one machine while the page-visit dataset does not, or a small dataset may still need distributed processing to meet a short response deadline. A distributed system divides storage and computation among machines, but coordination, network transfers, and partial failures become part of the design. Batch and stream processing describe how work is organized; either can operate on data held across many machines.
Vertical scaling changes the capacity of a single failure and scheduling boundary. It is often a sensible first step when data fits comfortably on one machine, because it avoids splitting a job and exchanging results over a network. Horizontal scaling can add aggregate capacity beyond one machine's limit, but a job benefits only when its work can be divided. A calculation that must proceed through one serial step remains limited by that step, regardless of how many idle workers are available. The design question is therefore which parts of the workload can run independently and which parts require shared state or communication.
The same dataset can support very different workloads. A historical report may scan every event once a day, a product page may look up one item thousands of times per second, and a fraud check may need a recent summary within seconds. Their record counts alone do not identify the right design. Storage layout, computation, and the time allowed for an answer all matter. A system may keep one durable copy of the input and create several derived views because no single layout makes all those access patterns efficient.
The common confusion is to treat Big Data as a synonym for a particular product or a threshold such as one terabyte. It describes a mismatch between workload requirements and a simple design. A larger machine may solve some workloads more cheaply than a cluster, while other workloads need distribution for their rate, availability, or geographic reach.
§2 · Study section
Workload and data shape
Before choosing technology, describe what arrives, how quickly it arrives, and what questions must be answered. The amount of stored data affects capacity; the arrival rate affects how data is received; the required answer time affects processing and lookup methods. Different record shapes also affect how easily data can be validated and analyzed.
A schema makes it possible to reject malformed records and to interpret a field consistently across jobs. Structured records are straightforward to filter by field; unstructured content usually needs extraction or specialized preparation before the same kind of query is possible. Throughput and latency must be stated separately: a nightly job may process billions of records but return no immediate answer, while a live dashboard may require a result within seconds at a much lower total rate.
For a useful workload description, name the expected and peak arrival rates, average and largest record sizes, the period for which data must be retained, and the number of readers. State whether queries select a few records or summarize most of them. Cardinality helps predict whether a field is a useful grouping rule: a date field with a manageable number of dates can divide files into useful groups, while a unique event ID can create an impractically large number of groups if used directly. Selectivity helps estimate how much work a filter avoids. A query that keeps one record in a million benefits from a lookup structure or a way to skip irrelevant groups; a query that keeps half the dataset may be better served by reading records in sequence.
Data freshness differs from query latency. A dashboard can answer a request in 50 milliseconds while showing data from yesterday; its query latency is short but its freshness is poor. Conversely, a job can incorporate an event immediately and still take several seconds to answer a complex query. Specify both limits separately. Also decide whether late or corrected input should revise prior answers, because that decision affects storage and processing long after the first result appears.
Peak rates matter more than averages when deciding whether a receiver needs spare capacity or a place to queue records. If a feed averages 10,000 records per second but reaches 40,000 during a sale, a design sized only for the average will accumulate work. A queue can absorb a temporary burst if later processing has enough spare capacity to catch up; if the sustained input rate exceeds the processing rate, the backlog grows without bound. The workload description should therefore include how long a peak lasts and how soon delayed records must be processed.
Record size should be measured as a distribution, not only as an average. A few unusually large records can exceed message or memory limits even when the daily byte total is manageable. Likewise, growth estimates should describe what causes growth: more users, more events per user, additional fields, or longer retention. Each cause may affect a different part of the system. More users can increase the number of active keys in a stream job, while longer retention mainly increases storage and the range of historical scans. Measurements from representative busy periods are more useful than a single quiet-day sample.
Worked exampleEstimating daily input
Consider an event feed with 10,000 records per second. Assume each encoded record averages 500 bytes and the rate stays constant for 24 hours. One day contains 24 × 60 × 60 = 86,400 seconds. The feed therefore produces 10,000 × 86,400 = 864,000,000 records per day, or 864,000,000 × 500 = 432,000,000,000 bytes per day. In decimal units, that is 432 GB per day. As a check, 10,000 × 500 = 5,000,000 bytes per second, and 5,000,000 × 86,400 gives the same daily total. This is input volume before copies, extra lookup data, temporary files, or compression.
Assume this feed reaches 40,000 records per second for one hour each day, replacing one hour at the usual 10,000-record rate. The extra records are (40,000 − 10,000) × 3,600 = 108,000,000. They add 108,000,000 × 500 = 54,000,000,000 bytes, or 54 GB, making that day's total 432 + 54 = 486 GB. The peak input rate is 40,000 × 500 = 20,000,000 bytes per second, four times the usual rate. The daily total and peak rate answer different capacity questions: one concerns storage growth, while the other concerns the receiver's ability to keep up during the busiest hour.
§3 · Study section
Storage and data layout
Once the workload is known, records need a durable location and a layout that lets jobs read only what they need. A common design separates the stored files from the computers that process them. Data is divided across storage units so capacity and read work can grow, while additional copies protect against hardware failure.
The physical layout should be selected from actual query filters. If reports routinely ask for a date range, date partitions let partition pruning exclude other dates. If reports often ask for one customer across many dates, date partitions alone may still require reading numerous files; a second layout or a dedicated lookup store may be justified. Partitions should be neither so broad that every query reads most data nor so narrow that each one contains tiny files. Compaction reduces the overhead of opening thousands of files and can improve compression, but it consumes resources and may temporarily need extra space.
The catalog makes raw files discoverable as named datasets and records what their columns mean. Keeping files without a dependable catalog can leave readers unable to tell which version is current, which fields are valid, or whether two datasets use the same units. A data lake therefore needs management as well as inexpensive storage. Keeping the original input can support reprocessing after a bug is found, while cleaned and derived datasets avoid repeating expensive preparation for every reader. The distinction between raw and published data should be visible in names, permissions, and lineage.
The diagram shows how records move through ingestion into dated partitions and then into a query job.
Storage flow
Read the arrows from left to right. A query for one date can read one partition; a query across all dates reads all three. Partitioning reduces unnecessary reads only when the partition rule matches a common filter. A poor rule can create many tiny files or put most records in one partition, making jobs slower or uneven. Columnar files further reduce reads when a query needs only a few fields, and compression reduces storage and transfer at the cost of decoding. Replication improves durability but increases physical storage and does not replace a backup against accidental deletion or corruption.
For example, a row-oriented representation of orders places each order's ID, date, customer, items, and amount together. It is convenient when a request needs a complete order. A columnar representation groups amounts together and dates together, so a query computing total sales by date need not read item descriptions or delivery addresses. Columnar compression can also work well when adjacent values are similar. Writing and updating individual records may be less convenient, however, because a change can affect several separately stored columns. The right layout follows the balance of reads, writes, and updates.
Copies solve a different problem from historical recovery. If a disk fails, a surviving copy may keep the data readable. If a job overwrites correct data with incorrect data, all current copies may reflect that change. Independent backups or preserved earlier versions allow recovery to an earlier state. Their value depends on testing restoration, because an unreadable or incomplete backup does not provide a recovery path. Retention rules should cover both working data and backups; otherwise old copies can outlive the policy that justified storing them.
Worked exampleAccounting for storage copies
Take the constant-rate case of 432 GB of daily input. Assume compression reduces the stored bytes to 40% of input and the system keeps three full copies. One stored copy uses 432 × 0.40 = 172.8 GB. Three copies use 172.8 × 3 = 518.4 GB per day. For a 30-day retention period, the total is 518.4 × 30 = 15,552 GB, or 15.552 TB in decimal units. The check is that replication multiplies the compressed size, while compression does not change the logical number of records. File descriptions, lookup data, and temporary processing space would add to this estimate.
Assume a daily transformation also writes a cleaned copy equal to 60% of each day's compressed input and retains it for the same 30 days with three copies. One day's cleaned logical data is 172.8 × 0.60 = 103.68 GB; its physical copies use 103.68 × 3 = 311.04 GB. Thirty days add 311.04 × 30 = 9,331.2 GB, or 9.3312 TB. The combined stored data is 15.552 + 9.3312 = 24.8832 TB. This check matters because derived datasets can make a storage estimate based only on raw input much too low.
§4 · Study section
Distributed computation
With data spread across machines, a job can assign independent parts to machines that perform the work. Some operations, such as counting records in each partition, can be completed mostly where the records are read. Grouping records by a field requires moving records so that all values for the same key meet at one machine. That movement often costs more than the arithmetic itself.
A distributed job can be represented as a DAG: read inputs, filter records, transform fields, group by key, and write results. The dependencies tell the scheduler which tasks can run together. A map operation on each input partition can run in parallel within a stage, while the reduce stage waits for the shuffle to deliver its assigned keys. More workers help when many independent tasks are ready and the input and network can feed them. They help less when the job has a long serial dependency chain, when only a few partitions exist, or when a single machine holds the slowest key.
Joins make data movement especially visible. If two datasets are already distributed by the same join key, matching records may meet without a large exchange. Otherwise, one or both sides must move. When one side is small, it can sometimes be copied to each worker so the larger side stays in place. When both sides are large, redistributing by key may be necessary. The decision depends on the actual size after filtering, available worker memory, and the cost of network transfer. Measuring only the size of source files can mislead if filters remove most rows before the join.
The diagram traces a grouped count through mapping, network exchange, and reduction.
Distributed count
Each map worker emits a key and a value. The shuffle sends equal keys to the same reduce worker, which combines their values. A heavily used key can leave one reduce worker with far more work than the others, so adding workers alone may not shorten the job. Frameworks can retry failed tasks, but output writes must be designed so a retry does not duplicate a result. Checkpoints shorten recovery by avoiding a full restart; how much work is replayed depends on when progress is recorded.
For sums and counts, each map worker can often combine its local values before the shuffle. If one worker sees a million purchases of product A, it can send one pair containing A and the local count instead of a million pairs. That reduces network bytes without changing the total, because addition can combine partial results in any grouping. This shortcut does not apply to every calculation. An average, for example, requires a sum and a count from each worker; averaging worker averages directly gives the wrong result when workers have different record counts. The form of the intermediate data must preserve the information needed for a correct final answer.
Data skew can appear even when input files are evenly sized. Imagine one product accounts for half of all purchases. A shuffle that sends each product to one reducer concentrates half the records on one worker. Possible responses include combining local values before the shuffle, splitting the heavy key across several workers and combining partial answers later, or choosing a different division of work. The appropriate response depends on the calculation: a large join may need a different treatment from a count. Measure the largest partition and the slowest task, because an average task duration hides the worker that determines completion time.
Task retry is useful when a worker stops, but the data needed for retry must remain available outside that worker's failure domain. If the only copy of an input partition is on a failed machine, moving the task elsewhere cannot recover it. Durable input, replicated storage, or a way to read the source again lets another worker repeat the computation. The scheduler also needs to know whether an output is safe to repeat. A temporary intermediate file can be discarded and rebuilt, while a payment or external notification may need a key that prevents repeated effects before retry. Recovery design therefore follows both the data's location and the side effects of each stage.
Worked exampleCounting by key
Consider four purchase records with product IDs A, B, A, and A, split evenly between two map workers. The first worker emits (A, 1) and (B, 1); the second emits (A, 1) and (A, 1). The shuffle sends three A values together and one B value separately. Reduction computes A = 1 + 1 + 1 = 3 and B = 1. The final counts add to 3 + 1 = 4, matching the four input records. That equality is a useful check when each input record contributes exactly one count.
Worked exampleWhy partial averages need counts
Consider two workers calculating the average order value. The first holds two orders worth 10 and 20 units, so its local sum is 10 + 20 = 30, its count is 2, and its local average is 30 ÷ 2 = 15. The second holds one order worth 90 units, so its sum is 90, its count is 1, and its local average is 90. Averaging the two local averages gives (15 + 90) ÷ 2 = 52.5, which is wrong because it gives the workers equal weight. Combining sums and counts gives (30 + 90) ÷ (2 + 1) = 120 ÷ 3 = 40. The check is to calculate directly from all three orders: (10 + 20 + 90) ÷ 3 = 40.
§5 · Study section
Batch and stream processing
Batch processing works over a known slice of data, such as yesterday's orders. Stream processing maintains results as new records arrive. Both can use distributed computation, but an unbounded stream needs explicit rules for when a result is considered ready and what happens when an old event arrives late.
A batch has a natural end: once all chosen records have been read, a final result can be written. A stream has no natural end, so windows and state give the job finite units of work. A fixed five-minute window assigns each event to one five-minute interval. An overlapping window could, for example, calculate a ten-minute total every five minutes, so one event contributes to two published totals. State must be kept for every open window and key, which means the number of active keys and the late-event allowance affect memory and checkpoint size.
Replay is useful when code changes or a failed worker must rebuild its state, but it also means the output may see the same logical event again. At-least-once delivery protects against silent loss during uncertain failures by permitting duplicates. An idempotent operation turns those repeated deliveries into one intended output effect. If the output store cannot support a suitable idempotent write, the system may need a coordinated commit or a later process that identifies duplicates. The delivery guarantee and the published-result guarantee should be described separately.
The diagram shows how an arriving event becomes part of an event-time window before a result is published.
Event-time processing
Read the upper path as the record flow and the lower arrow as the timing rule for publication. An event can arrive at processing time 10:07 even if its event time is 10:02; an event-time window for 10:00–10:05 should place it in the earlier interval. A watermark expresses an estimate, not proof that no earlier event will ever arrive. The system therefore needs a policy for late events, such as updating an earlier result, sending the event to a separate review path, or dropping it after a stated limit. Because failures can cause records or writes to be retried, an idempotent output keyed by event or window can prevent duplicate effects. A claim of exactly-once results must cover the complete path, including the output system, rather than only one processing stage.
A longer wait for late events can make a first published result more complete, but it also delays publication and retains more state. An earlier result is more timely but may need revision. The choice should follow the reader's use: an operational dashboard may accept a provisional count that later changes, while a financial report may wait for reconciliation and a defined close. It helps to publish both the result and its status, such as provisional or final, so a reader can interpret a changing value.
Backpressure matters when records arrive faster than a processor can update its state or write outputs. The input queue can absorb a short surge, but its backlog then increases data freshness delay. If the processor handles 8,000 records per second while 10,000 arrive continuously, 2,000 records are added to the backlog every second. Adding workers helps only if the work can be divided and the output store can accept the higher rate. Monitoring the age of the oldest waiting record reveals delay more directly than monitoring queue length alone when record sizes or rates vary.
Worked exampleA late event
Consider five-minute windows and three events with event times 10:01, 10:04, and 10:02. Assume the first two arrive before 10:05 and the third arrives at processing time 10:07. All three belong to the event-time interval 10:00–10:05. Before the late arrival, the window count is 1 + 1 = 2; after accepting it, the count is 2 + 1 = 3. The check is that membership follows event time, so the processing time of 10:07 does not put the third event into the 10:05–10:10 window. Whether the published count changes from 2 to 3 depends on the late-event policy.
Worked exampleDraining a short backlog
Consider a processor that handles 12,000 records per second. Assume a burst supplies 18,000 records per second for ten minutes, after which the arrival rate falls to 8,000 per second. During the burst, the backlog grows by 18,000 − 12,000 = 6,000 records per second. Ten minutes is 10 × 60 = 600 seconds, so the backlog reaches 6,000 × 600 = 3,600,000 records. After the burst, spare processing capacity is 12,000 − 8,000 = 4,000 records per second, so draining takes 3,600,000 ÷ 4,000 = 900 seconds, or 15 minutes. As a check, 4,000 × 900 = 3,600,000 records. This estimate assumes the processor maintains its stated rate and no further bursts occur.
§6 · Study section
Data quality and governance
A large data system can produce an answer quickly and still be wrong. Validation must account for missing, duplicated, malformed, or delayed records. Controls must also determine who may access sensitive fields and how long data is retained. These requirements apply at ingestion, storage, processing, and publication.
Data quality checks should be tied to the meaning of the dataset. A nonempty order ID, a valid currency code, and a nonnegative quantity are useful field checks, but they do not prove that every accepted order arrived. Completeness needs a comparison against an expected count, sequence, source total, or known delivery interval. Timeliness needs a measured delay from event time to availability. Correctness may need reconciliation between independent systems. A check that records only whether a job ran successfully can miss all four kinds of problem.
A data contract reduces ambiguity at the boundary between producers and consumers. It should say whether a new field is optional, what a missing value means, which timestamps use which time basis, and how changes are announced. When a producer renames a field without coordination, a consumer may silently interpret it as absent. When a producer changes a field from pounds to pence while keeping the name, a calculation may remain syntactically valid and become wrong by a factor of 100. Schema validation should therefore check meanings and units where possible, not just field names and types.
The diagram shows where checks and controls attach to a typical data pipeline.
Data quality and access
The main path moves records toward a published dataset; the lower arrows show rules that govern both stored inputs and outputs. At ingestion, the system can reject malformed records and count rejections. During transformation, it can check uniqueness, expected value ranges, and whether counts reconcile with inputs. Schema evolution must account for readers of older records; for example, adding an optional field is usually easier to handle than changing the meaning of an existing field. Lineage lets a reader trace a surprising aggregate back through transformations to its inputs. Access control should limit raw sensitive fields even when a published aggregate is broadly available, and retention rules should remove data when it is no longer needed or permitted to be kept.
Deduplication requires a stable way to recognize the same logical event. Two purchases by one customer at the same price are distinct purchases, while the same purchase delivered twice after a retry should count once. A producer-assigned event ID can distinguish those cases if the producer preserves it across retries. Without such an ID, a processor may infer duplicates from a combination of fields and time, but that can discard legitimate repeated events. The deduplication rule should be documented with the metric it affects, because removing a duplicate from a sales total is different from recording that a message was delivered twice.
Privacy and access decisions also depend on the intended use. A raw event may contain an address needed for delivery, but a sales trend usually needs only a region and amount. Removing or generalizing unnecessary fields before publishing a dataset reduces the number of readers who can see sensitive information. Access rules should be tested at the dataset and field level, and they should follow derived copies rather than only the original input. Retention and deletion need similar attention: removing a record from the raw dataset while leaving it in a published copy may not meet the intended policy.
Worked exampleReconciling a daily count
Consider an input log that records 1,000 accepted orders for a day. Assume the processing job reads one message for each accepted order, plus 20 repeated deliveries of existing orders and 5 malformed messages that are distinct from the accepted orders. The number of read messages is 1,000 + 20 + 5 = 1,025. Removing the 20 repeated deliveries and 5 malformed messages leaves 1,025 − 20 − 5 = 1,000 valid unique orders. This matches the input log's accepted-order count. The check only supports completeness if both counts cover the same day, use the same order definition, and the input log itself is trusted.
§7 · Study section
Choosing an architecture
Architecture follows the questions a system must answer. A reporting team may need scanned historical data; an application may need fast lookups by key; an operations dashboard may need continuously refreshed counts. One storage or processing pattern rarely serves all three with the same cost and delay.
The table compares common patterns by the work they support and the limits to plan for.
Pattern
Typical work
Strength
Main design pressure
Data lake with batch jobs
Retain raw inputs and process large historical slices.
Flexible storage for varied data.
Dataset structure, file layout, and quality need active management.
Data warehouse
Run repeated analytical queries on curated data.
Query and governance features are integrated.
Loading, transformation, and query costs need control.
Lakehouse
Query and update managed tables over lake storage.
Shared files can support several analytical workflows.
Table maintenance and competing workloads need coordination.
Stream processor with serving store
Refresh operational views as events arrive.
Results can become available quickly.
State, late data, retries, and serving capacity need explicit design.
The patterns can be combined: raw events can be retained in a lake, transformed into warehouse or lakehouse tables, and summarized into a serving store. Choose by writing down the required freshness, query shape, retention period, correctness rule, access boundary, and budget. Estimate data read and transferred as well as data stored; a design that saves storage but repeatedly scans every record may cost more and answer more slowly.
The first choice is often whether a second system is justified at all. If a daily report can complete within its deadline on an existing database, copying all data into a new cluster introduces more storage, transformation work, and reconciliation. If analytical scans slow customer transactions, separating the reporting workload can protect the application. That separation creates a new freshness question: the reporting copy may lag behind the source, so its delay and reconciliation status should be visible. The system should be as distributed as the measured workload requires, with room to grow without making ordinary operations difficult to understand.
Query shape matters as much as dataset size. A warehouse or lakehouse is well suited to grouping many rows, joining curated tables, and exploring historical trends. A serving store can answer a narrow lookup quickly but may require an upstream job to prepare exactly the fields the application will request. A stream processor can update those fields incrementally, while a batch job can periodically rebuild them to catch mistakes or incorporate corrected input. A design that uses both paths needs a clear rule for which result is authoritative and how they are reconciled.
Cost should be decomposed rather than reduced to one storage price. Stored raw data, derived copies, network transfer, compute time, repeated scans, continuously running stream workers, and serving queries all consume resources. Operational work also matters: repairing failed jobs, handling schema changes, and checking results take time. A smaller storage bill may be offset by frequent full scans, and a low-latency dashboard may require processors and a serving store to run even when few people are viewing it. Estimate each major component from rates and query patterns, then measure actual use and revise the estimate.
Architecture decisions should also state what happens when an input arrives late, a job fails halfway through, or a derived dataset is found to be wrong. Retaining raw input makes a corrected transformation possible, but only if the input's meaning and schema can still be interpreted. Keeping a published version until its replacement has passed checks can prevent readers from seeing a partly rebuilt result. The recovery plan needs a deadline: a daily report that can be rebuilt overnight has a different requirement from a dashboard that must recover in minutes. These operating rules are part of the architecture, because they determine storage retention, compute headroom, and which outputs can be safely replaced.
Worked exampleComparing repeated scans
Consider a daily report that reads 2 TB of stored data. Assume the report runs 20 times per day and a preparation step could create a 100 GB daily summary that each report would read instead. Repeated full scans read 2 × 20 = 40 TB per day. Preparing the summary once reads 2 TB, and the 20 later queries read 100 × 20 = 2,000 GB, or 2 TB, for a total of 4 TB per day. The difference is 40 − 4 = 36 TB of data read per day, a 90% reduction in this simplified comparison. The check is that preparing the summary alone already accounts for one full 2 TB scan; the estimate also assumes the summary contains everything those reports need and ignores its writing and storage costs.
· · Practice
Common mistakes
The first mistake is choosing a cluster just because a dataset sounds large. This happens when byte count stands in for workload analysis. Estimate the actual storage, memory, throughput, and latency needs first; a single machine may satisfy them with less coordination.
The second mistake is assuming partitions always speed up queries. This happens when partitioning is treated as a storage feature rather than a filter strategy. Partition on fields that common queries use, and avoid uneven partitions and excessive tiny files.
The third mistake is treating an event's arrival time as its occurrence time. This happens because arrival order is easy to observe. Use event time when results must reflect when events happened, and define how late events change published results.
The fourth mistake is equating task retries with exactly-once results. This happens because processing can appear successful even when an output write is repeated. Make output operations idempotent or coordinate the processing state and output commit across the complete path.
The fifth mistake is measuring only whether a job finished. This happens when pipeline health is reduced to uptime. Check rejected records, duplicates, missing intervals, freshness, and reconciliation against expected totals.
· · Practice
Practice questions
These questions mix recall, calculation, and application across the whole guide; each answer is collapsed beneath its question to be opened once the reader has worked out an answer.
Question 1 · recall
Why does the term Big Data have no fixed byte threshold, and which workload properties should be measured before choosing a distributed design?
Answer
The threshold depends on what one machine can do within the required cost and time. Measure stored volume, arrival rate, record shape, query patterns, throughput, latency, retention, and reliability needs. A workload may require distribution because of processing speed or availability even when its stored volume is modest.
Question 2 · calculation
A feed produces 2,000 records per second, averaging 1,000 bytes each. Assume a constant rate, compression to half the input bytes, and two full stored copies. How many decimal GB of physical storage does one day of input require before extra lookup data and temporary files?
Answer
One day has 24 × 60 × 60 = 86,400 seconds. Input is 2,000 × 1,000 × 86,400 = 172,800,000,000 bytes, or 172.8 GB. Compression gives 172.8 × 0.5 = 86.4 GB per copy. Two copies require 86.4 × 2 = 172.8 GB. As a check, halving the bytes and then doubling the copies returns the original input-byte total.
Question 3 · application
A query reads only the price and date fields of orders from one week. Explain how a date partition and a columnar file layout can reduce the work compared with scanning all fields of all orders.
Answer
The date partition lets the query skip files outside the requested week. Within the selected files, the columnar layout lets it read the date and price columns without loading unrelated fields. The gain depends on the partition matching the filter and on files being large enough that metadata and file-opening overhead do not dominate.
Question 4 · calculation
Two map workers process six records with keys A, A, B and A, B, B. Each record contributes one count. What values reach each reducer after a shuffle by key, and how can the result be checked?
Answer
The A reducer receives three values of 1, so A = 1 + 1 + 1 = 3. The B reducer also receives three values of 1, so B = 3. The counts sum to 3 + 3 = 6, matching the six input records. Each input contributed exactly once.
Question 5 · misconception
A stream job retries a failed task and reports that it processed each record exactly once. Why might its published results still contain duplicates?
Answer
The task may write a result and fail before recording that the write succeeded. On retry, it writes the same result again. Processing guarantees inside the job do not automatically cover the output store. An idempotent write keyed by event or window, or a coordinated output commit, is needed to prevent the duplicate effect.
Question 6 · open-ended
An online shop wants to retain raw events for a year, publish daily sales reports, and show a dashboard that updates within one minute. Propose a storage and processing path, and explain how it would handle late events, quality checks, access, and cost.
Answer
Retain raw events in partitioned object storage for the stated period. Validate fields and record rejection counts during ingestion, then run batch transformations for reconciled daily reports in a warehouse or managed lake tables. A stream processor can maintain one-minute aggregates in a serving store for the dashboard. Use event timestamps to assign windows, choose a stated late-event limit, and revise or flag dashboard results when accepted late events arrive. Use idempotent output keys so retries do not double-count sales. Restrict access to raw customer fields, publish only fields needed by each audience, and retain lineage from reports to raw inputs. Estimate a year's compressed storage and copies, the records read by daily jobs, stream state size, and serving queries before choosing capacity.
· · Finish
Review checklist
Without consulting notes, the reader should be able to explain when distribution helps, describe how schema and workload shape storage choices, calculate input and replicated storage, trace a map–shuffle–reduce job, distinguish event time from processing time, explain a watermark and a late-event policy, identify checks for data quality and access, and choose a batch, warehouse, lakehouse, or streaming pattern for a stated workload. A reader who can do all of these has covered the material.