I have a project in which i need to replace the SQL DB with REDIS. Its a job scheduling system. There are tables like JobInfo, TaskInfo, Result, BatchInfo etc. What is the best way to map DB tables in REDIS server key value pair?
There are join and group by kind of queries used in the project. What is the best way to replace the sql server with the redis server? Also does redis provides a way with which i can query the data like i can in join and group by queries?
There are no tables available in Redis but the Redis data structures are available as the replacement for tables. So the most important step in the transition is remodelling the tables into Redis data structures. With this option, we normally need to make changes in the system code to use Redis commands instead of SQL queries.
RediSQL can also store results of queries into a Redis Streams. This allows different clients to consume part of the result, or to delay the consuption of a result. Moreover, it allows caching the result of expensive queries as Redis Streams to consume them over and over again. JSON is the de-facto standard for sharing data between applications.
RediSQL provides you with lightweight in-memory databases. It could completely shift your architecture. For example, you could create a new isolated database each day, one for each application tenant, or even one per user. While RediSQL focuses on in-memory database, it can also store data in a regular file.
For example, you could create a new isolated database each day, one for each application tenant, or even one per user. While RediSQL focuses on in-memory database, it can also store data in a regular file.
Redis is basically a key-value store (a bit more sophisticated than just a simple one, but yet - a key-value db). the value may be a document that follows some schema, but Redis isn't optimized to search for those documents and query them like other Document Databases or like relational database such as SQL Server.
I dont know why you're trying to migrate from SQL Server to Redis, but you need to re-check yourself if that's the right design choice. If you need fixed schema and join operations - it may suggest that Redis isn't the right solution.
If all you're looking for is caching, you can cache in the application layer, or use other solution to integrate your Redis and SQL Server (I wrote simple open-source project that does that: http://redisql.ishahar.net ).
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With