Skip to main content

3 posts tagged with "redis"

View All Tags

Optional Redis and Property-Level RawSQL

· One min read
TeaQL Code Gen
Core Contributor

Optional Redis significantly lowers deployment barriers. Property-level RawSQL increases query flexibility.

Optional Redis

+ Redis is now an optional dependency
+ LocalLockService: in-memory lock for non-Redis environments
+ RedisLockService: distributed lock when Redis is available
+ TQLAutoConfiguration: conditionally loads based on classpath

Before: spring-boot-starter-data-redis was mandatory.

After: Works without Redis, automatically falling back to local locks.

Property-Level RawSQL

@RawSQL("CONCAT(first_name, ' ', last_name)")
String getFullName();

Three levels fully supported: Property-level, Criteria-level, Select-level.

Aggregation Function Prefixes

+ Configurable prefix for aggregation result columns
+ Prevents column name conflicts in multi-aggregation queries

Request Pagination

Generated Request classes automatically include page and pageSize fields.

Expression orElse/orElseThrow

String name = Q.user().name().orElse("Unknown");
String email = Q.user().email()
.orElseThrow(() -> new BusinessException("Email required"));

Aligns with Java Optional conventions.

Redisson Migration and Distributed Locks

· One min read
TeaQL Code Gen
Core Contributor

Migrated from Spring Data Redis to Redisson for a richer Redis client experience.

Redisson Migration

- spring-data-redis RedisTemplate
+ Redisson: RMap, RSet, RLock, etc.

Redisson provides richer distributed data structures, built-in distributed locks, more efficient serialization, and connection pooling.

Lock Abstraction

// Local lock (single JVM)
lockService.acquireLocal("order-process", () -> {
// critical section
});

// Distributed lock (multi-instance)
lockService.acquireDistributed("order-process", () -> {
// critical section across all instances
});
+ LockService interface
+ LocalLockService: ReentrantLock-based
+ DistributedLockService: Redisson-based
+ Configurable lock timeout and retry

View Renderer with Redis Caching

· One min read
TeaQL Code Gen
Core Contributor

The view rendering system gained Redis-backed persistent caching, and the Service Request framework landed.

Redis View Cache

UserContext now includes DataStore/Redis DataStore:

+ Redis-backed view data storage
+ View parser with template rendering
+ Customizable empty view support

Service Request Framework

+ Service request controller registry
+ Processor-based request handling
+ Request path prefix configuration

UI Template Renderer

Template renderer for generating UI views from domain models using ObjectMapper for JSON serialization.

Generator Updates

  • Service request controller/processor generation
  • Request path prefix configuration
  • Candidate preparation generation
  • viewObject and JsonMe support