Replies: 1 comment
-
Hi @keitherw
We very - very - strongly recommended to use the client, especially if you are using client credentials. It will handle the connections for you as well as caching the token and refreshing it when needed. If you were to generate a new client, you would incur the latency (an performance) cost of:
If for some reason you cannot share the SDK Client, we recommend you do the token handling refresh externally, and pass the API Token to the SDK. Also, some SDKs let you pass in the underlying HTTP library so that you can share the connection pool across multiple SDK initializations.
Have you taken a look at: https://openfga.dev/docs/getting-started/running-in-production#database-recommendations ?
Take a look at: https://openfga.dev/docs/interacting/relationship-queries#caveats |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Is it better to save the client that was created via the client.NewSdkClient for subsequent operations or is it better to simple obtain a new client for each request.
Also, we've noticed during stress tests (8.1.4 version) that openFGA was having issues with running out of Postgres connections, is there a known issue concerning that?
And periodically, the listObjects would fail (logs didn't seem to match the postgres issues) so I was wondering if there is a time limit for the client that we obtain?
Beta Was this translation helpful? Give feedback.
All reactions