Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
AWS · DEA-C01

Code for data engineering

DEA-C01 · Lesson 6 of 23 · 38:10

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the DEA-C01 exam (AWS Certified Data Engineer – Associate). In this lesson: Lambda reserved and provisioned concurrency, memory and CPU, temporary storage in /tmp and shared files in Amazon EFS, the languages of data engineering (Python and SQL first, then Scala, Java, R, Bash, and PowerShell), distributed computing with partitions, nodes, and shuffles, and data structures like trees, graphs, and hash tables. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Code every day

The data engineers of AnyCompany Games write code every day: Python for Glue jobs and Lambda functions, SQL for Athena and Redshift, and shell scripts for small tasks. One Lambda function that enriches purchases slows down at peak hours, and another one needs a reference file of two gigabytes. This lesson covers Lambda concurrency and memory, storage inside Lambda, languages and frameworks, distributed computing, and data structures.

Lambda concurrency

Concurrency is the number of requests that a function handles at the same time. By default, all the functions of an account share a pool of one thousand concurrent executions in each Region, which you can ask to raise. Reserved concurrency sets aside part of that pool for one function, and also caps it, so that a busy function cannot starve the others, or flood a database behind it. Provisioned concurrency keeps environments initialized and ready, which removes cold starts for functions that must answer fast, at an extra cost. And a function that reads a stream also scales with the shards and the parallelization factor, not just with the pool.

Memory and storage

Memory is the main performance setting of a function: from 128 megabytes to about ten gigabytes, and Lambda gives CPU in proportion to memory, so more memory often means a faster run, and sometimes a cheaper one. Each function also has ephemeral storage in /tmp, from 512 megabytes to about ten gigabytes, encrypted at rest, for files that last only as long as the execution environment. To share files between functions, or keep them beyond one environment, mount an Amazon EFS file system, which needs the function in the VPC of the file system, with a mount target in each Availability Zone that it uses. Large reference files then stay in one place, and every function reads them as local files. And reuse what you load: put clients and reference data outside the handler, so that warm calls skip that work.

Languages and frameworks

Data engineering mixes several languages. Python is the most common, in Glue jobs, Lambda functions, Airflow DAGs, and notebooks, with PySpark for distributed jobs, and SQL is the language of Athena, Redshift, and Spark SQL. Scala and Java run Spark and Flink applications, the R language serves statistics, and Bash or PowerShell scripts automate small tasks and command line calls. Frameworks matter as much as languages: Apache Spark for distributed processing, Apache Flink for streams, and the AWS SDKs, like Boto3 for Python, to call AWS services from code. Pick the language that the service and the team support best, and keep the heavy work in SQL or Spark rather than in loops over single records.

Distributed computing

Distributed computing splits one big job across many machines, called nodes, that work in parallel. In Spark, a driver plans the job and splits the data into partitions, and executors on the worker nodes process those partitions at the same time. Work that needs data from other partitions, like a join or a group by, moves data across the network in a shuffle, which is the slow part. The cluster scales out by adding nodes, rather than up with a bigger machine, so a job with good partitions runs faster as you add workers. And it must survive the loss of a node: Spark computes the lost partitions again, and streaming engines restart from checkpoints.

Data structures and algorithms

Data structures shape how fast code can find things. A tree keeps items in order, like the B tree index of a database or the folders of a file system, so a lookup goes down a few levels instead of scanning everything. A graph stores nodes and the edges between them, like players who are friends or who play in the same guilds, and graph algorithms find paths, communities, or influencers. Hash tables find a key in constant time, which is how joins on keys and deduplication work, and sorting first lets an algorithm merge or search large data much faster.

Recap

Let's recap. Reserved concurrency sets aside and caps capacity, and provisioned concurrency removes cold starts. Memory also sets the CPU, /tmp holds temporary files, and EFS shares files between functions. Python and SQL lead, with Scala, Java, R, Bash, and PowerShell where they fit. Distributed computing splits data into partitions across nodes, and shuffles are the slow part. And trees, graphs, and hash tables shape how fast code finds data.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. A Lambda function enriches purchases with data from an Aurora database. At peak hours, thousands of copies run at once, the database runs out of connections, and other functions get throttled. What should the data engineer configure first?

    • Provisioned concurrency on the function
    • More memory for the function
    • Larger ephemeral storage in /tmp
    • Reserved concurrency on the function
    Show the answer

    Reserved concurrency on the function

    Reserved concurrency caps how many copies of the function run at once, which protects the database, and leaves the rest of the pool to the other functions. “Provisioned concurrency on the function” would keep environments ready, and it could even add more copies. “More memory for the function” would make each call faster, but it would not limit their number. And “Larger ephemeral storage in /tmp” is for larger temporary files, not for connections.

  2. Several Lambda functions load the same 2 GB reference file from S3 on every cold start, then join it with incoming records. The file changes once a month. Where should the file be stored?

    • In the /tmp storage of each function
    • In the deployment package of each function
    • On an EFS file system mounted by the functions
    • In the environment variables of each function
    Show the answer

    On an EFS file system mounted by the functions

    An EFS file system is mounted by every function that needs it, so the file is shared and read without copying it. “In the /tmp storage of each function” would copy the file into each execution environment, on every cold start. “In the deployment package of each function” is limited in size, and every change would mean a new deployment. And “In the environment variables of each function” is for small settings, a few kilobytes at most.

  3. AnyCompany Games wants to suggest new teammates to each player, based on who already plays together, and on friends of friends. Which data structure fits these relationships best?

    • A graph of players and the links between them
    • A tree of players sorted by their level
    • A queue of match events in arrival order
    • A hash table of player IDs and names
    Show the answer

    A graph of players and the links between them

    A graph stores players as nodes and their links as edges, and finds friends of friends by following those edges. “A tree of players sorted by their level” would keep players in order, but it would not hold who plays with whom. “A queue of match events in arrival order” would keep events in their order of arrival, with no relationships. And “A hash table of player IDs and names” would find one player quickly, but not the links between players.