MODERNIZATION

How to Use Edge Computing to Scale Your eCommerce Business

default alt tag

Dominic Gozza

Principal Technical Architect, PeakActivity

GET MORE INSIGHTS

MODERNIZATION

How to Use Edge Computing to Scale Your eCommerce Business

Dominic Gozza headshot

Dominic Gozza

Principal Technical Architect, PeakActivity

GET MORE INSIGHTS
Graphic image of a speech bubble with code brackets above the words "Talking Tech"
Graphic image of a speech bubble with code brackets above the words "Talking Tech"

Edge computing isn’t a specific technology, but rather a networking philosophy focused on bringing computation as close to the user and the data source as possible in order to reduce latency and bandwidth use. It means running fewer processes in the cloud and moving those processes to local places, like a user’s computer, an Internet of Things (IoT) device, or an edge server. Bringing computation to the network’s edge minimizes the amount of long-distance communication that has to happen between a client and a server.

Numerous edge-first javascript frameworks like Vercel, Cloudflare Workers, and many web development platforms are making it easier to adopt edge computing on a large scale. Let’s dive into edge functions, what they are, and why they’re beneficial.

Team of engineers having a code review session at a cluster of desks

Understanding Edge Functions

Edge Functions allow you to serve content from your CDN server of choice closest to the user. Utilizing Typescript, it’s easy to modify network requests at the edge, so it’s closer to your users. Some of the benefits of edge functions include:

 Provides eCommerce companies with cost-effective, real-time consumer insights

 Enables personalized content to be delivered with the same high performance as static content

 Mitigates the damage and costs associated with security breaches by filtering out malicious traffic before it reaches a business’s origin infrastructure

 Creates more localized content/present more contextually relevant ads

 Optimizes content by conducting A/B tests

 Reduces latency in delivering content to the user's browser

It’s worth noting that edge functions and serverless functions are not all that different. 

To expand upon this further, serverless functions are small, highly efficient pieces of code that run on broad geographic regions. Imagine the possibility of reducing latency significantly for a California-based user calling that serverless function based on the east coast; this is where edge functions come into play by bringing those serverless functions to their doorstep.

We don’t just ship serverless functions to the edge; we can send entire web applications. Vercel and Next.js are leading the charge today. With the release of react server components and the apparent adoption by the community, you can ship server components and static content on the edge, delivering unparalleled experiences.

For more on the subject, I recommend reading Salma Alam-Naylor’s articleUnderstanding Edge Functions: The Edge and Beyond.

Group of diverse engineers working in an open floorplan office

A Double-Edged Sword

While edge functions may seem to pose nothing but upside, it’s not uncommon to face some implementation challenges, including: 

Unified Manageability Across Edges

This can be difficult and is becoming increasingly more accessible with the help of companies like Vercel and AWS.

Security and Privacy

Zero trust security architecture is one of the latest paradigms that believe that no aspect of data communication is secure. Implementing something like this with real-time low latency requirements continues to prove to be a major challenge.

Artificial Intelligence (AI) & Machine Learning (ML) Models for Edge

AI & ML can be a challenge because to derive the value of the data generated across the various edges, vast data points associated with a single end-user or a single device must be processed and analyzed at a constant time interval.  

PeakActivity and the Cutting Edge

Now that we discussed what edge functions are, let's talk about how PeakActivity is utilizing this functionality in a highly sustainable and impactful way.

We recently engaged with a client to help bring speed, stability, and scalability to their users. After spending a few weeks learning about their current architecture and factoring in the upcoming holiday season, we decided to bring speed incrementally through edge computing.

At the time, Vercel was not ready for edge functions, and the client was already on AWS, so we decided to utilize the Lambda@Edge feature. Since the functionality was based on Node + Typescript, we could easily chunk the existing extensive API into smaller, more composable serverless functions. Right out of the gate, we yielded one colossal benefit: cost savings. We went from a high availability EKS cluster to a dozen smaller lambda functions which you only pay for what you use. We deployed these on edge now that we have a dozen lambda functions. 

The total time spent implementing these changes was approximately 30 days end-to-end. We abstracted the extensive REST API to smaller serverless functions, reused it where necessary, and deployed it on edge. All of this within 30 days provides tremendous incremental value.

Now that Vercel supports edge functions, we can better adapt this functionality. Vercel now provides an edge middleware to convert or create new server APIs directly from the Next.js application. 
 

Edge Functions Chart

Now that we discussed what edge functions are, let's talk about how PeakActivity is utilizing this functionality in a highly sustainable and impactful way.

We recently engaged with a client to help bring speed, stability, and scalability to their users. After spending a few weeks learning about their current architecture and factoring in the upcoming holiday season, we decided to bring speed incrementally through edge computing.

At the time, Vercel was not ready for edge functions, and the client was already on AWS, so we decided to utilize the Lambda@Edge feature. Since the functionality was based on Node + Typescript, we could easily chunk the existing extensive API into smaller, more composable serverless functions. Right out of the gate, we yielded one colossal benefit: cost savings. We went from a high availability EKS cluster to a dozen smaller lambda functions which you only pay for what you use. We deployed these on edge now that we have a dozen lambda functions. 

The total time spent implementing these changes was approximately 30 days end-to-end. We abstracted the extensive REST API to smaller serverless functions, reused it where necessary, and deployed it on edge. All of this within 30 days provides tremendous incremental value.

Now that Vercel supports edge functions, we can better adapt this functionality. Vercel now provides an edge middleware to convert or create new server APIs directly from the Next.js application. 
 

Elderly couple smiling playfully together after buying presents online

The Edge of a Better Experience

Like so many advancements in technology, the person who benefits the most from edge computing is the end user, and rightly so. Edge computing allows companies to provide their customers with an improved user experience and that—at the end of the day—is what drives eCommerce. Businesses that fail to continually optimize their user experiences by leveraging new technologies or processes like edge computing are not only letting their customers down but do so at their own risk. 

Learn more about PeakActivity’s Modernization services to see if they’re right for you.
 

Want even more educational content?

Subscribe below to get timely content delivered to your inbox,
or fill out the form below to speak to a Peakster about your next project.

SUBSCRIBE

DIGITAL MARKETING

Top 10 Photos of Developers Staring At Screens

READ MORE

DIGITAL STRATEGY

5 Ways Retailers Can Make Influencer Marketing More Influential

READ MORE

ECOMMERCE

How Many Emails is Too Many?

READ MORE