casbin-redis-watcher
casbin-redis-watcher copied to clipboard
Casbin Redis Watcher update by re-loading the whole casbin policy table
We are using Casbin Redis Watcher to help synch-up the policies among different Casbin nodes. The way the Watcher is implemented is to re-load the whole policy table during update. This could be really slow if the size of the table grows to 1 million to 10 million records, which is the size of policy we are seeing to grow into. Is there a better way to synch-up the policies among nodes, using the Watcher? Or if the Dispatcher is only viable alternative?
@bingmwu you can use WatcherEx: https://casbin.org/docs/en/watchers#watcherex
@billcobbler
@hsluoyz So we will need to do our own implementation for watcherEx interface, since there is no implementation yet? Just to confirm. Thanks.
@bingmwu yes, can you make a PR to implement it?
@hsluoyz we looked at the WatcherEx, but not sure how to access the in-memory model of enforcer, from a WatcherEx. What we need is to update the in-memory model, without saving the policies to the database through JDBC adaptor, when the watcher got an updated policy event.
@bingmwu we will implement the Redis WatcherEx: https://github.com/casbin/redis-watcher/issues/1