Materia KV: our easy-to-use serverless key-value database is available to all

Materia KV: our easy-to-use serverless key-value database is available to all
Clever Cloud was born out of a desire to make life easier for developers, by providing them automation tools and interfaces, so that they can concentrate on their applications and sites.

They “push” their code, and we deploy it, while ensuring that the environment in which they operate is kept up to date and secure, with one clear objective: maintaining it in operational condition. Whatever the situation, their service responds.

Designing simple, robust and innovative services

We do this whilst minimizing the footprint on our servers, offering on-demand or automatic horizontal/vertical scaling. This means we can multiply instances or scale them up / down according to the load of your sites. This commitment to simplicity extends beyond applications, as we also offer a wide range of “as-a-service” database (DB) services, enabling you to deploy MongoDB, MySQL, PostgreSQL or Redis environments in a matter of seconds, with the same tools and guarantees.

However, over the past few years, we faced a number of recurring requests: not only did some of our customers wish to access other services, but they also regularly asked to take benefit of our infrastructure, spread over three datacenters, to obtain high-availability services. But when it comes to DB, this isn’t always easy to implement while ensuring a high level of automation and data consistency. So we decided to develop our own range of products to achieve this.

The “Materia” project was born, based on the FoundationDB open-source transactional engine used, for example, by Apple for its iCloud services and by Snowflake. We’re contributing to it and adapting it to our needs, while taking advantage of its distributed and resilient aspect, notably due to its significant simulation capacity. It allows us to imagine a whole universe of serverless services, very simple to use, invoiced on a pay-per-use basis, with compatibility layers we’re developing to enable our customers to “talk” to it using existing protocols such as DynamoDB, GraphQL or PostgreSQL, for example.

Materia KV available to all

We started with the Redis protocol to introduce Materia KV, currently in Alpha testing phase. It’s a key-value database synchronously replicated across our three Paris datacenters. When our servers respond, your data has been written three times. Above all, it’s very easy to use: go to our Console, create a Materia KV add-on, and you’ll instantly obtain a token that can be used with any Redis client or by sending commands to our servers directly through the TCP protocol.

Thus, you can now benefit from a high-availability, key-value data storage solution, without having to configure a single instance, and with no minimum monthly fee: you simply pay for what you use. Above all, we provide this service with compatibility to existing protocols. Today Redis, tomorrow DynamoDB and GraphQL. The list of supported commands is available here.

Launched at Devoxx France mid-April, Materia KV made a big splash on site and during our demonstrations since then. We’ve therefore decided to make it available to all, to enable our customers and the interested public to give us feedback on how it works for them, and what their needs are. While billing will be on a per-use basis starting with the Beta phase, right now it’s free! So give it a try and let us know what you think.

Already built-in our tools and interfaces

Materia KV is of course available as an addon-provider in our API, Terraform (or OpenTofu, for example), but also in our CLI, Clever Tools. To create an access token, simply run the following command:

clever addon create kv NAME

This add-on can be linked directly to a Clever Cloud application, injecting its environment variables. But you can also use it from any third-party service, command-line client (CLI) or with graphical user interface (GUI).

While Materia KV and its various interfaces will be developed over time, we’ve started to think about integrating it into Clever Tools. A test branch, available as a binary and documented, offers a clever kv command.

With it, you can directly send requests to Materia KV by having the environment variable configured locally, or by specifying an ID in your commands:

# With Bash and Zsh
source <(clever addon env ADDON_ID --export)
# With Fish
clever addon env ADDON_ID --export | source

clever kv PING # PONG
clever kv set yourKey theValue
clever kv get yourKey

As this demo version doesn't handle all the commands managed by Materia KV, you can send a “raw” command and it will return the answer :

clever kv redis_raw 'hset key field1 value1 field2 value2' # 2
clever kv redis_raw 'hget key field2'                      # value2
clever kv redis_raw 'hgetall key'                          # the full hash

To demonstrate the possibilities of such integration, you also have the option of directly querying a JSON object stored in a key :

clever kv set simpleJson '{"key": "value"}' # the set data
clever kv getJson simpleJson key            # value
clever kv set jsonKey '[{"key": "value"}, {"bigKey": {"subKey1": "subValue1","subKey2": "subValue2"}}]'
clever kv getjson jsonKey bigKey.subKey2    # subValue1
clever kv getjson jsonKey ''                # the full JSON

To show just how simple such implementations can be, we've written a Materia KV client in Go using Go-Redis. If you'd rather understand how you can send commands and receive responses from Materia KV directly in TCP, you'll find examples in both V or Ruby.

Feel free to create your own and let us know 😉

A demonstration of Materia KV on Twitch, a community space

Want to find out more? Horacio González, our head of DevRel, will be giving a demonstration on Twitch on Tuesday June 18 at 13h15 (Paris Time). Pierre Zemb, creator of Materia at Clever Cloud, will also be discussing with our CTO Steven Le Roux in a video published at the end of June on Clever Cloud's YouTube channel.

And to share your views, questions and requirements, go to the Materia-dedicated section of our GitHub community space.

Blog

À lire également

Clever Cloud: Discover our clever side

Faced with increasingly demanding technical environments, Clever Cloud has established itself as a key player in supporting tech teams and IT decision-makers.
Company

Metabase on Clever Cloud: easily query and visualize your data

Your business generates data, which you need to analyse, understand and make available to your teams, both technical and non-technical. To meet this need, we worked with David Sferruzza to integrate Metabase for the cloud, which is available on our Marketplace and can be easily deployed on Clever Cloud.
Company

What is cloud computing?

Cloud computing is much more than just a trend: it's revolutionising the way businesses use, manage and optimise their IT resources.
Engineering