# Key-Value Store

## Motivation

**coherence** provides an API and a database for storing key-value pairs from within game sessions.

## Description

The key-value store provides a simple way to store and retrieve data for the currently logged in player. For example, you could store the player's score, email address, or any other data.

{% hint style="warning" %}
This feature requires a [game account](https://docs.coherence.io/1.0/coherence-cloud/enabling-features/game-account).
{% endhint %}

## Limitations

The keys must be alphanumerical strings, underscore or dash. Currently, only strings are accepted as values. If you need to store numbers or complex types like arrays, you have to convert them to strings.

The total amount of stored data (keys + values) cannot exceed 256 KB per player (TBD).

There is no limit how often the data is stored or retrieved.

## Using key-value store from Unity

Please refer to the [Cloud Service API: Key-value store](https://docs.coherence.io/1.0/coherence-cloud/using-coherence-cloud-in-unity/game-services/key-value-store)**.**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coherence.io/1.0/coherence-cloud/enabling-features/key-value-store.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
