<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ariel Diamond on Medium]]></title>
        <description><![CDATA[Stories by Ariel Diamond on Medium]]></description>
        <link>https://medium.com/@ariel.diamond?source=rss-ef1be2cd54ae------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*tcpP3WQQIgOY3Pe3D6woyQ.png</url>
            <title>Stories by Ariel Diamond on Medium</title>
            <link>https://medium.com/@ariel.diamond?source=rss-ef1be2cd54ae------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 11:11:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ariel.diamond/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Templates Can Help Onboard — and Keep — Your Users]]></title>
            <link>https://medium.com/capital-one-tech/how-templates-can-help-onboard-and-keep-your-users-c1636f48ddc3?source=rss-ef1be2cd54ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1636f48ddc3</guid>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[template]]></category>
            <dc:creator><![CDATA[Ariel Diamond]]></dc:creator>
            <pubDate>Wed, 16 Jun 2021 18:49:52 GMT</pubDate>
            <atom:updated>2021-06-16T18:49:52.260Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Templates Can Help Onboard — and Keep — Your Users</h3><h4>Good documentation and happy developers go together like peanut butter and jelly</h4><figure><img alt="deconstructed pb&amp;j sandwich on a cutting board next to jars of peanut butter and jelly" src="https://cdn-images-1.medium.com/max/1024/0*ARIfTPgW99fGHM-t.jpg" /></figure><p>When I was in fourth grade, my teacher had me tell him how to make a peanut butter and jelly sandwich.</p><p>I said, “ <em>So easy! You just put peanut butter and jelly on the bread!”</em></p><p>He took the jars and put them on top of the loaf of bread. <em>“Noooo!” </em>I said, horrified. <em>“Not like that!”</em></p><p>In order to get to eat the sandwich (with the kind of sugary peanut butter and jelly my mother would never buy), I had to describe in exacting detail how precisely to make the sandwich — what tools were needed, what orientation each piece of bread should be in — until at last a “normal” <a href="http://youtube.com/watch?v=TKcrnTZ9IaE">peanut butter</a> and jelly sandwich was created.</p><h3>Peanut butter and documentation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1XxyeacEQxgCdhDd.jpg" /></figure><p>A lot, if not most, technical documentation stops at the level of <em>“just do this!”</em> Layers and layers of assumptions are made about what terms mean, what steps have already been taken, how a local environment might be set up, and the technical level of the reader. The result is often confusing or incomplete instructions that result in extra support time and wasted developer time.</p><p>The reality is that technical users come from radically different backgrounds and knowledge levels, and in order for documentation to be effective, <strong><em>any</em></strong> user should be able to follow your onboarding process. Even documentation intended strictly for internal company use, which can assume some shared lingo or setup, often fails to meet this bar.</p><p>When your documentation says <em>“put peanut butter on the bread,”</em> your users might not know they will need a butter knife, a plate, and the ability to unscrew a lid. These users might try to use their fingers to spread the peanut butter, or use a chainsaw to open the lid. They might get annoyed and stop trying to make a sandwich, or they might post simple, repetitive, or unnecessary questions in your support channel:</p><p><em>“How am I supposed to get the peanut butter out of the jar with the lid on?”</em></p><p><em>“Do I need one knife to use for both toppings, or one knife for each topping?”</em></p><p><em>“Do you support jam as well as jelly?”</em></p><p><em>“How do I get peanut butter off of my chainsaw blade?”</em></p><p>As a software engineer who must both onboard other engineers to my service, as well as be onboarded to countless other services, I have a very simple solution to save all of us time and mental energy. It’s free, language-agnostic, and you probably already have one buried at the foundation of your codebase.</p><p>What is this magical solution?</p><p><strong>Make your users a template for any and all interfaces with your service.</strong> Templates show rather than tell how to use your service, and are more likely to communicate unrecognized assumptions to your users.</p><h3>What is a template?</h3><p>The word <a href="https://en.wikipedia.org/wiki/Template">template</a> can refer to any number of objects, from a sewing pattern to a pre-designed but empty slide deck, and they even exist in nature in <a href="https://www.nature.com/scitable/topicpage/dna-transcription-426/">DNA</a>. In all cases, a template communicates a preset format to eliminate unnecessary reinvention. In this case, templates are the code blocks in your documentation that users can copy, paste, and customize to use as a clear model for onboarding to your service.</p><p>In its simplest form, a software template is an explicit agreement. If I give you a template of how I expect your sandwich request, you should be able to fill it out and return it to me to get the sandwich you want.</p><p>Say I give you a <em>sandwich.yml </em>file that looks like this:</p><pre># Ariel&#39;s Sandwich Maker Service: Hot Dogs Accepted <br># Supported bread and filling types can be found [here] <br>name: my_example_pbj_sandwich <br>bread_type: white <br>fillings: <br>-	peanut_butter <br>-	strawberry_jelly <br>crust: on # optional, default: `on`, options: `off` <br>cut: diagonal # optional, default: `parallel`, options: `diagonal` served_on: white_plate # optional, default: `white_plate`, options: `napkin`</pre><p>This tells my user exactly what I am expecting: <a href="https://yaml.org/">YAML</a>-formatted <a href="https://en.wikipedia.org/wiki/Snake_case">snake case</a> fields in a specific order, including optional parameters, and supported customizations. It tells you bread_type accepts one argument and fillings accepts many. It points you to additional documentation regarding sandwich options. By omitting options for jar unscrewers and knife types, it tells users that the service will handle opening the jars and spreading the fillings. A user could easily copy, paste, and adapt this file to use with my service.</p><h3>Keeping your templates fresh</h3><p>One of the downsides of templates, and of all written documentation, is that it requires maintenance. If I decide to stop counting hot dogs as a sandwich, and instead spin that off into a separate service, I need to then go update my documentation to make that clear. But let’s be honest: documentation starts going stale as soon as it is written.</p><p>Codebase maintainers have two strategies:</p><ol><li>Set time aside to regularly (say, quarterly) confirm that the documentation conforms with the current requirements, using Github issues, feedback from users or folks staffing support lines, or manual tests; and/or</li><li>Use an auto-documentation method like <a href="https://swagger.io/">Swagger</a>, <a href="https://docs.readthedocs.io/en/stable/">Read the Docs</a>, or <a href="https://docs.readthedocs.io/en/stable/intro/getting-started-with-sphinx.html">Sphinx</a>. Or <a href="https://towardsdatascience.com/auto-docs-for-python-b545ce372e2d">build your own</a>!</li></ol><p>I recommend using both concurrently.</p><p>Swagger can detect the requirements of an API and create an easy-to-use UI that defines how to use each endpoint — what it is expecting, and what it should return. Swagger both makes it easy for users to onboard their APIs to Swagger, but also makes it easy for their users’ users to understand their API requirements. Swagger is basically a meta-template. This <a href="https://www.capitalone.com/tech/software-engineering/how-to-make-swagger-codegen-work-for-your-team/">article</a> walks you through how to set up <a href="https://swagger.io/docs/open-source-tools/swagger-codegen/">Swagger CodeGen</a>, which, among other things, can generate documentation automatically. As a frequent user of Python <a href="https://flask.palletsprojects.com/en/1.1.x/">Flask</a>, I have taken to using <a href="https://flask-restx.readthedocs.io/en/latest/swagger.html">Flask-RESTX</a>, which autogenerates the autogeneration, since the best amount of work to do is no work at all.</p><h3>A tale of three templates</h3><p>I was inspired to write this article after working with one really good template and one really bad template — and one template I had to write and maintain myself.</p><h4>The Good Template</h4><p>As a backend engineer responsible for my products from end to end, integrating with enterprise and external services is part of my daily life. One such product, which I will refer to as <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html">GrilledCheese</a>, allows users to programmatically manage their cloud assets with simple JSON requests. Thousands of engineers use it daily for essential work. You can imagine, if their documentation was lacking, their support lines would be clogged with urgent messages and frustrated customers. Fortunately, GrilledCheese has excellent documentation, with clear descriptions of requirements and copy-and-pasteable templates. The result is a widely-used product that saves immeasurable developer time. While there are certainly still open questions from developers, basic questions are minimized due to their thorough and accessible docs.</p><p>GrilledCheese is a great model for templating and documentation, and how good documentation leads to happier users and wider adoption.</p><h4>The Bad Template</h4><p>Another product I have recently used, let’s call it Hoagie, provides my favorite kind of template: a full GitHub repo. Ideally, I could clone this repo, fill in the blanks, and be up and running in a matter of minutes. Not so! While the parent application is being actively developed, the template repo was never updated and has since fallen several versions behind. Most of the libraries were out of date and some no longer worked, the <a href="https://en.wikipedia.org/wiki/Acceptance_test%E2%80%93driven_development">ATDD</a> tests failed, and the code itself was not in line with what was actually required by the service.</p><p>As a result, there were dozens of issues open with irritated users pinging again and again requesting responses and updates. Their support channel was flooded with repetitive questions, and replies were slow. Existing users stopped recommending the service and now steer new users away from starting to onboard. Attempts to update the template by users are stymied, as there are so many layers of updates required and few available owners to approve changes.</p><p>Reader, don’t be like Hoagie.</p><h4>The Ongoing Template</h4><p>When I first started on my current team, most of the APIs in my department were written in Java. (Boo! Just kidding, some people love Java!) I had a greenfield project that was a perfect fit for Python, and I ended up making MeatballSub, the first Python API in recent memory.</p><p>While I was building MeatballSub, a colleague recommended creating a <a href="https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-template-repository">template repo</a> of my project so that others could easily create new Python APIs. It was surprisingly quick for me to create a template by copying MeatballSub and removing all the specifics — the meatballs, if you will. What was left was a generic Python Flask application, Sub, that already had a health check, tests, and a dummy endpoint to demonstrate usage. I packaged in all of the Capital One-specific requirements and best practices, and documented how to get it running. Over the past year, I have updated it a few times, just to make sure it still works, or to clarify or streamline an element that a user had trouble understanding. I have to remember to check it now and then, but the amount of time I spend maintaining it is minimal.</p><p>My primary takeaway from making Sub was that in order for people to use it, they have to know it exists and where to find it. I needed to present it at relevant showcases, link to it in relevant channels, and recommend it when a good use case crossed my path. If a template exists but nobody uses it, does anyone care? No. The GitHub Blog had a great <a href="https://github.blog/2021-03-23-solving-the-innersource-discovery-problem/">article</a> recently on this discoverability problem. Make sure you socialize and advertise your docs and your templates. And if that isn’t what you like to do, see if you can get others to market them for you.</p><h3>Documentation guidelines to increase impact</h3><p>A template is among the easiest, fastest, and most effective ways for a user to understand what your service is for and how to start using it. Unlike overly wordy documentation (or worse, no documentation), a template shows the user how the service works and communicates details that may seem so minor as to not be worth documenting. (How many times has an integration not worked on the first attempt because the case was wrong?) A glance can quickly demonstrate the requirements and process, and allow a user to independently determine if your product is a good fit for their use case.</p><p>All of software is subject to <a href="https://en.wikipedia.org/wiki/Natural_selection">natural selection</a>; some services figure out how to survive and evolve and spread, and others die off and are replaced. The good news — a species of lizard who evolved to only eat sandwiches could only survive or thrive within a narrow window; you actually have some control over whether your code survives or thrives.</p><p>If you want your code to go forth and multiply, follow these guidelines:</p><ol><li><strong>Write documentation!</strong> It’s a low bar, but we have to start somewhere.</li><li><strong>Write documentation that people outside your team understand!</strong> The only way to know you’ve done this is to talk to people outside of your bubble. So go ask a stranger to read your docs and tell you where they are bad.</li><li><strong>Create templates that users can clone or copy and paste!</strong></li><li><a href="https://www.process.st/software-documentation/"><strong>Use</strong></a><strong> </strong><a href="https://wiki.python.org/moin/DocumentationTools"><strong>auto</strong></a><strong>-</strong><a href="https://medium.com/technical-writing-is-easy/tools-for-code-documentation-4fd9e8e39eed"><strong>documentation</strong></a><strong> </strong><a href="https://en.wikipedia.org/wiki/Comparison_of_documentation_generators"><strong>tools</strong></a><strong>!</strong></li><li><strong>Make sure all docs and templates are linked in the places</strong> that people will look for them! Talk about them, present them, link them, pin them, market them.</li><li><strong>Treat your documentation like code!</strong> Include doc updates in your acceptance criteria and <a href="https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository">PR templates</a>, and get in the habit of updating docs in every relevant commit.</li><li><strong>Make sure your documentation is up to date!</strong> Every three months, go find a new stranger to read your docs and make sure they still make sense, or listen to your users and edit as necessary. Have new team members use your docs to onboard, and empower them to make updates and clarifications.</li><li><strong>Acknowledge that without comprehensible documentation, your code will go extinct because nobody will use it! </strong>Stop neglecting it.</li></ol><p>I’m always interested in hearing your solutions to keep your documentation fresh and low maintenance — let me know if you have a strategy that works for you beyond what I’ve discussed here.</p><p><em>DISCLOSURE STATEMENT: © 2021 Capital One. Opinions are those of the individual author. Unless noted otherwise in this post, Capital One is not affiliated with, nor endorsed by, any of the companies mentioned. All trademarks and other intellectual property used or displayed are property of their respective owners.</em></p><p><em>Originally published at </em><a href="https://www.capitalone.com/tech/software-engineering/how-to-use-templates-for-better-documentation/"><em>https://www.capitalone.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1636f48ddc3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/capital-one-tech/how-templates-can-help-onboard-and-keep-your-users-c1636f48ddc3">How Templates Can Help Onboard — and Keep — Your Users</a> was originally published in <a href="https://medium.com/capital-one-tech">Capital One Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Glue: An ETL Solution with Huge Potential]]></title>
            <link>https://medium.com/capital-one-tech/aws-glue-an-etl-solution-with-huge-potential-91a04a2a0712?source=rss-ef1be2cd54ae------2</link>
            <guid isPermaLink="false">https://medium.com/p/91a04a2a0712</guid>
            <category><![CDATA[aws-glue]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[etl]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Ariel Diamond]]></dc:creator>
            <pubDate>Wed, 15 Apr 2020 15:36:00 GMT</pubDate>
            <atom:updated>2020-04-15T18:17:52.826Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="blue, red, and white glue bottle with navy smiling face and arms and legs" src="https://cdn-images-1.medium.com/max/1024/0*Er7pMrPogYCQ1IfS" /><figcaption>Your new friend, Glue.</figcaption></figure><p><a href="https://aws.amazon.com/glue/">AWS Glue</a> is a relatively new fully managed serverless Extract, Transform, and Load (ETL) service that has enormous potential for teams across enterprise organizations, from engineering to data to analytics. Glue combines the speed and power of Apache Spark with the lightweight data organization of Hive metastores to — you guessed it — <em>glue</em> together disparate data sources from across AWS. While AWS Glue was <a href="https://aws.amazon.com/blogs/aws/launch-aws-glue-now-generally-available/">announced</a> over two years ago, it is still being actively developed, with new notable features added every few months. Glue is not a silver bullet and it might not be as seamless or accessible as you would like it to be, but with the right strategy and use case, it can be a great fit. I’d like to share my learnings from the last year of working with Glue, to help inform your decisions and also avoid some… sticky situations.</p><h3>Why Choose Glue?</h3><p>As a backend software engineer at Capital One, my team selected Glue as the solution for a serverless notification service that needed to process data from multiple sources across the company, including files and databases. While my team is not specifically a data engineering team, we recognized that our pattern was essentially an ETL pipeline: ETL jobs move data from a source, transform it to the form that is required, and load the resulting data and schema into a target system. We knew we wanted a serverless solution if at all possible, and when we found that AWS had a serverless ETL service, we decided to take the plunge and become the first team in the company to use Glue jobs in production.</p><p>Glue strives to address both data setup and processing in one place with minimal infrastructure setup. The Glue data catalog can make both file-based and traditional data sources available to Glue jobs, including schema detection through <a href="https://docs.aws.amazon.com/glue/latest/dg/add-crawler.html">crawlers</a>. Glue’s data catalog can share a <a href="http://hive.apache.org/">Hive</a> metastore with <a href="https://aws.amazon.com/athena/">AWS Athena</a>, a convenient feature for existing Athena users like us.</p><p>To run jobs that process this data, Glue can use a Python shell, Spark, or most recently, Spark Streaming, a beta feature that you have to enable. Glue jobs can be written in Python or Scala. My team used Spark with Python3, so I will speak from that experience. When Glue jobs use Spark, a Spark cluster is automatically spun up as soon as a job is run. Instead of manually configuring and managing Spark clusters on EC2 or <a href="https://aws.amazon.com/emr/">EMR</a>, Glue handles that for you nearly invisibly.</p><p>One of the most useful things about Glue is that its default timeout is two days — unlike Lambda’s max of 15 minutes. This means that Glue jobs can be used essentially like a Lambda for jobs that were too long or too unpredictable. While Glue was not intended for this purpose, AWS Solutions Architects have confirmed that this is a common and acceptable use case.</p><p>This AWS video, “Getting Started with AWS Glue ETL,” is a good introduction if you are a visual learner like myself:</p><figure><img alt="Video of getting started with AWS Glue ETL, woman in jean jacket and white shirt is talking" src="https://cdn-images-1.medium.com/max/966/0*SmLxnHyitqGvWcTp" /></figure><h3>A Short Tour of AWS Glue</h3><p>Glue divides its main services into the <strong>Data Catalog</strong> and <strong>ETL</strong>. As Glue uses common data terms but slightly changes the definitions, I’ll translate them below.</p><h4><strong>AWS Glue Data Catalog</strong></h4><p>The Glue Data Catalog is where metadata must be stored for Glue jobs to access your data. When Athena and Glue are connected (Athena needs to be <a href="https://docs.aws.amazon.com/athena/latest/ug/glue-upgrade.html">upgraded</a> to do so), any Athena database or file-based table that exists in Athena is also available to Glue jobs.</p><ul><li><strong>Tables</strong> are not your typical relational database tables, but are instead metadata table definitions of data sources, not the data itself. It’s a little like a link with a preview — a Glue table tells you where the data is located and what data fields and types you should find there. Glue tables can describe file-based data stored in S3, such as Parquet, CSV, or JSON, as well as data in traditional datastores like <a href="https://aws.amazon.com/rds/">RDS</a> tables. The latter sources need to be connected and crawled in order to be accessible.</li><li><strong>Databases</strong> are essentially a grouping of data sources that tables belong to. Creating a database in Glue only requires a name.</li><li><strong>Connections</strong> create a verified link between Glue and RDS (Postgres, MySQL, etc), Redshift, or JDBC instances, and allow Glue to access the data stored there.</li><li>For the metadata of data sources accessed via connections to be accessible to Glue in your database, you need to set up and run a <strong>Crawler</strong>, which “connects to a data store, progresses through a prioritized list of classifiers to determine the schema for your data, and then creates metadata tables in your data catalog.” — <a href="https://docs.aws.amazon.com/glue/latest/dg/add-crawler.html">AWS Glue documentation.</a> Crawlers are also great at determining the schema of complex unstructured or semi-structured data, which can save a ton of time. Parquet and AVRO files are notoriously difficult to make human-readable, and crawlers can sort out those schemas in a matter of minutes.</li></ul><h4>ETL</h4><p>The ETL section houses the scripts and tools that use the data that was set up in the data catalog to extract, transform, and load into the location where it is needed.</p><ul><li>The core of Glue ETL is the <strong>Jobs</strong>. A job consists of a script that can load data from the sources in the data catalog and perform transformations on it. Glue can autogenerate a script, or you can write your own in Python (PySpark) or Scala. Glue also allows you to import external libraries and custom code to your job by linking to a zip file in S3. As we were developing before Glue was able to be run locally, we isolated the Glue-specific code in the job script, then moved the rest of our Python code to a more typical and testable application structure that we zip up and deploy with the script.</li><li><strong>ML Transforms</strong> are a subcategory of jobs that “provides <a href="https://docs.aws.amazon.com/glue/latest/dg/machine-learning.html">machine learning capabilities</a> to create custom transforms to cleanse your data.” You can connect data stores from the catalog and “tune transform” to identify duplicate data, etc.</li><li><strong>Triggers</strong> run jobs. They can run on a schedule, on command, or upon a job event, and they accept cron commands.</li><li><strong>Workflows</strong> are a combination of triggers and jobs. For example, you may have one job that needs to complete before the next job is run. You can create a workflow with a trigger that starts Job 1, and a trigger that waits for Job 1 to complete and starts Job 2.</li><li>Glue also has <a href="https://docs.aws.amazon.com/en_pv/glue/latest/dg/dev-endpoint.html">Dev Endpoints</a> and <a href="https://docs.aws.amazon.com/glue/latest/dg/console-notebooks.html">Notebooks</a>, which allow one to develop and test scripts more efficiently, as they provision a dedicated Spark cluster that you can run jobs on continuously. It is not possible to use them in my development environment, so I cannot speak to their functionality.</li></ul><h3>Getting Started in Glue</h3><p>First and foremost: in order for Glue to be able to glue everything together, you’ll need to set up your IAM roles and S3 bucket policies to be accessible to Glue. For your existing IAM role to be usable in Glue, you’ll need to add Glue to the trust relationships of that role. To use Athena with Glue, you’ll need to upgrade and also modify existing roles. There are more of these gotchas that are environment-specific, and you’ll probably discover more as you go.</p><figure><img alt="Glue screen with blue buttons and black callout text box with white text" src="https://cdn-images-1.medium.com/max/648/0*rjYvc54kPo_JRYJI" /><figcaption>Step-by-step instructions for creating a crawler.</figcaption></figure><p>After trying a few different learning strategies, I recommend using the interactive tutorials on the left sidebar in Glue first. They guide you through making a crawler, a table, and a trigger which helps give a sense of Glue’s capabilities faster than reading the <a href="https://docs.aws.amazon.com/glue/latest/dg/what-is-glue.html">docs</a>.</p><p>I also recommend exploring their <a href="https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-etl-script-generation.html">autogenerated scripts</a> and code snippets. Add a new job and choose <em>“This job runs proposed script generated by AWS Glue.”</em> One of the easiest transforms is changing column name and order with Glue.</p><figure><img alt="Glue mappings diagram with grey arrows and white and grey tables with blue and black text" src="https://cdn-images-1.medium.com/max/1024/0*0V0b6n3q7D7Bm9hX" /></figure><p>After a script has been generated, you can add a variety of autogenerated transforms as well.</p><figure><img alt="screenshot of glue screen with white and grey table containing black text in a list" src="https://cdn-images-1.medium.com/max/1024/0*WrJrP11AxD43PgLN" /></figure><h3>Glue Sticking Points</h3><p>On the whole, I’ve had a good experience with Glue. My team does not need to provision Spark clusters or rehydrate servers as we would have with a more traditional solution. We can also run code in a sandbox-style environment where we can test jobs by simply clicking “Run job.”</p><p>But, with heavy management comes less control, and there are some significant challenges that may impact your use case. When a service is managed, it also isn’t always clear what additional knowledge you need in order to get the most out of the product — or to avoid major issues.</p><h4>Development Speed: Hurry Up and Wait</h4><p>Glue jobs still run on Spark clusters, and they take a while to spin up whether or not you are managing them yourself. Jobs can take up to 20 minutes to start — not counting the time it takes to run — especially during peak times. A confounding factor is that jobs can fail to start because of an error, which Glue logs may not help you solve. I spoke to AWS support about this and there are apparently times where they simply don’t have any clusters available, resulting in the error “Resource unavailable.” My understanding is that they are working to solve this, but I am unsure of the timeline.</p><p>Jobs <strong>can</strong> start in less than a minute if you happen to be running on an existing cluster, but there is not a surefire way of keeping a cluster running or keeping your job on a running cluster without using a Dev Endpoint, which can significantly impact your AWS costs.</p><p>AWS seems to be taking this seriously — they have recently added this announcement, which allows users to sign up for a beta feature that guarantees jobs to start in less than a minute. I have signed up for this, but have not yet been given access to this feature.</p><figure><img alt="Screenshot of notification in Glue with black text" src="https://cdn-images-1.medium.com/max/1024/0*y7VluvrV5LbI-R7T" /></figure><h4>Testing Can Be Tough</h4><p>We spent much of our early days running jobs iteratively in the AWS console, which was slow and not version-controlled, as each new save of the script deletes the previous file. At the time, it was not possible to <a href="https://stackoverflow.com/questions/48314268/can-i-test-aws-glue-code-locally">run Glue locally</a>, so we could not test components locally. We worked around this problem by factoring out the Glue-specific code and testing the remainder with existing libraries like <a href="https://docs.pytest.org/en/latest/">pytest</a>, and more recently, began developing in Databricks.</p><p>At the end of August 2019, <a href="https://aws.amazon.com/about-aws/whats-new/2019/08/aws-glue-releases-binaries-of-glue-etl-libraries-for-glue-jobs/">AWS announced</a> that “…you can now import the released Java binaries of Glue ETL libraries using Maven… locally.” This could be a big improvement, but it is unfortunately not usable in our specific development environment, though it may work for you.</p><h4>It’s Changing All The Time</h4><p>Since Glue is still fairly new and being worked on actively, you may encounter problems that StackOverflow and the docs don’t yet solve for. With each improvement, though much appreciated, came complexity that needed to be managed. Integrating with various <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html">Boto3</a> clients and other AWS services caused some thorny problems with access and configuration. I did not find Glue error messages to be as helpful as they could be, and there does not seem to be a way to reduce noise in the verbose logs in order to identify fatal issues more quickly.</p><p>As with any tool, Glue can be used as it was intended, but it is fairly easy to use as it was <em>not</em> intended. The docs and tutorials represent Glue as an accessible solution that is easy to use and autogenerates scripts and takes away the hassle of managing Spark clusters. That increased accessibility opens the door to users that don’t necessarily follow the expected path, and the docs are not prepared for them (er… us).</p><h3>Hindsight is 2020</h3><p>If I could go back and do it over with what I know now, here’s what I would advise:</p><ol><li><strong>Either know Spark or don’t use Spark! </strong>We thought we could just write vanilla Python and run it in Glue. Nope — PySpark <em>looks</em> like Python but doesn’t act like Python. We spent a lot of time retroactively figuring out how to rewrite our code to be Spark-optimized in order to not run out of memory. In hindsight, considering our team had minimal Spark knowledge, we should have either done a crash course in Spark <strong>or</strong> used Glue essentially as an Spark-free Athena orchestrator or as a Lambda with a longer timeout.</li><li><strong>Use </strong><a href="https://databricks.com/"><strong>Databricks</strong></a><strong> for faster development.</strong> While we were learning how to use Glue, we were running jobs that often took ten minutes to start, then fail because of something like a syntax error. To fail faster, use Databricks to run code snippets (or your whole application) and confirm your syntax and logic without waiting for a new cluster to spin up in Glue. Databricks was founded by the same folks who created Spark, so it is a reliable sandbox environment to work in. It should be noted that there are some syntax differences between Glue Spark and Spark to look out for, mainly when the context is initialized. Running Glue locally is another option, but was not feasible during our development period.</li><li><strong>Set up alerts to monitor job status changes. </strong>Considering how much time is spent checking to see if a job is done, I’m glad I finally set up an email alert through <a href="https://aws.amazon.com/sns/">AWS SNS</a> that tells me when my job succeeds or fails. Instead of constantly context switching, this allows me to monitor jobs without needing to log in to the AWS console. I recommend setting this up right away.</li></ol><h3>Glue and You</h3><p>Despite these challenges, AWS Glue can be an efficient and useful tool that is great for a number of use cases that require moving or transforming data. My team’s transition to Glue has significantly reduced infrastructure and complexity, and I look forward to seeing how Glue can be used in the future. I hope that this introduction to Glue allows you to start experimenting with less friction to see if Glue is the right tool for your work.</p><p>Please feel free to reach out to me with your experiences with Glue.</p><p><em>DISCLOSURE STATEMENT: © 2020 Capital One. Opinions are those of the individual author. Unless noted otherwise in this post, Capital One is not affiliated with, nor endorsed by, any of the companies mentioned. All trademarks and other intellectual property used or displayed are property of their respective owners.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=91a04a2a0712" width="1" height="1" alt=""><hr><p><a href="https://medium.com/capital-one-tech/aws-glue-an-etl-solution-with-huge-potential-91a04a2a0712">AWS Glue: An ETL Solution with Huge Potential</a> was originally published in <a href="https://medium.com/capital-one-tech">Capital One Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>