Best way to share connection

I’m pretty new with couchbase, I would like to ask you something about sharing the connection around the application…for now I created an object on the application start with the connection and I pass this object where I need it…I’m not sure if this is the right way to share the connection…is better to attach the connection to the request object?

many thanks

The exact answer will depend a bit on what platform you’re writing to, but this is documented for each of the official SDKs. Select which one you’re using from the pulldown in the upper right from the documentation.