RedisDatabaseConnector
Overview
Easily integrate Redis into your Mendix applications.The RedisDatabaseConnector allows you to connect, read, write, and manage Redis key-value data structures seamlessly from your Mendix app. Ideal for high-performance caching, session storage, and fast data operations.
Documentation
โ Typical Usage Scenario
The Redis Database Connector module allows developers to seamlessly integrate Redis with their Mendix applications.
Customers can use this module to:
-
Store temporary data (sessions, user preferences, etc.)
-
Perform high-performance caching
-
Save and retrieve complex data structures (like JSON)
-
Queue operations using Redis Lists
-
Append logs or values to keys for logging or tracking use cases
This module is useful in:
-
Real-time applications (chat, dashboards)
-
Performance-optimized APIs
-
Scalable microservice architectures using Redis as a shared state
โ Features and Limitations
โจ Features:
-
๐น String Support: Append, Decrement, DeleteKey, Get, Increment, Set, SetWithExpity, Stringlength, Substring
-
๐น List Support: AddListFromLeft, AddListFromRight, GetList, LeftPop, LeftPush, Range, RightPop, RightPush
-
๐น JSON Support (via RedisJSON): JSONArrAppend, JSONArrInsert, JSONArrLength, JSONDeleteKeyOrObject, JSONGet, JSONMerge, JSONObjkeys, JSONSet
-
๐น Set: SAdd, SAddList, SCountValues, SInterSection, SInterSectionStore, SIsMember, SMove, SRemove, SRemoveList, SUnion, SUnionStore
-
๐น SortedSet: ZAdd, ZAddList, ZCountValues, ZRangeWithScores, ZRemove, ZRemoveList, ZReverseRangeWithScore
-
๐น Efficient connection pooling using Jedis
-
๐น Customizable Java Actions for flexibility
-
๐น Built with Jackson for advanced JSON manipulation
โ ๏ธ Limitations (v1.0.0):
-
No support for Redis Hashย yet (coming in v2.0+)
-
Pub/Sub not included
-
No built-in TTL/expiration (planned)
-
Basic error handling โ custom retry strategies not implemented yet
โ Dependencies
Ensure the following JAR files are included in your project's userlib folder:
Library: - commons-pool22.12.1,
gson2.11.0,
jackson-annotations2.16.0,
jackson-core2.16.0,
jackson-databind2.16.0,
jedis6.0.0,
slf4j-api2.0.7,
slf4j-simple2.0.7
ย
These are already bundled with the module for convenience.
โ Installation
-
Download and import the RedisDatabaseConnector module into your Mendix project.
-
Clean and build your project to refresh dependencies.
-
(Optional) Create constant variables for RedisHost, Port, or Password if needed.
โ Configuration
-
Open the Java actions and configure your Redis connection using:
-
Host (e.g., 127.0.0.1)
-
Port (default: 6379)
-
Password (if applicable)
-
-
Use exposed Java actions such as:
-
Set for setting the String
-
Get from get the String
-
JsonSet
-
Leftpush
-
-
Optionally use Export Mappings to serialize Mendix objects into JSON and store them in Redis.
โ Known Bugs
-
In rare cases, connection pool exhaustion can occur without retry if many parallel users interact with Redis.
โ Frequently Asked Questions
Q: Can I store full Mendix objects as JSON in Redis?
A: Yes! Use Export Mapping to convert the object to JSON and use JSONSet JavaAction.
Q: Will this work with Redis Cloud providers like Upstash or AWS ElastiCache?
A: Yes, as long as host/port and authentication are correctly configured.
Q: Can I retrieve Redis data and map it back to Mendix objects?
A: Yes. You can use Import Mappings with retrieved JSON to restore Mendix objects.
Q: How can I clear all keys?
A: This version does not include a flushAll method for safety reasons. You can extend the module if needed.