Custom Data Partitioning

Aug 20, 2010 at 4:59 PM

Is there currently a way to override the domain name for an entity at Query Level? I would like to partition my data but right now I don't see how I could accomplish this while still using SimpleSavant at the same time.

Coordinator
Aug 20, 2010 at 8:24 PM

If you want to partition your data with Savant you'll need to use Typeless Operations or come up with a creative filtering/decorator solution at the AmazonSimpleDB interface level.

It will take a bit of work to understand how to customize your own ItemMappings vs letting Savant do it for you from your domain class. However, this can be extremely easy if you already have existing domain classes and are only using the typeless operations because you need partitioning.

Just use the ItemMapping.Create(Type) utility method to build a default mapping from your class and then customize it by changing the DomainName to whatever domain you want for each request.

 

 

Aug 20, 2010 at 8:42 PM

Understood. Thanks! One question: Is there particular reason why you decide against strongly typed versions of the interface methods that directly or indirectly take an ItemMapping? I suspect it was because you would have to assume that the ItemMapping simply wouldnt be compatible with the type. But in my case where I only modify the domain name it would be quite convenient to have those overloads :)

Coordinator
Aug 20, 2010 at 9:30 PM

The typeless operations that accept ItemMappings were created primarily for use with tool and infrastructure code (and a few other cases) where the Type is unavailable at compile time. The fact that this allows you to do some other interesting things such as partitioning is just a nice side benefit of the design.