I have a SQL table that is accessed continually but changes very rarely.
The Table is partitioned by UserID and each user has many records in the table.
I want to save database resources and move this table closer to the application in some kind of memory cache.
In process caching is too memory intensive so it needs to be external to the application.
Key Value stores like Redis are proving inefficient due to the overhead of serializing and deserializing the table to and from Redis.
I am looking for something that can store this table (or partitions of data) in memory, but let me query only the information I need without serializing and deserializing large blocks of data for each read.
Is there anything that would provide Out of Process in memory database table that supports queries for high speed caching?
Searching has shown that Apache Ignite might be a possible option, but I am looking for more informed suggestions.
Since it's out-of-process, it has to do serialization and deserialization. The problem you concern is how to reduce the serialization/deserizliation work. If you use Redis' STRING
type, you CANNOT reduce these work.
However, You can use HASH
to solve the problem: mapping your SQL table to a HASH
.
Suppose you have the following table: person: id(varchar), name(varchar), age(int)
, you can take person id
as key, and take name
and age
as fields. When you want to search someone's name, you only need to get the name field (HGET person-id name
), other fields won't be deserialzed.