Understanding OPA Bundle Document #355
-
Hi, I'm reading https://www.openpolicyagent.org/docs/latest/management-bundles/#multiple-sources-of-policy-and-data, would like to understand more about the implications of using multiple bundles in one OPA configuration. Why we prefer single bundle over multiple bundles? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 6 replies
-
Hi Ronnie, using a single bundle might be operationally simpler. You have a single file to test and deploy. Using multiple bundles comes in handy if you need to version different parts of the policy and data at different rates. For example, data often changes a lot faster than policy and so you might want to have that come from a different bundle. If you're starting out I'd suggest using a single bundle to get going and then evolve from there where you see pain points. |
Beta Was this translation helpful? Give feedback.
-
There are a few reasons to why a single bundle is recommended over using multiple ones, but the main one is IMHO that multiple bundles moves potential problems from "build time" to runtime, and in almost all cases, you'll want to know about problems as early as possible. For example — if there is conflicting data between bundle1 and bundle2, OPA will reject loading bundle2, as it should — but I'd much rather know about that in my build pipeline than I would from reading logs from an OPA running in production. There are obviously other things you can do to try and prevent this, but having your policy defined in a single place, tested and deployed as a single unit... avoids a whole bunch of potential problems, and is IMHO a better developer experience. |
Beta Was this translation helpful? Give feedback.
-
In case we need to use multiple bundles for whatever reason, do you recommend using one bundle service or multiple bundle services? Are there any implications for using multiple bundle services? |
Beta Was this translation helpful? Give feedback.
-
Are you aware of any bundle server which supports long polling? S3, Azure storage & nginx? |
Beta Was this translation helpful? Give feedback.
-
Can you please help me to understand the configuration for the long polling? It only requires one setting, 'bundles[_].polling.long_polling_timeout_seconds'? |
Beta Was this translation helpful? Give feedback.
Hi Ronnie, using a single bundle might be operationally simpler. You have a single file to test and deploy.
Using multiple bundles comes in handy if you need to version different parts of the policy and data at different rates. For example, data often changes a lot faster than policy and so you might want to have that come from a different bundle.
If you're starting out I'd suggest using a single bundle to get going and then evolve from there where you see pain points.