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

[Multitenant] Memory multitenancy implem (bucket per tenant) #5283

Open
vttranlina opened this issue Sep 19, 2024 · 3 comments
Open

[Multitenant] Memory multitenancy implem (bucket per tenant) #5283

vttranlina opened this issue Sep 19, 2024 · 3 comments

Comments

@vttranlina
Copy link
Member

Epic: #5263

How

Create a new class: MemoryMultiTenancyByBucketBlobStoreDAO implements BlobStoreDAO

We will decorate the BucketName based on the Bucket object
The code would look like this:

public BucketName decoratedBucketname(Bucket bucket) {
    return bucket.tenant()
        .map(tenant -> bucket.bucketName().asString() +"-" + tenant.asString())
        .map(BucketName::of)
        .orElse(bucket.bucketName());
}

Then, the method implementation will be:

@Override
public InputStream read(Bucket bucket, BlobId blobId) {
    BucketName decoratedBucketName = decoratedBucketname(bucket);
    return memoryBlobStoreDAO.read(decoratedBucketName, blobId);
}

Dod

  • Write unit tests for MemoryMultiTenancyByBucketBlobStoreDAO:
    • implements BlobStoreDAOContract
    • add new test cases specifically for multitenancy by bucket functionality.
@Arsnael
Copy link
Member

Arsnael commented Sep 26, 2024

Should refactor MemoryBlobStoreDAO and not create an other DAO for this

@Arsnael
Copy link
Member

Arsnael commented Sep 26, 2024

Memory always using multitenancy for different domains? Or need some conf to denable/disable it?

Should have a special contract test for multitenancy

@Arsnael Arsnael removed the grooming label Oct 30, 2024
@vttranlina vttranlina self-assigned this Nov 4, 2024
@vttranlina
Copy link
Member Author

this ticket requires

I will move it to the to-do list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants