Casbin = way to authorization
A place for Casbin developers and users
现在注册
已注册用户请  登录
主题样式选择
默认主题样式 ✅
知乎主题样式 
SiggiSmara
Casbin官方博客站  ›  Casbin

Watcher vs SyncedEnforcer

  •  
  •  
    SiggiSmara · 1年前 · 221 次点击 
    这是一个创建于 417 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Hello everyone,

    I was wondering if you can give me advice on when to use a Watcher versus a SyncedEnforcer.

    My use case is a fastAPI REST service that spawns several workers, so using pycasbin library. No large volume of request and infrequent changes to policies. Policies are persited in a database using casbin_sqlalchemy_adapter.

    Until now I have been using SyncedEnforcer and that seems to work fine for what I need. Then I started reading about Watchers and was wondering what the real difference between the two is given that they are both taking care of synchronizing policy changes.

    Do I understand it correctly that a SyncedEnforcer is actively checking for updates (pull updates from db) while with a Watcher the Enforcers are subscribing to events (changes are pushed to enforcers)? And that in high volume setups the Watcher might be more performant? Or is there some other benefit of Watchers that I am missing?

    221 次点击  ∙  1 人收藏  
      Tweet Weibo 忽略主题 
    2 条回复   2021-09-05 15:49:57 +08:00
    hsluoyz
    hsluoyz1年前

    @SiggiSmara hi, plz send github issue

    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   0 人在线   最高记录 30   ·     选择语言  ·     选择编辑器
    创意工作者们的社区
    World is powered by code
    VERSION: ef70126 · 20ms · UTC 10:09 · PVG 18:09 · LAX 03:09 · JFK 06:09
    ♥ Do have faith in what you're doing