Environment specific domain name?

Apr 7, 2010 at 10:47 PM

I'd like to store data from multiple environments in their own domains (Dev, QA, Prod, etc.), but it seems like objects of a given type can be directed to a single domain only.

One workaround is to use the typeless operations which seems awkward considering the only thing I would need to override is the domain name. Another would be to add the environment name as an attribute and put everything in a single domain which would add complexity to querying operations.

Is there a third option that would be more elegant?



Apr 8, 2010 at 12:06 AM

Most folks (me included) seem to handle this by creating different SimpleDb accounts for their different environments. This doesn't cost anything since you will rarely exceed the Amazon free-tier for non-production environments and it gives you more options for managing the data and access credentials for each environment. For example, I will often drop all the domains from my dev environment for a fresh start.

Also keep in mind that querying will still be more complex if you use a dynamic domain name (vs an environment attribute) because the domain name needs to be referenced in all your select queries.

If you build different versions of your code for different environments you could use preprocessor directives to customize the domain name when compiling for each environment. I can't offer you anything more elegant than that right now!


Apr 8, 2010 at 1:47 AM
multiple accounts :smacks forehead: -- of course that's the way to go. Thanks.