Does OPA support fast loading and dynamic updating #175
Replies: 9 comments 4 replies
-
Hi @doaspx 👋 Delta bundles is a recently introduced feature in OPA that builds on the well-known bundle format, and extends it to work with data updates in the form of deltas, meaning you won't need to download the entire dataset each time a change is registered, but only patches of the data changed. OPAL is another project that aims to solve this by using an additional sidecar to feed updates to OPA via its REST API rather than bundles. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your reply I have a little problem On my side, I prefer to use API. In my own reality, sidecar is called through rest API; Does restapi support batch? What is the problem with multiple goroutine writes? What is the maximum limit? What is the maximum write data of a single restapi? 非常感谢您的回复 我还有个小问题 我这面还是比较倾向使用API,自己现实,sidecar 通过 REST API 调用; RestAPI 支持批量吗?如果多goroutine 写入会有什么问题,最大限制是多少呢?单个RestAPI 最大写入数据是多少呢? |
Beta Was this translation helpful? Give feedback.
-
The REST API patch operation on the data API is described in the OPA docs. Patches are sent in JSON patch format, and as such may contain as many patches as you want, but I'm not sure what you have in mind when you say "batch". JSON patch is serial by design, so patches will be applied from top to bottom of the list. For that reason, I'm not sure how concurrent writes would work, as you could end up with potentially conflictting operations, i.e. where one write says "delete"and another write says "add"... and you'd have no way of knowing which one was first unless they were ordered. |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for your reply I understand that sidecar can call API to update OPA by directly subscribing to publication; If we adopt patches, we need to maintain more "*. Tar. GZ" files; It feels less flexible than calling API |
Beta Was this translation helpful? Give feedback.
-
If the data is loaded through the bundle and can be modified through the API, it can meet my demand scenario, I'd like to ask why we prohibit API from modifying bundle data?? ps: { |
Beta Was this translation helpful? Give feedback.
-
Hi again! Some discussion on that topic here: open-policy-agent/opa#3138 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Yes, concurrently pushing data is OK. The server will only process one write transaction at a time; and the write will block until there are no ongoing read transactions to ensure consistency. Any reads will then be blocked until the write has finished. There's no MVCC or anything like it built into OPA, however. If two "concurrent" PUT requests end up writing the same piece of data, the writes will be executed sequentially and the last one "wins". |
Beta Was this translation helpful? Give feedback.
-
Moved from issue to the OPA discussion board. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
My current scenario is to do an authentication function
The data source has a large amount of data and is continuously updated (including the addition, deletion and modification of permissions);
I hope that the data source can be loaded into OPA quickly when OPA is started; And it can keep updating with the data source efficiently
I think of two ways now, but I don't think they are very perfect
Use bundle to load tar at one time GZ file; However, it can only update through polling. This time, there is a delay, which makes the process very inefficient; I expect to update the loaded data through the restapi, but I'm sorry to prompt "path bindings is owned by bundle " authz \ "
When OPA is started, 5g data is loaded into OPA through restapi; Subsequent updates through API; This disadvantage feels that a large amount of data needs to be written through the API. I don't know how the performance is; Of course, I can deploy multiple OPAs by business; The feeling is not very perfect;
I don't know if there is a good solution to load quickly and update the data in it
Beta Was this translation helpful? Give feedback.
All reactions