Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/meronz/cachingdemo
https://github.com/meronz/cachingdemo
dotnet postgres redis
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/meronz/cachingdemo
- Owner: meronz
- Created: 2022-10-30T08:55:58.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-30T08:56:00.000Z (about 2 years ago)
- Last Synced: 2023-03-01T03:05:49.803Z (almost 2 years ago)
- Topics: dotnet, postgres, redis
- Language: C#
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Caching demo
This project shows the usage of [FusionCache](https://github.com/ZiggyCreatures/FusionCache) to speed up
the retrieval of data from a Postgres database.- ASP.NET Core 6.0
- Entity Framework Core 6.0
- FusionCache## Quickstart
1. First install Postgres and Redis.
```sh
docker-compose up
```2. Run the demo
```sh
cd CachingDemo
dotnet run
```## How it works
This project exposes a simple API to create and fetch `User` objects. Data is persisted in Postgres, but to reduce
latency when serving these requests, it is also cached in two layers: First in-memory, and second on Redis.
Redis actually serves two purposes here, both as a cache and as synchronization Backplane. More info about that
on the FusionCache docs.