DiceDB is hyper-optimized for building and scaling truly real-time applications on modern hardware. It is a drop-in replacement for Redis with support for SQL-based reactivity.
Refactor WatchList implementation using sync.Map for thread safety and performance improvements since we will read from this map more than we write to it (a client will likely subscribe to some queries once and then listen on them indefinitely)
Replaced WatchList and WatchListMutex with sync.Map for concurrent access.
Added AddWatcher and RemoveWatcher functions to manage watchers.
Updated evalQWATCH to use the new AddWatcher function.
Modified WatchKeys to utilize sync.Map methods for iterating and managing clients.
Simplified regex matching and client notification logic within WatchKeys.
Refactor WatchList implementation using sync.Map for thread safety and performance improvements since we will read from this map more than we write to it (a client will likely subscribe to some queries once and then listen on them indefinitely)
WatchList
andWatchListMutex
withsync.Map
for concurrent access.AddWatcher
andRemoveWatcher
functions to manage watchers.evalQWATCH
to use the newAddWatcher
function.WatchKeys
to utilizesync.Map
methods for iterating and managing clients.WatchKeys
.