Welcome to EdgeKV
EdgeKV helps you build data-driven EdgeWorkers applications that require fast, frequent reads and infrequent writes. You can access EdgeKV data from inside an EdgeWorkers function, and administer the database using the management API or CLI.
Benefits
EdgeKV, Akamai’s distributed key-value store for EdgeWorkers offers these benefits:
- Key-Value database: EdgeKV stores data in string or JSON format.
- JavaScript helper library: The helper library abstracts CRUD data operations on EdgeKV databases from inside EdgeWorkers code.
- Replicated storage: Ensures high availability of stored data by replicating it across multiple geographic locations based on the configured geoLocation of each namespace.
- Administrative API: Enables control of EdgeKV database functions outside EdgeWorkers code.
- Tokenized access: Enforces access controls to EdgeKV databases.
The diagram below illustrates the interaction between EdgeWorkers and EdgeKV. You can invoke EdgeWorkers code and utilize EdgeKV data with any of the four events in the request or response cycle.
Where to start
You can access EdgeKV directly from an EdgeWorkers function. With a few lines of code, you can read from or write to an EdgeKV database using the onClientRequest
, onClientResponse
, onOriginRequest
, onOriginResponse
, or responseProvider
event handler.
To get started with EdgeKV, you need entitlements for both EdgeWorkers and EdgeKV on contract. To make sure that both products are present, go to Akamai Control Center and from the the services menu and find Account Admin > Contracts. In the list of products search for EdgeKV and EdgeWorkers.
Once you've confirmed that you have the necessary contract requirements review these prerequisites that will help you design and create an EdgeKV database.
1. |
Authentication credentials. Before you can use the management API or CLI, you need to Create authentication credentials. |
2. | Namespace permissions. To create an EdgeKV database you need an EdgeKV-specific access token. This token authorizes an EdgeWorker ID to access data within a given namespace and ensures that only authorized IDs gain access to the data with the proper controls. |
3. | Helper library. The EdgeKV-specific JavaScript Helper library lets you access data from within an EdgeWorkers function. This library uses an EdgeWorkers HTTP sub-request in an EdgeWorkers event handler to access EdgeKV data. |
4. |
Data model and limits. Review the data model design to better understand the EdgeKV storage framework. You might also find it helpful to review the Hello world example that illustrates the data storage concepts. Before you start designing your EdgeKV data model refer to the Product limits. |
Updated 3 months ago