Skip to content

Commit

Permalink
chore: update readmes (#29)
Browse files Browse the repository at this point in the history
* chore: update readmes

* chore: Update README.md

Co-authored-by: George <[email protected]>

---------

Co-authored-by: George <[email protected]>
  • Loading branch information
markphelps and GeorgeMac authored Dec 12, 2023
1 parent 962a0e2 commit be59100
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 5 deletions.
Binary file added .github/images/performance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Architecture

The `flipt-engine` is a Rust library responsible for evaluating context and returning the results of the evaluation. The client engine polls for evaluation state from the Flipt server and uses this state to determine the results of the evaluation. The client engine is designed to be embedded in the native language client SDKs. The native language client SDKs will send context to the client engine via [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) and receive the results of the evaluation from engine.
The [flipt-engine](./flipt-engine/) is a Rust library responsible for evaluating context and returning the results of the evaluation.

This design allows for the client evaluation logic to be written once in a memory safe language and embedded in the native language client SDKs. This design also allows for the client engine to be updated independently of the native language client SDKs.
The client engine polls for evaluation state from the Flipt server and uses this state to determine the results of the evaluation. The client engine is designed to be embedded in the native language client SDKs. The native language client SDKs will send context to the client engine via [FFI](https://en.wikipedia.org/wiki/Foreign_function_interface) and receive the results of the evaluation from engine.

This design allows for the client evaluation logic to be written once in a memory safe language (Rust) and embedded in the native language client SDKs.

You can refer to the architecture diagram below:

Expand Down
31 changes: 31 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Contributing

## Issues

Let us know how we can help!

* Use a **clear and descriptive title** for the issue to identify the problem.
* Describe the **exact steps** which reproduce the problem in as many details as possible.
* Include the language client you are using and the version.
* Include any **stack traces** with your error
* List versions you are using: Flipt, OS, etc.

## Code

It's always best to open a dialogue before investing a lot of time into a fix or new functionality.

Functionality must meet the design goals and vision for the project to be accepted; we would be happy to discuss how your idea can best fit into the future of Flipt.

Join our [Discord](https://www.flipt.io/discord) to chat with the team about any feature ideas or open a [Discussion](https://github.com/flipt-io/flipt/discussions) here on GitHub.

### Conventional Commits

We use [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages. Please adhere to this specification when contributing.

## Legal

By submitting a Pull Request, you disavow any rights or claims to any changes submitted to this project and assign the copyright of those changes to Flipt Software Inc.

If you cannot or do not want to reassign those rights (your employment contract for your employer may not allow this), you should not submit a PR. Open an issue and someone else can do the work.

This is a legal way of saying "If you submit a PR to us, that code becomes ours". 99.9% of the time that's what you intend anyways; we hope it doesn't scare you away from contributing.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Flipt Software Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Client SDKs
# Flipt Client SDKs

![Status: Experimental](https://img.shields.io/badge/status-experimental-yellow)

This repository centralizes the client-side SDKs for [Flipt](https://github.com/flipt-io/flipt).

These client-side SDKs are responsible for evaluating context and returning the results of the evaluation. They enable developers to easily integrate Flipt into their applications without relying on server-side SDKs.
These client-side SDKs are responsible for evaluating context and returning the results of the evaluation. They enable developers to easily integrate Flipt into their applications without relying on server-side evaluation.

> [!NOTE] These SDKs are currently experimental. We are looking for feedback on the design and implementation. Please open an issue if you have any feedback or questions.
## Architecture

Expand All @@ -18,7 +20,47 @@ See [ARCHITECTURE.md](./ARCHITECTURE.md).

We are constantly growing our list of clients. Currently, we support the following languages:

1. [Golang](./flipt-client-go)
1. [Go](./flipt-client-go)
1. [Python](./flipt-client-python)
1. [Ruby](./flipt-client-ruby)
1. [TypeScript](./flipt-client-node)

Languages we are planning to support:

1. Java
1. Rust
1. C#
1. PHP

## Installation

See each client's README for installation instructions.

Currently, you'll need to build the dynamic library and the library locally and install it for your architecture. This is a temporary solution until we package and distribute the libraries using their respective package managers.

## Use Cases

Why you may prefer to use a client-side SDK over our server-side SDKs:

1. You want extreme low-latency evaluation and high throughput.
1. You are ok with eventual consistency and can tolerate stale data for a short period of time.
1. You want to reduce the load in your network by not having each client make a request to the Flipt server for each evaluation.
1. You need evaluation to take place in process for some reason (e.g. you are evaluating a flag in a web worker).

## Performance

We have done some simple benchmarking to test the performance of the client SDKs vs the server SDKs with Flipt running locally.

![Performance Benchmarks](.github/images/performance.png)

Here we performed 1000 evaluations of a flag using the client SDKs and the server SDKs. The client SDKs were able to perform the evaluations in a fraction of the time it took the server SDKs. This is because the client SDKs are able to perform the evaluations in-memory without having to make a request to the Flipt server.

While the server SDKs performed evaluations in the range of 0-14ms, the client SDKs performed evaluations in the range of 0-0.1ms (100 microseconds).

## Contributing

See [CONTRIBUTING.md](./CONTRIBUTING.md).

## License

All code in this repository is licensed under the MIT License. See [LICENSE](./LICENSE).
2 changes: 2 additions & 0 deletions flipt-client-go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,13 @@ func main() {
if err != nil {
log.Fatal(err)
}
defer evaluationClient.Close()
variantResult, err := evaluationClient.EvaluateVariant(context.Background(), "flag1", "someentity", map[string]string{
"fizz": "buzz",
})
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit be59100

Please sign in to comment.