Heroku Postgres: SQL Database-as-a-Service
postgres.heroku.com
postgres.heroku.com
The difference between a local DB with <2 ms latency to a remote DB with ~50 ms latency is huge. I've seen application start times go from 1-2 minutes to 20-30 minutes by pointing at a remote DB.
So if your app is even somewhat DB intensive, you really need <2 ms latency to your DB, and if it's not DB intensive, you probably don't need all the scaling and other infrastructure strengths these services bring to the table.
I'd guess that the major target of this would be applications already running on AWS (which would put them mostly in the same datacenter). Obviously, a bunch of caveats about availability zones, etc.
This is one of the problem with joinless NoSQL databases, as well, since you HAVE to roundtrip to join.
But you're not actually joining any data. You return one document, and then exploit the properties of sorting to return the related document(s) next in the collection. In SQL-speak, each relation comes as a distinct row and are only connected by the order in which the rows are returned. There is a writeup on the specifics here, if you are curious: http://wiki.apache.org/couchdb/View_collation
It is a pretty clever trick that can save you a round trip to the DB, but doesn't have nearly the power that a real join does.
For example:
select i.* , array_agg(ROW(l.*)::text)
from invoice i
join invoice_line l ON i.id = l.invoice_id
where i.id = 1023;
This returns a single row for invoice, along with an array of tuples representation of all invoice lines. You could also use casts and stored procedure languages to convert to xml or whatever if you want.
[1] http://aws.amazon.com/ec2/faqs/#How_can_I_make_sure_that_I_a...
This is, naturally, very application-dependent.
To be perfectly honest, I'd consider any database server where I couldn't do this to be something of a toy because of the restrictions it places on overall app performance. It might be OK in SQLite or Access but a real database? Sorry, no, come back when you've finished the thing please.
Now, I'd still rather have a local database but if you do that properly then almost all pages in your typical webapp shouldn't require more than a single round trip. IMHO.
If you need things like dynamic cloud scaling, read only slave replication, etc... chances are you're doing a lot of DB transactions as well, and that latency can and will kill you.
As a counter-example, LedgerSMB is very databse-intensive but we do what we can to make sure round-trips are minimized. This means making sure that everything that needs to be queried together is queried together, in the same query.
I suppose if you are doing a lot with ORMs and the like though that may not be an option.
Now, I'm sure there's all sorts of other things in apps beyond my experience where you're better off doing multiple calls to the database, but certainly nothing you've outlined in those two couldn't be handled by a decent database infrastructure in a single call returning (potentially) multiple results sets.
One thing I learnt many years ago in data intensive apps. Communications latency between your app and your database will kill performance if you let it. Shipping data back and forth repeatedly will hang, draw and quarter it. Absolutely, aggressively, pare the number of external calls you have to make to the bone and you'll see a very significant performance boost.
Soon to be released: https://www.cloudpostgres.com/
Lower prices
PostgreSQL 9.1
Optional PGPool in front of the replicas for load balancing
Multiple datacenters
It's still incredibly affordable, but not for what I had in mind. I wish they had lower levels so I could play.
There's probably some complexity in getting shared cheaper DBs available that we don't know about.
EDIT: also, I'm not sure if this is generally known elsewhere, but might they not be on ec2, they are advertising 1.7 GB cache, which is the same as a small instance, except without any room for the operating system or postgres itself.
As an experienced techie but a PG novice, what do I need to go learn about PG recovery procedures to safely use this?
Any recent dedicated server with 16 spindles will completely annihilate EBS in terms of IOPS. And that's with plain old spinning rust - add some SSDs and EBS ain't even in the same ballpark anymore.
I have a use case for a low volume app that I would like to host on Heroku, but have other software also have access to the database, without resorting to the obvious workarounds.
I believe Heroku used EC2 under the hood before the Salesforce acquisition.
Whether postgres (vs MySQL), the polish and better ui/workflow of heroku is worth the premium over RDS depends on you.
I'm not sure if these postgres servers are. However one interesting note is that the "maximum database size" of the heroku server is 2TB, while RDS is 1TB.
I'd be curious to know how reliable it is in practice, compared to a home-grown EC2 setup.
Of course, the real competition is other data-storage services like Amazon RDS, MongoHQ, MongoLab, etc. (all much cheaper)
(OK, so I excluded EBS costs from my EC2 comparison above but at $0.10/GB-month it's still going to be a huge difference for most cases)
It's more like 162 bucks a month for a comparable reserved EC2 instance. And 208 a month for a comparable reserved RDS instance. And that's of course with a 12 month commitment.
You can't really compare EC2 to an offering like this because you're paying for the amount of time / labor costs it frees up. And of course RDS doesn't support Postgres so there's not a lot of competition at the moment.
$200 per month for a database server is ridiculously cheap for a large company.
- fork of databases (looks great to try out migrations easily)
- read-only asynchronous replicas
- connection from EC2 or elsewhere
- health checks and "continuous protection"
Looks fairly solid at first sight.
what competes with this?
http://xeround.com is a separate DB service, also heroku plugin. It is MySql-compatible, apparently they've wrote a custom distributed engine. Its is located on AWS or rackspace, so latency is quite low.Since xeround is pay-as-you go, if your initial DB requirements are low, you can run it on something like http://fluxflex.com (which heroku-like PaaS, also AWS-based) and have 10 db-backed apps for something like $3 per month that will scale up when needed.
Does a cloud database service make sense? Maybe. Databases have gotten easier and easier to setup. In addition they are quite optimized in terms of processing power. I'm not sure I want to give up control my database just yet.
I've seen some Database-as-a-service projects and all of them chooses PostgreSQL.
MySQL is very popular on the web site, but as a database serving multiple applications from the same db, PostgreSQL has been the de facto choice in the open source world since I have been working with db's (at least the last 12 years).