BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News AWS Introduces Amazon CloudFront KeyValueStore: a Low Latency Datastore for CloudFront Functions

AWS Introduces Amazon CloudFront KeyValueStore: a Low Latency Datastore for CloudFront Functions

This item in japanese

AWS recently announced Amazon CloudFront KeyValueStore, a secure global low-latency key-value datastore that allows read access from within CloudFront Functions, enabling advanced customizable logic at the CloudFront edge locations.

Earlier, developers had to embed configuration data inside the function code, for instance, data for determining if a URL should be redirected. Now, with CloudFront KeyValueStore, they can update the data associated with a function and the function code independently, simplifying function code and making it easier to update data without the need to deploy code changes.

The company has designed CloudFront KeyValueStore to quickly scale to handle millions of requests per second without the need to scale up storage resources.

Developers can manage a key-value store using the AWS Management Console, AWS Command Line Interface (AWS CLI), and AWS SDKs. Furthermore, the company intends to add AWS CloudFormation support soon.

Creation of a Key-Value Store (Source: AWS News Blog)

When creating a key-value store, developers can import key/value data during creation using a source file on Amazon S3 with this JSON structure:

{
  "data":[
    {
      "key":"key1",
      "value":"val1"
    },
    {
      "key":"key2",
      "value":"val2"
    }
  ]
}

A Key-Value store has a maximum size of 5 MB, allowing developers to link it to a single Cloud Function. In addition, the key can have a maximum size of 512 bytes, and values can reach up to 1 KB in size. A respondent on a Reddit thread commented:

Very cool option for CF Functions. The 5MB storage limit feels a little miserly though. Although $0.03/million reads is very sharp compared to other AWS options.

In addition, Rohit Kulshreshtha, a principal engineer at Pinecone, tweeted:

Why’d they call it a key-value store, though: it seems overly broad. Seems more like a place to stash configuration.

With Danilo Poccia, a chief evangelist at AWS, responded:

Complex configs is definitely one of the use cases. But you can also update from a web/app tier, and the updates are replicated to edge locations in seconds.

Furthermore, Yan Cui, an AWS serverless hero, tweeted:

Ok, this is interesting! CloudFront has added a KeyValueStore for CloudFront Functions.

Sounds promising at 1st glance, useful for A/B testing where you have fairly static kv pairs, but not for transactional data.

Lastly, CloudFront KeyValueStore is available in all edge locations globally. In addition, users only pay for what they use based on the read/write operations from the public API and the read operations from within CloudFront Functions. More details are available on the CloudFront pricing page.

About the Author

Rate this Article

Adoption
Style

BT