Solving Big Data Problems in the Cloud with AWS Glue and Apache Spark

Home › Insights › Blogs | Last Updated December 21, 2021 - by samuel stiyer under data engineering

Published onSeptember 9, 2020

What is AWS Glue?

AWS Glue is one of Amazon Web Services (AWS) newer extract, transform, and load (ETL) service offerings. The service is fully managed and offers a serverless Apache Spark Run Time, making it an ideal solution for customers looking to get started immediately, rather than spend the immense time investment configuring Hadoop and Spark themselves. In addition to performing Serverless Batch workloads, AWS Glue also offers Serverless Streaming ETL options as well.

Another excellent feature AWS Glue offers is it’s integrated data catalog which allows users to access tables and metadata generated across the entire AWS big data ecosystem. The catalog can be used to organize your disparate data sources into “databases” which are the home to “tables” and their corresponding metadata and partition information.

The service also makes it easy for non-technical users to take advantage of its features by offering code generation for simple tasks. For developers, AWS Glue also has endpoints accessible through Zeppelin or Jupyter notebooks to interactively develop your next ETL job. Once you are ready to deploy your Glue ETL jobs, you can orchestrate all the triggers for your jobs via AWS Glue Workflows.

How has Softcrylic utilized AWS Glue?

Here at Softcrylic, we have taken advantage of the Spark ETL Jobs and Glue data catalog extensively. One major use case for which we’ve used AWS Glue was to build a data pipeline to perform marketing (Tapestry Last Touch and Adobe Last Click) attribution on a client’s point of sale system identifier. Creating the link between our client’s core business metrics (Point of Sale data) and marketing attribution, produced true last touch attribution regardless of the purchasing channel, an organizational first!

To accomplish this organizational first, we utilized AWS Glue in a variety of ways. First, before designing any of the actual data processing components, we created a database in AWS Glue’s Data Catalog which served as the home for our data source metadata. After creating the Database in the Catalog, we pointed a Glue Crawler to our different data sources Redshift and s3. From there the crawler collects all the data source schema info, hive partition info, and other metadata, which it then loads into your Catalog Database to access in your Glue ETL Jobs.

With the Glue Catalog established, we began developing the different Spark Glue jobs which would form the Last Touch and Last Click Attribution pipeline. With the Glue SDK we could seamlessly load the tables we established in our Glue Catalog Database into Spark from their Redshift and s3 homes. Once loaded, we used different spark transformations made available via Pyspark to do the necessary processing. In addition to loading, the Glue SDK allows for writing to different storage systems as needed, in our case: s3 and Redshift. It is worth noting, at the time we originally developed the pipeline, in order to populate your outputs into your Glue Catalog you would need to run another Glue Crawler. However, now it will automatically update your Data Catalog with new tables or add newly created partitions in pre-existing tables.

After the development of the code was complete, we used Glue’s ability to horizontally scale to process all the historic data. To do this all we needed to do was pass in the number of data processing units (DPUs) we determined was necessary as a parameter when we launched the Glue Job. Once we processed all of the historical data, we now use Glue Workflows to handle the orchestration and automation of the jobs on a daily basis. In terms of cost, the pipeline costs less than $5 per week to perform all the required data processing, which is a minuscule price to pay to have the processing, orchestration, and metadata of your ETL pipeline co-located in a single service.

Is AWS Glue the right choice for your team?

Determining which AWS service to leverage for your workload can be daunting. If you need help deciding if AWS Glue is the right tool for your workload, please reach out to our team here at Softcrylic, we’d love to help!

Samuel Stiyer

Sam Stiyer is a Data Science Consultant at Softcrylic. He is a Machine Learning, R / Python Programming, Big Data & Tidy Data Enthusiast! He loves answering challenging data related questions and learning new things. Connect with him on <a href="https://www.linkedin.com/in/samuel-stiyer/">LinkedIn</a> and <a href="https://twitter.com/SamStiyer">Twitter (@SamStiyer)</a> where he actively discusses applications of Advanced Analytics.

Contact Us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Not readable? Change text. captcha txt

Start typing and press Enter to search