All Products
Search
Document Center

Edge Security Acceleration:Get started with Edge KV

Last Updated:Apr 23, 2025

This topic describes the basic operations of core features that provided by Edge KV. It guides you to quickly create namespaces, read and write data, and integrate APIs by providing simplified instructions, code examples, and key considerations.

Before you begin

Before you use Edge KV, take note of the following items:

  • Storage space

    • An Alibaba Cloud account can have up to 10 GB of storage space.

    • A namespace can have up to 1 GB of storage space.

  • Key-Value

    • A key can be up to 512 bytes in length and can contain only letters, digits, hyphens (-), and underscores (_). It cannot contain special characters, such as spaces, forward slashes (/), and question marks (?).

    • A value can be up to 1.8 MB in size.

      Note

      Each key-value pair belongs to a namespace.

  • Synchronization time

    To ensure data consistency, data is synchronized to points of presence (POPs) around the world within 20 seconds, though it may take up to 300 seconds in rare cases.

  • Access limit

    Edge Routine can read and write only Edge KV data that belongs to the same Alibaba Cloud account. For example, Edge Routine of Account A cannot read and write Edge KV data of Account B.

Use Edge KV

After you activate Edge KV, you can use Edge KV in the Edge Security Acceleration (ESA) console or by performing the built-in API operations of Edge Routine.

image

Create a namespace

Note

Namespaces are isolated from each other. You can create up to 10 namespaces.

  1. Log on to the ESA console, and in the left-side navigation pane, choose Edge Computing > Edge KV.

  2. On the page that appears, click Create Namespace. In the dialog that appears, follow the on-screen instructions to specify the Namespace Name and Description parameters.

    Note

    The Namespace Name parameter corresponds to the namespace parameter in the built-in API operations of Edge Routine.

    创建存储空间

  3. Click OK.

Manage Edge KV data

Manage Edge KV data by using the ESA console

Note

You can add a value of up to 100 KB in size in the ESA console. To add a value of a larger size, call an API operation of an Edge routine.

You can add, modify, or delete Edge KV data in the ESA console.

  1. Log on to the ESA console, and in the left-side navigation pane, choose Edge Computing > Edge KV.

  2. In the namespace list, find the namespace that you want to manage and click Manage in the Actions column.

  3. Click Add Key-value Pair and follow the on-screen instructions to specify the Key and Value parameters.8

  4. Click OK.

  5. Optional. After you add data, click Modify, View, or Delete to manage the data.

Manage Edge KV data by performing API operations

You can perform the built-in API operations of Edge Routine to add, modify, query, or delete Edge KV data.

Important
  • Before you perform API operations to manage data, make sure that a namespace is created in the ESA console.

  • For more information about API operations, see Edge KV API operations.

  1. Perform the Constructor operation to pass the namespace parameter to create a key-value object.

    The value of the namespace parameter is the name of the namespace that you created in the ESA console. You can view the namespace in the namespace list.

    const edgeKv = new EdgeKV({ namespace: "ns"});
  2. After you create a key-value object, perform the following built-in API operations to implement the related features.

    • get

      Reads data from a namespace.

    • delete

      Deletes a specific key and its value from a namespace.