Skip to content

This project integrates Redis Cache, PostgreSQL, and .NET Core within a Dockerized environment to deliver a scalable, high-performance application.

Notifications You must be signed in to change notification settings

ilkersatur/RedisCache-PostgreSql-Docker-.NetCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Remote Dictionary Service

Overview

  • Primary Focus: Speed. It is used when extremely high speed is required.
  • A type of NoSQL database designed in a key:value format. It is utilized when more than just a key-value pair is needed.
  • Optional Disk Storage: Redis can write to disk optionally. It is often used where the dataset is not critical. Redis stores data in memory, which imposes significant memory constraints.
    • Memory Usage:
      • An empty instance uses 1 MB of memory.
      • 1 million key-value string pairs use approximately 100 MB of memory.

Screenshot 6

Supported Data Types

  1. String
  2. Hash
  3. List
  4. Set
  5. Sorted Set
  6. Geospatial Index
  7. HyperLogLog

Use Cases

  1. Database
  2. Caching Layer
  3. Message Broker

Screenshot 7

Where It Should Not Be Used

  • Redis is not a relational database. However, it can be used as a layer to define relationships for such database types.
  • Its best use case is handling datasets with a predictable size that grows rapidly, requiring speed.

Usage Scenarios

  • Caching Mechanisms
  • Pub/Sub
  • Preventing and Delaying Queues
  • Short-lived Data
  • Counting Comments
  • Analyzing Real Data
  • Storing Unique Data

Scaling Redis

Persistence

Redis provides two persistence mechanisms:

  1. RDB (Redis Database Snapshots)
  2. AOF (Append-Only Files)

Replication

  • A single Redis instance acts as the master.
  • Other instances are slaves, serving as copies of the master.
  • Clients can connect to either master or slave instances.
  • By default, slaves are read-only.

Partitioning

  • Data can be split and distributed across instances.

Failover

  • Manual
  • Automatic: Managed by Redis Sentinel for master-slave topologies.

Example: Setting up Redis with .Net Core

Running a Redis Container

To start a Redis container using Docker, execute the following command:

docker run --name my-redis -p 6379:6379 -d redis

Screenshot 7

Create a Web API Project

dotnet new webapi -n "CachingWebApi"

Screenshot 7

About

This project integrates Redis Cache, PostgreSQL, and .NET Core within a Dockerized environment to deliver a scalable, high-performance application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages