-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pluggable Storage Adapters #57
Comments
Hello @aaguiarz , You identified quite a few solutions to support modularity in openFGA to modularize Datastore adapters (and, as you mentioned, each of them has some drawbacks).
This solution might be suitable, but it will raise a few questions about code ownership boundaries (what code belongs to what repository), which I will develop further.
As mentioned in the provided link above, the warning list of the documentation is not attractive. (see: https://pkg.go.dev/plugin#hdr-Warnings)
As performance is a strong requirement for many organizations, adding additional latency might be a strong blocker for a lot of actors in the industry, as they expect permission checks to be fast. (especially in micro-service-oriented architecture, where authorization checks can be performed at different levels) When you mentioned this roadmap issue on Slack, I came back to my review (to support MSSQL), and tried to understand what needs to be externalized to be modular enough. migration filesIn term of ownership, I feel that each adapter should own their own migration files. That said, the current implementation expects migration files to be locally available next to the openfga binary (in the For this reason, the migration logic needs to be adjusted to consider that migration files would not be part of openFGA core anymore. (NOTE: maybe this can also be leveraged at the build/release time). connection string parsing logicThe connection string logic is kind of duplicated between the migration ( Since the parsing of the query differ from an adapter to another, I think this logic should be part of a dedicated go file (owned by the adapter owner). testing logic (related to the adapter)The testing logic at the adapter level, would be owned by the organization maintaining the connector. the datastore engine's codeThe datastore adapter could be declared in remote repository (equivalent of testing logic (related to openFGA, high level test / benchmarks)Many high-level tests start: (1) an openFGA instance (2) a test container. Then, execute some queries against this instance. Currently, those tests evaluate that openFGA still works against all supported datastore adapters. I think that those tests should still exist and be maintained within openFGA core repository, since they would allow to detect any regression in supported adapters. Makefile (
|
@jamar-criteo I'm hacking on this issue this week if you're interested in joining up. I'd be happy to hop on a call with you and walk over my thoughts. Feel free to schedule something on my calendar. Regarding migrations - @jpadilla opened a PR that we can and should revisit for managing migrations per storage implementation in the same defining package that implements the storage interface. I think that's the right approach for managing migrations. Anyways, hacking at this will reveal some good tidbits, so I'm happy to pair up and learn by doing. |
Storage adapters that are contributed by the community currently become part of the OpenFGA repository + binary, and maintaining them becomes responsibility of the core OpenFGA team.
In order to support more database adapters while reducing the impact of supporting them for the OpenFGA team we can explore different options:
Keeping each adapter in its own repository, and bundling them in the binary. We can define clear ownership for each repository and warn the community about the level of support of each adapter. It could happen that a newer version of OpenFGA does not support a specific database adapter if the interface changed and the adapter was not updated.
Use Go Plugins as a way to load storage adapters, so they are maintained in their own repository and not bundled with the binary. This approach has several drawbacks, discussed in the Go Plugins documentation linked above.
Make OpenFGA communicate with storage adapters using gRPC. This adds complexity + performance overhead.
In any case, we'd need to improve our test suite to make sure storage adapters are conformant with the OpenFGA required behavior, so they are easier to contribute and maintain.
The text was updated successfully, but these errors were encountered: