I want to distribute a sharded/replicated MongoDB setup across multiple of Amazon\'s EC2 regions. Is this traffic already encrypted by MongoDB or can I optionally set this up? O
According to [mongo docs] it's possible for mongo to use SSL. One would either have to compile mongo with --ssl flag or use commercial edition. With SSL-enabled mongo all communication between the DB and client, as well as communication between replica sets and arbiter is secured (see faq).
Has anyone actually tried this approach? Are there any drawbacks?
I answered a similar question yesterday about Apache Cassandra: Securing Cassandra communication with TLS/SSL.
My experience has been, specifically with Amazon, if you can, set up a VPN network between your instances to guarantee that everything is secure. An interesting fact we came across when implementing our VPN network on top of EC2 is that it made response times faster ... We opted for Vyatta and have been very happy with it so far. It can be fully virtualized ... and allows us to bridge between zones, regions and data centres (amazon and not amazon)
Another option is to leverage Amazon Virtual Private Cloud:
Vyatta has a nice graphic showing how VPC and Vyatta (or any other corporate VPN solution) can bridge together (as per the last point above):
http://www.vyatta.com/sites/vyatta.com/files/images/Vyatta_Amazon.png
http://www.vyatta.com/solutions/amazon
I don't work for Vyatta ... just like how well we've managed to get everything working without purchasing mega expensive cisco gear
If you're not running on EC2, these solutions aren't really an option. There is another way and that is to set up your own IaaS provider independent VPC. vCider has a solution for this that works well with Mongo as well as Cassandra. For Cassandra securing client/DB traffic is especially painful since there is no native encryption.
Good example of how this all works here:
http://www.vcider.com/vpc-deployments/secure-saas
As far as Cassandra goes, some benchmark info here.
http://blog.vcider.com/2011/09/virtual-networks-can-run-cassandra-up-to-60-faster/
With native encryption in the kernel you can run much faster.
Mongo communication across replicas is not encrypted. So you are on your on. You can create Replica's across availability zones in a region
You're on your own with encrypting data transfered between EC2 regions. Amazon does not guarantee them to be connected with private channels so you have to assume they are going over the public networks.