I'm currently migrating a Windows Azure application to Amazon AWS. In Windows Azure we used Lokad.Clout to get strongly typed access to Azure Blob Storage. For instance like this:
foreach(var name in storage.List(CustomerBlobName.Prefix(country))
{
var customer = storage.GetBlob(name); // strong type, no cast!
// do something with 'customer', snipped
}
For more detailed examples see their wiki.
In the AWS SDK for .NET you don't get strongly typed access. For instance in order to achive the above you have to execute ListBojects and then parse the key of every object in order to find the each individual property of the key (we often use keys consisting of several properties).
Is there any S3-equivalent to Lokad.Cloud for Azure?
UPDATE: Due to the size of the objects we cannot use SimpleDB (with Simple Savant).
Use encryption to protect your data If your use case requires encryption for data at rest, Amazon S3 offers server-side encryption (SSE). The SSE options include SSE-S3, SSE-KMS, or SSE-C. You can specify the SSE parameters when you write objects to the bucket.
Grant public read access in one of these ways: Update the object's access control list (ACL) using the Amazon S3 console. Update the object's ACL using the AWS Command Line Interface (AWS CLI) Use a bucket policy that grants public read access to a specific object tag.
Instead of using S3 for this, I think you want to use Amazon SimpleDB. It allows you to store data in key-value pair format, and also run queries on the data.
Then, to do what you're looking for, I think what you want is Simple Savant.
Simple Savant is a .NET object-persistence framework for Amazon SimpleDB written in C#.
With Simple Savant, you can save objects like this:
var savant = new SimpleSavant(AwsAccessKeyId, AwsSecretAccessKey);
var customer = new Customer
{Name = "Frank Berry", PhoneNumbers = new List<string> {"770-555-1234", "678-555-5678"} };
savant.Put(customer);
And you can retrieving objects like this:
var frankId = new Guid("50a60862-09a2-450a-8b7d-5d585662990b");
Person frank = savant.Get<Person>(frankId); // strong type, no cast!
Hope this helps!
This is not something that S3 was optimised for.
You should use S3 to store your blobs and a database (SimpleDB, Sql Server etc) to 'index' your S3 storage. Use the database to find what you are looking for, get the object from S3, make changes, then save it back.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With