I am a newcomer to both Rails and Heroku but I am seriously considering utilizing it like a platform to deploy my Ruby/Rails programs.

I wish to make use of all the energy of Heroku, and so i like the "embedded" PostgreSQL handled by Heroku rather than the addon for Amazon . com RDS for MySQL, but I am not too confident with no possible ways to access my data inside a SQL client...

I understand that inside a well-crafted application you've got no have to access DB, but you will find some situations (add rows to some config table, see data not planned inside a view, update some posts for debugging issues, performance monitoring, running queries for confirming, etc.) when this is often good...

How can you solve this issue? What's you have inside a real existence application powered by Heroku?


I've been utilizing it for any in regards to a year. I really like the workflow it provides however i find not getting use of the information is indeed a bother. Your choices for dealing with database are:

Taps: Theoretically you make your database nevertheless, you want in your area and employ taps copying both schema and data to Heroku. Used, more often than not its amazingly great. However am presently coping with the cleanup after taps converted a number of my posts poorly and corrupted my data.

Heroku console: Totally fine for the usual ActiveRecord stuff, but nearest you will get towards the database is ActiveRecord::Base.connection.execute "some sql". If you find yourself curious about doing alter table instructions like that you'll know you are in danger.

Additionally they give a "bundle" like a way of copying your application. This allows you download all of your code along with a sql dump from the database. The problem is the fact that since there's no direct database access there's not a way of loading that same sql dump into the database to help you get over dataloss, which, in my experience, is the purpose of getting individuals dump files to start with. All you are able make use of the bundle for is to produce a new application (heroku bundles:animate), not restore a present application.

I would like to be wrong about any/many of these. This appears just like a curious rough place within the best considered service which i are conscious of. Database access normally does not seem like much to stop when the majority of that which you do is created very easy.

In my experience database access is sort of a fire extinguisher. Not often a large deal, however when it matters, it matters a great deal.

I personally use admin_data to provide me some insight regarding what's going on. I have effectively tried on the extender on Heroku, along with other hosting companies.

First of all allow me to begin by stating that heroku rocks !. I have were built with a great experience implementing my application and integrating using their other services for example websolr.

With nevertheless, the questions you have:

Bothering your computer data

If you wish to have the ability to reach your computer data you should use taps to drag your remote database lower in your area. This is often helpful for debugging.

Performance monitoring

Use new relic Revoltions per minute. This comes included in heroku, you are able to enable it in the add-ons menu.

Add-hoc database queries

You can write a controller which enables you to definitely execute arbitrary sql and examine the outcomes, but this is not something I'd recommend. As suggest admin_data is a great solution for controlling your computer data, but when for you to do something more complicated you will need to turn to writing the code yourself.