Enhance Applications with Edge Computing

Edge computing is a technology that brings data storage and processing closer to the source of data —the edge of your network. The use of edge computing introduces several advantages, mainly reduced latency, increased security, and improved scalability.

Using Azion services and products, it’s possible to demonstrate how an e-commerce application’s shopping cart feature can be moved to an edge computing environment. The proposed serverless approach integrated with other edge capabilities offers high performance, scalability, and reliable data transactions.


Enhanced Applications Architecture

Overview of a request/response of shopping cart through Edge Application

Dataflow

  1. The user accesses the domain, which represents a service running on Azion’s edge computing platform.

    1.1. The request is directed to an application running in the cloud via the respective path.

    1.2. The request is routed to an application running at the edge through the corresponding path.

  2. The edge application rule, which has been configured to activate an edge function, is triggered. This edge function, developed in JavaScript and deployed onto the Azion Edge Platform, runs the logic for the shopping cart.

  3. Operations requiring database transactions (like adding, updating, or removing items from the cart) are accomplished with Edge SQL. This reduces latency as these operations are performed closer to the user. The static content (like product details, images, etc.) if any, will be stored in Edge Storage, reducing latency and costs by allowing for faster retrieval and reducing the load on central servers.

After this process, the application returns a response to the request.


Components

  • Edge Application: set up an edge application to configure delivery and cache policies, create rules to automate cache policy assignments based on content type, and determine how content is cached.
    • Edge Functions: allows you to create event-driven, serverless applications, at the edge of the network, closer to users.
    • Edge Storage: a scalable and secure storage service designed to integrate object storage with the Azion Edge Platform using the S3 standard for object operations.
    • Edge SQL: an edge-native SQL solution designed for serverless applications. It’s fully ACID-compliant and utilizes SQLite’s SQL dialect to provide a familiar development environment, facilitating fast integration.

Implementation

  1. Create an edge application:
    • On Console, create an application using the + Create button on the homepage.
    • Using the Azion API to create an edge application.
    • Using the Azion CLI to create and deploy an edge application.
  2. Create an edge function and instantiate it in the recently created application.
  3. Create a domain and associate it with the edge application:
    • On Console, create a domain using the + Create button on the homepage.
    • Using the Azion API to create a domain.
    • If you created an application through a template, the domain is created for you.
  1. Test and monitor your edge application.


Contributors