Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aws app with Heroku Postgres database

Is it possible to have an app running at aws EC2 and have it's database running at heroku's postgres?
In case it is, what are the downsides I should consider?
Since heroku is hosted at AWS, is there a way to know where is the location of the machine running my database?
Hosting my app in the same region of the database would help to keep the performance?
I would like to hear some opinions about this, I've been searching the topic without much success.

like image 717
Filipe Avatar asked Nov 11 '12 20:11

Filipe


2 Answers

You can determine the public-facing location of your Heroku DB at any given time with a traceroute ... but there's no guarantee that it'll stay at that location, or that there isn't any internal re-routing going on. You'd probably want to speak directly with Heroku support about ways to make sure your Heroku DB instances are local to your AWS application instances, as that certainly would benefit performance. See if you can find out which availability zone, or at least which major region, they run the DB in, and whether you can "pin" your database instance to a given region/zone.

Amazon's RDS looks OK, but doesn't support PostgreSQL. Please keep nagging them to.

I'd probably just run the DB on AWS if performance wasn't particularly important. Use a raid10 of provisioned IOPS EBS volumes on an EBS-optimized instance and you'll get kind-of-ok performance (but at a really big price); alternately, you can use non-crash-safe ssd-based instance store servers and rely on replication and backups to keep your data safe.

like image 78
Craig Ringer Avatar answered Oct 18 '22 04:10

Craig Ringer


I dont have any experience on Heroku PostgreSQL. Generally of course you can run your own service on Amazon EC2 and use the managed database services of Heroku.

Downsides might be

  • nobody guarantees, that Herouku exclusively uses AWS and you probably can't determine the physical Heroku service location within the cloud so you will have to deal with network latencies
  • in addition to your external traffic fees you'll have to pay for the database traffic unless you talk to a server in the same availability zone in the same region

My suggestion ( without knowing any detail about the pros of Heroku )

Have a look at Amazon RDS if you don't want to run a database server on our own.

http://aws.amazon.com/de/rds/

I am operating around 70 server instances on AWS, both RDS and EC2 for more than a year now and I can't imagine any simpler way to keep your stuff running

like image 22
Michel Feldheim Avatar answered Oct 18 '22 02:10

Michel Feldheim