Skip to content

Reuse cluster connection objects but only for authorized users #8

@ritesh089

Description

@ritesh089

The couchbase provider for wasmcloud now stores a connection object per link in the map.
While this prevents link's from overwriting each other's connection objects, we may result in a lot of duplicates.

We will need to find a way to prevent duplicate connection object .
A duplicate connection object is created when more than one connection object (cluster) has all the same properties:
connection-string, bucketname, scope, collection, username, password.

Proposed solution 1 :
We could maintain a hash of the above properties along with the connection object in the map .
On a new link, we fetch the connection object from the map using the source id.
If found, we compare the hash values . If they match , we dont add a new entry to the map .
If they dont match, we create a new entry in the map .
Now the Map key will need to be updated to include a suffix with the source id.
Value of the suffix is TBD.

Solution 2 :
Couchbase SDK to be updated to include the option to perform authorization at a more granular level .
Eg: at a collection level or bucket level .
This will reduce the overhead of having to fetch the cluster map on every link and still authorize again while reusing the existing clouchbase cluster object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions