> For the complete documentation index, see [llms.txt](https://www.serverless-cqrs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.serverless-cqrs.com/advanced/repository.md).

# Adapter Interface

## Description

Adapters allow us to persist **events** (for the write model) and/or **projections** (for the read model).

If you can't find an adapter for your favorite database, you can build one by implementing the **Adapter Interface**.

The **Adapter Interface** has two sets of methods, depending if you are persisting **events**, **projections**, or both. Not every database is suitable for storing both. DynamoDB, for example, is very well suited for storing **events**, but lacks the search capabilities which are useful when storing **projections**. ElasticSearch, on the other hand, is great for storing, and searching, arbitrary JSON objects (**projections**) but is not very well suited for a stack of **events**.

When implementing the **Adapter Interface**, you can choose which set of methods to implement.

## Methods

{% content-ref url="/pages/-LUyNOwwcsqfGHXnzCAn" %}
[Write Model](/advanced/repository/write-model.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LUyNJl2367gscStKtKh" %}
[Read Model](/advanced/repository/read-model.md)
{% endcontent-ref %}

## Examples

{% content-ref url="/pages/-LUjLs3AamWPsuHWvAO1" %}
[dynamodb-adapter](/components/dynamodb-adapter.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LUjLupsvTm0wgn61G7Q" %}
[elasticsearch-adapter](/components/elasticsearch-adapter.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LUpbXDIxYVs7BTwZb5p" %}
[memory-adapter](/components/memory-adapter.md)
{% endcontent-ref %}
