linagora / james-project

Mirror of Apache James Project
Apache License 2.0
72 stars 62 forks source link

[Multitenant] S3 multitenancy: prefix #5274

Open Arsnael opened 2 months ago

Arsnael commented 2 months ago

Implement the prefix implementation for S3 blobstore multitenancy.

Within BlobStoreDAO, when using the prefix mode, derive the object key within S3 adding the prefix as needed.

For example: tenant/abc

Note: This interact with the GC!!! We shall make sure the GC, when listing, only takes the last part of the s3Key IE given prefix/ABC the GC only uses ABC as a blobID.

DoD: Integration tests

vttranlina commented 2 months ago

Note: This interact with the GC!!! We shall make sure the GC, when listing, only takes the last part of the s3Key IE given prefix/ABC the GC only uses ABC as a blobID.

If I understand correctly:

Is this correct?

quantranhong1999 commented 2 months ago

During blobStoreDAO.save, when input is Bucket(bucketName = "bucket1", Optional = "tenant1"), BlobId("abc") , the data will be saved in S3 as: bucket = bucket1 and object = "tenant1/abc". When calling the BloomFilterGCAlgorithm#gc method, the blobStoreDAO.listBlobs("bucket1") will return BlobId("tenant1/abc").

BlobId("abc") and BlobId("tenant1/abc") points to the same blob?