
Data Preparation in the Cloud
116
Setting up a single machine for ETL: Amazon Elastic Compute (EC2) is a virtual computing
environment that’s referred to as an instance or a node (https://aws.amazon.com/
ec2). is service virtually allocates a machine of your choice: a machine with various types
of CPUs/GPUs, network connections, security settings, and disks. Furthermore, there is a set
of pre-congured environments called Amazon Machine Images (AMIs) running various
operating systems, services, and libraries. For example, you can get an Ubuntu machine
with a Jupyter notebook that supports TensorFlow (TF) projects within a couple of clicks
on the web console. In the Setting up a single-node EC2 instance for ETL section, we will
take a closer look at how to set up an EC2 instance with Spark, and a Jupyter notebook for
the ETL process.
Setting up a cluster for ETL: e advantage of having a cluster for ETL comes from the
throughput; we can process a large amount of data more eciently. However, there are also
downsides – for example, it requires dedicated machine learning operations (MLOps)
engineers for maintenance. Elastic MapReduce (EMR) is a managed cluster platform
provided by AWS that helps set up an ETL process using multiple machines with minimal
eort (https://aws.amazon.com/emr). Conguring EMR includes specifying the
number of EC2 nodes, the type of EC2 nodes (compute intensive versus memory intensive),
scripts that will run on each node, security groups, subnets, and tags. e Setting up an EMR
cluster for ETL section is dedicated to setting up an EMR cluster for Spark-based ETL jobs.
Using a fully managed ETL service: Apache Glue (https://aws.amazon.com/
glue) is a service designed for ETL. Its advantage comes from the fact that it doesn’t require
any maintenance by MLOps. e Creating a Glue job for ETL section explains how to run
a Spark job using Glue for ETL.
Utilizing an end-to-end service for ETL: SageMaker (https://aws.amazon.com/
sagemaker) is an end-to-end service for ML. You can congure SageMaker to handle data
processing, model development with notebooks, model training, and deploy models to a
production setting. It uses a specic set of EC2 instances that are designed for ML projects to
run individual nodes. ese nodes have names that start with ml, and costs are about 30 to
40% higher than the other EC2 instances (https://aws.amazon.com/sagemaker/
pricing). In the Utilizing SageMaker for ETL section, we will describe how to set up a
SageMaker for ETL process on EC2 instances.
Considering the amount of data that needs to be processed, a correctly chosen ETL service,
along with an appropriate data storage selection, can improve the pipeline’s eciency
signicantly. e key factors to consider include the source of the data, the volume of the
data, the available hardware resources, and scalability, to name a few.
•
Scheduling: Oen, ETL jobs must be periodically run (for example, daily, weekly, or monthly)
and hence require a scheduler:
AWS Lambda functions: Lambda functions (https://aws.amazon.com/lambda)
are designed to run jobs on EMR without provisioning or managing infrastructure. Execution
time can be congured dynamically; the job can run right away or can be scheduled to run
Google Googlebot - Web Crawler SEO