-
Notifications
You must be signed in to change notification settings - Fork 1
Discovery Modes
What is this DiscoveryMode
enum about?
Blobmetadb uses a vast number of hints from HTTP requests and responses to Azure Blob Storage service. Based on each hint it gets, it may make requests to the local metadata storage (e.g. Redis).
However, you may not need to interpret all requests. Basically, handling only the following Storage Client methods is sufficient to track all blobs and containers:
- CloudBlobContainer.Create/.CreateIfNotExists
- CloudBlobContainer.Delete/.DeleteIfExists
- ICloudBlob.UploadFromFile/.UploadFromString/… other upload helpers
Did you notice all these are "write" operations on the cloud? As long as you use operationContext
to track all operations on these operations, your local metadata storage will be in sync with the cloud.
This is called DiscoveryMode.OnlyWrites
and this is the common case for many people. This will just use write requests made to the cloud and optimize writes to your local metadata store.
But however, let's say you think you may be missing and you will force "best effort" on blob discovery.
We know that DiscoveryMode.OnlyWrites
will only use write requests. But may discover more blobs and containers with some "read operations" e.g. Get Blob Properties, List Containers.
To enable that, you can use DiscoveryMode.AllRequests
. However this one will not check your metadata store if a container exists when a blob is found. To enforce policy "when a blob first make sure its container exists", use DiscoveryMode.AllRequestsEnsureSchema
.