Data Engineering · Module 18
Scale, performance and cost
- Lessons
- 13
- Free
- 0
- Reading
- ~4 h
Your progress
0 / 13 lessons done
Sign in to trackLessons
- Finding bottlenecks in data pipelinesPipelines get slower one model and one gigabyte at a time, until a report is late. Teams that guess spend money on the wrong step; teams that measure fix the one step that sets the finish time, often for free.
- Partitioning strategy at large scaleAt a few gigabytes a day, almost any partition column works. At hundreds of millions of rows a day, the wrong one creates millions of tiny files or leaves every query opening every file, and fixing it means rewriting terabytes. Choosing well means counting files before choosing columns.
- Data platform costs: storage, compute and transferSooner or later finance asks what the data platform costs and why it went up. You need to answer line by line, from list prices, before anyone can decide what to cut.
- Cutting warehouse and lakehouse spendWarehouse and lakehouse bills grow quietly: a setting changed for one week, a model that rebuilds everything every night, files nobody deletes. A team that can say where each credit went cuts the right thing first and doesn’t slow the reports the business waits for.
- Case: Razorpay’s 21% cut to its Spark billMost Spark bills shrink through a handful of plain moves: cheaper capacity, fewer idle nodes and settings that fit the workload. Razorpay’s account shows those moves at petabyte scale, including the two that broke jobs before they saved money.
- Autoscaling and spot capacity for data jobsData platforms run large fleets of machines for a few hours a night or a few hours a sale, which makes them the best place to save with autoscaling and spot capacity, and the easiest place to lose a report. Whether a job can lose a machine depends on what that machine was holding: shuffle files, streaming state or nothing at all.
- Disaster recovery for data platformsA data platform holds a few things that exist nowhere else and many tables built from them. Recovering from a lost region is cheap and fast when you copy the first kind and rebuild the second, and slow or impossible when you treat them the same.
- Batch and streaming together: Lambda and KappaMost data platforms end up running a nightly batch path and a streaming path side by side, whether anyone planned it or not. Knowing which one is official, how the two are kept from drifting, and how to recount either one is what stops two dashboards from arguing in front of finance.
- CI/CD for data: environments, reviews and deploysA data pipeline can pass every test and still publish a wrong number, because the tests check the code’s rules, not whether today’s answer moved. Reviewing the data a change produces, and knowing that a revert fixes code but not the rows already written, is what keeps a bad merge from reaching the people who run the business on those numbers.
- Infrastructure as code: Terraform for data platformsA data platform is hundreds of cloud objects whose settings decide who can read customer data, what gets deleted and what the bill is. Set by hand, those settings can’t be reviewed, rebuilt or checked. Written as code, every change is a reviewed plan, and a change made outside the code shows up the next morning.
- Platform teams and data mesh: who owns whatAs a company grows, one data team turns into a queue that every other team waits in, and teams start building their own copies of the data to get around it. Deciding who owns which data, and what the platform gives them, is how a data platform scales with the company instead of slowing it down.
- Case: Flipkart’s data platform move to Google CloudSooner or later most data teams move a running platform: to a new cloud, a new engine or a new messaging system, usually with a business date that won’t move. Flipkart’s account shows the shape of such a move at 10 PB a day, and what you still have to work out yourself.
- Design: halving a data platform’s monthly billEvery data team is asked, sooner or later, to cut the bill by a round number. A flat cut on every line breaks the reports people rely on, and a plan built on discounts nobody has quoted misses. This lesson puts the module’s levers into one plan, with the arithmetic shown and the promises it can keep.
Practise with
No tools or paper guides for this module yet.
Terms this module teaches 61
Open glossaryAdaptive scheduler (Flink)
A Flink scheduler for streaming jobs that runs a job at whatever parallelism the available slots allow and raises it again when more slots appear, restarting the job each time.
Amazon EMR
AWS’s managed service for running open-source data engines such as Spark on clusters of EC2 machines, on EKS, or serverless.
Amdahl’s law
The rule that speeding up one part of a job shortens the whole only by that part’s share, so the parts you don’t speed up cap the gain.
Apache Hadoop
An open-source system that stores files across many machines (HDFS) and runs batch jobs over them in parallel.
Apache Hive
An open-source engine that lets people query files on Hadoop or object storage with SQL, using a metastore that records each table’s schema and file locations.
Apache Iceberg
An open table format that turns a folder of data files on object storage into a table with snapshots, schema changes and safe concurrent writes.
Auto-suspend
How long a Snowflake warehouse waits with no queries before it stops; it bills at full rate while it waits.
AWS Graviton
AWS’s own Arm-based processors, offered as EC2 instance types.
Change freeze
A period before a critical event when no new changes ship, so the system that runs is the one that was tested.
Configuration drift
A difference between what infrastructure code says and what really exists, caused by a change made outside the code.
Cost allocation tag
A key and value attached to a cloud resource, such as team=data, that the cloud bill can group costs by once the tag is turned on for billing.
DAG import check
A test that loads every Airflow DAG file the way the scheduler would and fails if any file raises an error or a DAG is missing.
Data diff
A comparison of a table built from a proposed change with the same table in production, matched on a key, that reports which rows and values moved.
Data domain
An area of the business with its own team and its own data, such as orders, growth or fraud.
Data mesh
A way to organize data work in which domain teams own and publish their own data as products, on a shared self-serve platform, under common standards so the data fits together.
Dataproc
Google Cloud’s managed service for running open-source engines such as Spark, Hadoop and Hive on clusters it starts, scales and bills by the second.
dbt Mesh
dbt’s name for a pattern of features (groups, access, contracts, versions and refs across projects) that let many teams share models safely.
Delta Lake
An open table format that adds transactions, merges and table history to Parquet files in object storage.
Derived data
Tables, state and caches built from other data, which can be rebuilt as long as the data they were built from survives.
Disaster recovery
The plans, copies and practised steps that bring a system and its data back after a failure large enough to take out a whole site or region.
Dynamic allocation
A Spark mode in which an application adds executors while tasks wait, doubling the request each round, and removes executors that sit idle.
Executor decommissioning (Spark)
Shutting a Spark executor down gracefully when its machine is going away, so it stops taking tasks and can copy its shuffle and cached blocks elsewhere before it exits.
Failover group (Snowflake)
A replication group whose copy can be promoted to become the writable primary; it needs Business Critical Edition or higher.
Fallback storage (Spark)
A shared location, such as an S3 prefix, where a decommissioning executor puts its blocks when no other executor can take them; Spark does not clean it up.
Federated computational governance
A few global data rules agreed by the teams together and enforced automatically by the platform, with everything else decided by each team.
Fix forward
Repairing a bad release with a new change instead of reverting to the previous version.
follower fetching
Letting a Kafka consumer read from a replica in its own zone or rack instead of always from the partition leader.
Google Cloud Pub/Sub
Google Cloud’s managed messaging service: topics without partitions that scale with demand, and subscribers that acknowledge each message, delivered at least once.
Infrastructure as code
Describing servers, buckets, roles and other cloud objects in files kept in version control, so a tool creates and changes them to match.
Instance fleet
An EMR setting that lists several instance types for one node group, so the cluster can draw on whichever types have capacity.
Kappa architecture
A design with a single streaming path, where reprocessing means running the new code over the retained log again into a new output and switching readers to it.
Lambda architecture
A design that computes the same results twice: a batch layer recomputes them from all the data, a speed layer covers the recent hours the batch hasn’t reached, and queries merge the two.
Lift-and-shift
Moving software to new machines or a new cloud with as few changes as possible, leaving redesign for later.
Liquid clustering
A Delta Lake feature that groups rows with similar values in chosen columns into the same files, and can change those columns later without rewriting the table.
Node selector (Kubernetes)
A rule on a pod that lets Kubernetes place it only on nodes carrying a given label.
Offset translation
Mapping a consumer group’s position in a source Kafka cluster to the matching position in a copied topic on another cluster, where the same events have different offsets.
OpenTofu
An open-source fork of Terraform that reads the same configuration language.
Parallel run
Running an old job and its replacement side by side on the same input and comparing their outputs before anyone switches to the new one.
partition evolution
Changing a table’s partition spec without rewriting it: new data uses the new spec, old files keep the old one, and queries plan each separately.
partition transform
A function that turns a column value into a partition value in an Iceberg spec, such as day, hour, bucket or truncate.
Paved path
The supported, default way to do a common job on a platform, with its checks already built in. Teams may leave it, but then support their own route.
persisted query result
A query’s answer that Snowflake keeps and returns again for the same query text while the data it read hasn’t changed.
Pilot light
A recovery strategy that keeps data copied and core resources ready in a second region but starts the rest of the system only after a failure.
Provider (Terraform)
A Terraform plugin that knows one service’s API and supplies the resource types for it.
QUERY_ATTRIBUTION_HISTORY
A Snowflake ACCOUNT_USAGE view with each query’s share of its warehouse’s compute credits, with user and query tag; it leaves out idle time.
Remote topic (Kafka)
A topic MirrorMaker 2 creates on the target cluster to hold a copy of a source topic, named by default with the source cluster’s name in front.
Replication group (Snowflake)
A set of Snowflake objects, such as databases, copied together from one account to others on a schedule, read-only on the target and consistent to one point in time.
S3 replication
An S3 feature that copies new objects from one bucket to another automatically, in the same region or another one.
Scaling policy (Snowflake)
The rule a multi-cluster warehouse uses to start and stop clusters: Standard favours less queueing, Economy starts a cluster only when it expects about 6 minutes of work for it.
Self-serve data platform
Shared data tools that any team can use to build and publish data without filing a ticket with another team.
Shuffle tracking (Spark)
A Spark setting, on by default, that keeps an executor alive under dynamic allocation while it stores shuffle files an active job still needs.
Staging environment
A copy of production’s setup where a change runs end to end before release, on data close to production’s.
State locking
A lock Terraform takes on a state before changing it, so two runs can’t write over each other.
Table path rewrite (Iceberg)
Writing a copy of an Iceberg table’s metadata with every file path moved to a new location, so the table can be copied and read there.
table sort order
The order a table asks writers and rewrites to sort rows in, so each file covers a narrow range of the sort columns and readers can skip files.
Terraform
HashiCorp’s infrastructure-as-code tool: you declare resources in HCL files, and it plans and applies the changes that make the real cloud match.
Terraform plan
The list of creates, updates, replaces and destroys Terraform would make to bring the real cloud in line with the configuration.
Terraform state
The file in which Terraform records which real object each resource in the configuration is, with its last known settings.
WAREHOUSE_METERING_HISTORY
A Snowflake ACCOUNT_USAGE view with the credits each warehouse was billed, hour by hour.
YARN node label
A tag on a group of cluster nodes that tells YARN which containers may run there.