EdgeKV

更新时间:
复制 MD 格式

EdgeKV is a key-value edge storage service provided by points of presence (POPs). Data written to EdgeKV is automatically synchronized to POPs worldwide, allowing EdgeRoutine (ER) to read it locally. Together, EdgeKV and ER enable lightweight Blockchain as a Service (BaaS) and API gateway deployments.

Important

DCDN will phase out EdgeKV for new users starting from May 1, 2025 at 00:00 (UTC+8). Current users won't be affected.

We recommend you upgrade to ESA to use Edge KV.

1

Scenarios

EdgeKV is designed for low-frequency write and high-frequency read scenarios. For example, developers write data to EdgeKV in the Dynamic Content Delivery Network (DCDN) console, and ER reads the data at high frequencies through its built-in API operations to process client requests.

Limits

Item

Description

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 characters in length and can contain only letters, digits, hyphens (-), and underscores (_). A key 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 POPs around the world in 20 seconds in most cases and in 300 seconds in rare cases.

Access limit

ER can read and write only EdgeKV data that belongs to the same Alibaba Cloud account. For example, ER in Account A cannot read and write EdgeKV data in Account B.

Billing

Pricing

The following table describes the pricing for each operation.

Billable item

Billing rule

Billing cycle

Unit price

Key-value storage

Charges are based on the size and storage duration of key-value pairs.

Pay-by-day: The amount that is due on each day is deducted from your account balance at 00:00 on the next day.

Key-value read (GET)

Charges are based on the number of API requests to read data from a namespace. For more information about GET requests, seeGetDcdnKv.

0.7 yuan/million calls

Key-value write (PUT)

Charges are based on the number of API requests to write or update data in a namespace. For more information about PUT requests, seePutDcdnKv.

6.5 yuan/million calls

Key-value delete (DELETE)

Charges are based on the number of API requests to delete key-value pairs from a namespace. For more information about DELETE requests, seeDeleteDcdnKv.

Key-value list (LIST)

Charges are based on the number of API requests to list all keys in a namespace. For more information about LIST requests, seeListDcdnKv.

Note

EdgeKV is a value-added service billed separately for namespaces and requests. Other billable items such as routines, traffic, bandwidth, requests, and real-time logs continue to follow your existing billing methods. For more information, seeBilling overview.

Billing example

image

In this example, Routine A uses 1 GB of EdgeKV storage for 1 day, reads key-value data 2 million times, and writes key-value data 1 million times.

Billing cycle: Edge storage fee on January 1, 2021: 0.0139 yuan/GB/hour * 24 + 0.7 yuan/million reads × 2 million + 6.5 yuan/million writes × 1 million = 8.234 yuan.

The fee that was incurred on January 1, 2021 was deducted at 00:00:00 on January 2, 2021.

Activate EdgeKV

You must activate EdgeKV before you can use it.

  • Log on to the DCDN console.

  • In the left-side navigation pane, click EdgeKV, and then click Activate Now.

1

Use EdgeKV

After activation, you can manage EdgeKV data through the DCDN console or by calling the built-in API operations of ER.

image

Create a namespace

Create a namespace in the DCDN console.

Note

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

  1. Log on to the DCDN console.

  2. In the left-side navigation pane, choose Edge Computing > EdgeKV. On the page that appears, click Create Namespace and follow the on-screen instructions to configure the Namespace Name and Description parameters.

    Note

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

    Create namespace

  3. Click OK.

Manage EdgeKV data by using the DCDN console

Add, modify, or delete EdgeKV data in the DCDN console.

  1. Log on to the DCDN console.

  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 and follow the on-screen instructions to configure 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 EdgeKV data by calling API operations

Use the built-in API operations of ER to add, modify, query, or delete EdgeKV data.

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

  • For more information about API operations, see EdgeKV API.

  1. Call Constructor 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 DCDN console. You can view the namespace in the namespace list.

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

    API

    Description

    get

    Reads data from a namespace.

    delete

    Deletes a specific key and its value from a namespace.