Skip to content
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

feat: ofep for flagd grpc sync #45

Merged
merged 14 commits into from
Feb 3, 2023
43 changes: 43 additions & 0 deletions OFEP-flagd-grpc-sync.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## OFEP: Add gRPC sync support to flagd

## State: APPROVED
beeme1mr marked this conversation as resolved.
Show resolved Hide resolved

This OFEP proposes to introduce gRPC syncs to flagd. gRPC sync will act similar to existing remote HTTP URL syncs. But
going beyond periodic pulls, flagd can utilize gRPC server streaming to receive near real-time updates, pushed from a
flag management system.

## Background

gRPC server streaming allows clients to listen and react to server-pushed data. For flagd, this perfectly matches the
ISync interface and current sync mechanism implementations.

The gRPC schema will be defined by flagd and supporting flag management system(s) will then implement the contract.

<img src="images/ofep-fd-grpc-1.png" width="300">

Further, grpc server push can be expanded to have `event types` such as flag additions, updates and deletions, giving more
performant connectivity between flagd and flag management system. Performance improvements come from reduced payload
size(single flag change vs all flags) and not having connection establishment overhead thanks to streaming.

Note that the implementation complexity of `event types` lives at grpc server implementation. The implementation may use
a state management system to derive the matching event type for a specific flag configuration change. In any case,
flagd must not maintain any state (i.e- flagd must be stateless) and only react on the sync type to update flag
configurations.

<img src="images/ofep-fd-grpc-2.png" width="300">

### Tasks

Following are the main tasks I am proposing for the implementation.

- [x] POC implementation - https://github.com/open-feature/flagd/pull/297
- [ ] OFEP approval
- [ ] Introduce basic grpc sync, with minimal configuration options
- [ ] Introduce additional options, such as TLS certificates, token authentication on top of existing solution

#### SSL certificates and token authentication

Consider the GRPC authentication example provided through official Go guide - [Link](https://github.com/grpc/grpc-go/tree/master/examples/features/authentication)

With a similar approach, it is possible to establish TLS connections and enable token based authentication/authorization
between flagd and flag management system.
Binary file added images/ofep-fd-grpc-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/ofep-fd-grpc-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.