Blog

Edge Computing and Developer Tools Part 1: An Introduction

April 24, 2020 · by David Theobald ·
Categories:

When website owners need to optimize web experiences, they traditionally run code on the client, build backend solutions at their origin, or leverage a content delivery network (CDN) in the middle. For various use cases, having request and response transformation logic on the edge is ideal. It is even better when the website owner’s development teams are enabled to develop and test the full stack — including the CDN edge tier — on their own. Enter EdgeWorkers!

 EdgeWorkers is a new way to drive powerful web experiences by enabling developers to run JavaScript at the Akamai Intelligent Edge to customize web traffic. You can create JavaScript snippets and deploy them across the entire Akamai network — creating rich new web experiences and avoiding complicated work typically performed in other tiers of the full stack. Now the largest delivery network is also the largest low-latency serverless compute network.

 EdgeWorkers, alongside a suite of integrated developer tools, empowers you to:

  • Configure: Add, move, or remove Property Manager behavior(s) within your delivery property to control the scope of the edge logic
  • Code: Build robust logic within the CDN tier using the familiar JavaScript programming language
  • Confirm: Invoke tests from a local development environment looping through the CDN (edge and parent) to get a “full stack” evaluation of traffic transformations without impacting other developers or production traffic

It’s easy to upload and enable EdgeWorkers. If you are developing in EdgeWorkers, it's worth the time to set up a development environment as described in this series of posts. The tighter we can make these Configure>Code>Confirm iteration loops, the more productive you can be while ensuring the resulting business logic is solid and ready for production use.  

Let’s walk through an example to illustrate how this intersection of serverless and content delivery improves performance and productivity.

You can start using EdgeWorkers today!

Example Scenario

For this example, we’ll use my passion (some might say an obsession) for golf. Many PGA professionals have shifted their traditional range teaching sessions to online content subscription websites. These subscription websites, like in many other industries, have different access tiers to help monetize the content.

Let’s imagine we have a very basic golf content subscription website, we.makegolf.fun, that has an AJAX call to “upgrade” an end user to a premium status, /getpremium. The content origin in this case will respond to the AJAX call with a JSON payload upgrading the user to premium status, along with a session cookie to keep the end user attached to that status level. 

For instance, the JSON response could look like:

{
"premiumStatus": "gold",
"statusFrom": "origin"
}

With a session cookie similar to:

Set-Cookie: golfPremium=%7B%22premiumStatus%22%3A%22gold%22%2C%22statusFrom%22%3A%origin%22%7D

Further, we know that in this case the context required to upgrade a user is available at the Akamai Edge. Thus, for end-user latency improvements as well as origin offload benefits, we want to move the "Go Premium" logic to the CDN layer versus going all the way back to origin.

In my next post, I’ll show how you can use EdgeWorkers to accomplish these goals.