All Products
Search
Document Center

Dynamic Content Delivery Network:EdgeKV

Last Updated:Nov 13, 2023

Points of presence (POPs) provide the edge storage service EdgeKV, which is based on key-value pairs. After you write data to EdgeKV, the data can be automatically synchronized to POPs around the world. EdgeRoutine (ER) can read and use the EdgeKV data on the same POP. You can use EdgeKV together with ER to deploy lightweight Backend as a Service (BaaS) services and API gateway services.

1

Scenarios

EdgeKV is suitable for scenarios in which developers write data at low frequencies and ER reads data at high frequencies. For example, developers write data to EdgeKV in the Dynamic Content Delivery Network (DCDN) console. Then, the built-in API operations of ER are called to read data at high frequencies 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 prices for different operations are different. The following table describes the prices for different operations.

Billable item

Billing rule

Billing cycle

Unit price

Key-value storage

You are charged based on the size and storage duration of the stored 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.

USD 0.0022 per GB-hour

Key-value read (GET)

You are charged for the number of EdgeKV API requests that are initiated to read data from a namespace. For more information about GET requests, see GetDcdnKv.

USD 0.11 per 1 million calls

Key-value write (PUT)

You are charged for the number of EdgeKV API requests that are initiated to write or update data to a namespace. For more information about PUT requests, see PutDcdnKv.

USD 1 per 1 million calls

Key-value delete (DELETE)

You are charged for the number of EdgeKV API requests that are initiated to delete key-value pairs from a namespace. For more information about DELETE requests, see DeleteDcdnKv.

Key-value list (LIST)

You are charged for the number of EdgeKV API requests that are initiated to list all keys in a namespace. For more information about LIST requests, see ListDcdnKv.

Note

EdgeKV is a value-added service. You are charged for namespaces and requests. Billable items such as number of routines, traffic, bandwidth, number of requests, and real-time logs, or value-added services are still billed based on your original billing methods. For more information about billing, see Billing overview.

Billing example

image

For example, you created Routine A, used 1 GB of the EdgeKV storage for 1 day, read key-value data from EdgeKV 2 million times, and wrote key-value data to EdgeKV 1 million times, as shown in the preceding figure.

Fee for EdgeKV on January 1, 2021: USD 0.0022 × 24 + USD 0.11 × 2,000,000 (reads) + USD 1 × 1,000,000 (writes) = USD 1.273.

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

Activate EdgeKV

Before you can use EdgeKV, you need to activate EdgeKV.

Log on to the DCDN console. In the left-side navigation pane, click EdgeKV, and then click Activate Now.

1

Use EdgeKV

After you activate EdgeKV, you can use EdgeKV by using the DCDN console or 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.

    创建存储空间
  3. Click OK.

Manage EdgeKV data by using the DCDN console

You can 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

You can call 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 operations.

  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.