---
url: /demos/redis.md
description: Example showing how to sync into Redis from Electric.
---

# {{ $frontmatter.title }}

{{ $frontmatter.description }}

## Syncing into a Redis data structure

Redis is often used as a cache. Electric can sync into Redis and automatically manage [cache invalidation](/sync).

The main example code is in [`./src/index.ts`](https://github.com/electric-sql/electric/blob/main/examples/redis/src/index.ts):

<<< @../../examples/redis/src/index.ts{typescript}
