Skip to main content

What is Leapcell Redis

Leapcell Redis is a Serverless Redis service that provides a fully serverless experience. Redis is an in-memory database used for caching and storing data. It supports a variety of data structures such as strings, lists, sets, sorted sets, and hash maps. Redis also provides features like persistence, publish-subscribe, and transactions.

Compatibility

Data StructureCommands
Stringappend, decr, decrby, get, getex, getrange, getset, incr, incrby, incrbyfloat, set, setex, setnx, setrange, strlen
Bitmapbitcount, bitpos, getbit, setbit, bitop
HashMaphdel, hexists, hget, hgetall, hincrby, hincrbyfloat, hkeys, hlen, hmget, hmset, hset, hsetnx, hvals
Listlindex, linsert, llen, lpop, lpush, lpushx, lrange, lrem, lset, ltrim, rpop, rpush, rpopcount, rpushx, lpos, rpoplpush
Setsadd, scard, sismember, smembers, srem, spop, srandmember, sinter, sinterstore, sunion, sunionstore, sdiff, sdiffstore, smismember, smove
Sorted Setzadd, zcard, zcount, zincrby, zrange, zrangebyscore, zrank, zrem, zremrangebyrank, zremrangebyscore, zrevrange, zrevrangebyscore, zrevrank, zscore, zlexcount, zrangebylex, zremrangebylex, zpopmax, zpopmin, zrandmember, zunion, zunionstore, zinterstore, zinter, zdiff, zdiffstore

Architecture

The architecture of the Redis service is shown below:

Redis Architecture

Use Cases

Data StructureTypical Use Cases
StringRedis strings are commonly used for caching small objects such as session tokens, user data, or configuration settings. Strings are also ideal for storing counters (e.g., tracking API usage or view counts) and managing rate limiting (e.g., API request limits).
BitmapBitmaps are well-suited for tracking binary states, such as monitoring user activity, attendance records, or feature flags. They are also used in analytics, such as click tracking or creating Bloom filters for set membership checks.
HashMapHash maps are commonly used for storing user profiles (e.g., user attributes), caching objects with multiple fields (e.g., product details), or representing objects with attributes in key-value format, making them ideal for fast access to specific fields within an object.
ListRedis lists are ideal for implementing queues (e.g., task processing or message queues), storing recent activity logs (e.g., last N actions), or implementing ordered lists such as leaderboards where data needs to be retrieved in a specific order.
SetSets are used for managing unique collections, such as unique users, tags, or product categories. They are also useful for implementing membership checks (e.g., determining if a user has access to a specific feature) and performing set operations like intersection, union, or difference.
Sorted SetSorted sets are used to manage ranked data, such as leaderboards or high score tracking. They are also useful for implementing time-based data (e.g., event logs or expiration of items) and storing sorted data for quick retrieval based on score or rank, making them ideal for applications that require quick lookups in sorted order.