Locality matters for most things in life: weather, health care, shopping, product reviews, dinner reservations, social networking, data privacy, news, sports ... the list goes on and on in our ever more connected lives. From direct user interaction on your flagship website or app to IoT device data collection and transformation, where your target audience is and where they are going is essential to providing the experience they need, want, and deserve. This experience needs to honor the privacy of the user, ensure the integrity and safe handling of personal data, and provide an accurate localized view of your key content -- all while being highly performant, available, and secure.
As our world -- users, services, and devices -- becomes more connected, so does the reliance on fast access to data, fueling the need for scalable, reliable compute near the action. Serverless computing at the edge brings content, insights, and decision-making closer to the entities that act upon them. Current trends, such as the modernization of back-end architectures driving monolith origin applications to decompose into microservices and functions, and the desire to consider everything in the tech stack as "just more code," have driven Akamai's most recent edge compute option -- EdgeWorkers.
EdgeWorkers empowers developers to write, test, and deploy code directly on our network of more than 300,000 servers around the globe. With EdgeWorkers, Akamai is delivering the world's largest low-latency serverless compute network -- for fast execution of logic in closest proximity to your end users.
Let's look at some approaches to enhance your users' experience via geo-personalization enabled by EdgeWorkers.
Opt in or out -- it's their choice, and it matters
We have all seen those pop-ups while surfing our favorite websites asking about your approval or disapproval of cookies. Cookies are those little bits of state (I think they should have been called "crumbs") that browsers retain about you that help tailor the experience to your interests, locale, content visited, social media interactions, search results, and other things that site owners piece together to get a better picture of you.
Originally, cookies were intended to be short-lived and not cross boundaries of digital experiences. Unfortunately, as the digital experience ecosystem evolved, site owners, marketers and advertisers realized that following you around would yield a bigger and better picture of your interests -- which many of us are not so excited about sharing with everyone and anyone on the public internet. Hence, the rise of data transparency and privacy legislation across the globe -- users have the right to choose which data they want to share with online services.
With this legislation now enforceable in many places (and growing in popularity), online experiences need to ensure enabling tracking pixels and cookies on a user's session is a consensual activity for these various locales. How can EdgeWorkers help with this?
By leveraging an official compliance tool suite like the Interactive Advertising Bureau (IAB)'s Transparency and Consent Framework (TCF 2.0), which is an industry standard for sending and verifying user consent, we can build an edge-native microservice within EdgeWorkers to determine if the user has allowed tracking data to be collected for your digital experience. If the user has consented, state-tracking cookies can be added to the session, helping you tailor the user's experience. If not, then the cookie crumbles, and no tracking will be applied to the session, offering a more generalized experience for those private users.
The diagram above illustrates a possible consent workflow where no customer data center or centralized cloud infrastructure is needed -- a true edge-native microservice! The workflow is:
- End user requests content that includes a data privacy consent control
- Client sends end user's consent selection in TCF 2.0 format to the edge
- Edge receives consent verification request and invokes EdgeWorkers event
- EdgeWorkers event, onClientRequest, which imports IAB's TCF 2.0 library decodes the verification request and evaluates if consent for tracking cookies has been granted
- If granted, cookies are set on the session
- If not granted, no cookies are set on the session
- Edge responds to client with appropriate response code to continue serving content
And there you have it: geographically enforced e-privacy verification all in a handy edge-native microservice that could be stood up in only a few minutes!
Bring your data to the edge
The set of localization data available to you within EdgeWorkers:
- User location information
- Client device information
- Request headers that define user preferences such as Accept-Language
- Any static data you want to pack within your EdgeWorkers code bundle (within limits, of course)
Blog cliff-hanger: In the near future, Akamai will give you another choice in NoSQL databases. We can't wait to share what we have been cooking up, so stay tuned ...
The union of all of this data on the edge offers some awesome benefits:
- Dynamically craft the right content for the right users
- Augment edge insights with your own secret sauce data set to further refine your targeted experience
- Eliminate round trips to content origins or service endpoints just to determine user locality
No Swiss cheese, please
Imagine a website that provides ratings and reviews on products that vary in use and accessibility by geographic region. This website clearly needs to present the right regional product materials, so it has an AJAX call that fetches server-side geographic details to augment the client-side rendering -- but this happens after the page fetch and render. Ugh -- the classic Swiss cheese render, where part of the user experience flickers (at best) before the AJAX call returns. Not good.
Let's fix this.
We will still fetch the base page from the content origin (but perhaps this could be dynamically orchestrated on the edge; in a future blog post, we will investigate this). However, before the request goes forward to the content origin, let's deploy an EdgeWorkers function that adds a request header that includes the user location data the edge knows about this end user. This allows the content origin to select the right base page layout based on the user segment it will be served to.
As the page response is sent back to the edge, our EdgeWorkers function will also add session cookies (if the user consents; see above) to help retain the geographic experience across the user's time on our site. Voilà -- we have removed the extra latency the AJAX call introduced along with "Swiss cheese render" and flicker of lagging geo-personalization content loading. Nice!
Presenting the right user segment with the right (and e-privacy compliant) content need not require additional delivery latency. To learn more about how you can get started with Akamai's serverless platform to help in your localization goals, or to investigate all of the features deployable to the Akamai Intelligent Edge Platform, check us out at developer.akamai.com.
There will be more opportunities to engage with us on this and more at Edge Live | Adapt. Sign up to see how customers are leveraging these improvements, engage in technical deep dives, and hear from our executives how Akamai is evolving for the future.