Getting Started with Redis SDK
Redis SDK refers to a Software Development Kit (SDK) for Redis. Redis is an open-source, in-memory data structure store, used as a database, cache, and message broker. It supports various data structures such as strings, hashes, lists, sets, sorted sets with range queries, bitmaps, hyperloglogs, and geospatial indexes with radius queries.
The Redis SDK would simplify the process of integrating Redis into a software application by providing pre-written code for common tasks, such as connecting to a Redis server, executing commands, handling responses, and managing connections. This allows developers to focus more on the specific requirements of their application and less on the details of interacting with Redis.This framework helps you to interact with Redis storage.
Install-Package Hubtel.Redis.Sdk
The command Install-Package Hubtel.Redis.Sdk
is a PowerShell command used in the NuGet Package Manager Console in Visual Studio. This command installs the Hubtel.Redis.Sdk
package into the current project.
Install-Package Hubtel.Redis.Sdk
Setup in appsettings.json
Place these entries in appsettings.json Also ensure you have your instrumentation key in there.
"RedisConfiguration": {
"Setup": [
{
"Host": "127.0.0.1",
"Name": "SendMoneyRedis",
"Port": "6379",
"Databases": [
{
"alias": "sessions",
"db": 1
},
{
"alias": "transactions",
"db": 8
}
]
}
]
}
Register the service
Do as shown:
services.AddHubtelRedisSdk(c => Configuration.GetSection(nameof(RedisConfiguration)).Bind(c));
Use an instance IMultiRedisHostCacheRepository in your code to interact with redis.
CHAT SAMMIAT