Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating a blog/CMS into a Heroku Rails app

I've been looking around at various options to integrate a blog into my Rails app hosted on Heroku. Nesta looks promising, but since it manages blog posts directly in Git I'd have a couple of minutes downtime each time I published a post (due to Heroku's slug compilation). It appears that I was mistaken on this point.

Are there any options that meet all of the following requirements?

  1. Is compatible with Heroku's read-only file system.
  2. Can be integrated into an existing Rails 3 app.
  3. Has a web interface so I don't end up recompiling every time I publish a post.
like image 246
Joshua Clanton Avatar asked Jul 17 '11 22:07

Joshua Clanton


2 Answers

I use Jekyll, Rack and Heroku to power my blog. It has worked quite well for me.

http://nerian.es/2011/07/13/new-website.html

You can take a look at the code here:

https://github.com/Nerian/nerian.github.com

I will say that there is no downtime when you update a slug in Heroku. The app is not restarted until the whole process is completed. And then is just seconds before being ready.

You can try that. Push a new release to your heroku slug and open many browser tabs to your blog. You will notice that the down time is nearly 0.

Another option is to use a service oriented design to this problem. Instead of integrating a blog engine inside your current rails app build an isolated blog app. So that your architecture looks like this:

  • www.yourapp.com -> Served by your current Rails app.
  • blog.yourapp.com -> Served by Jekyll or Sinatra in a different Heroku deployment.

That way when you update your blog your whole site can keep running. You won't lose a single second of vital services' activity.

Edit:

Instead of subdomains, if you want to use an endpoint inside your current domain you can match /blog to a rack application serving your blog.

http://edgeguides.rubyonrails.org/routing.html#routing-to-rack-applications

like image 188
Nerian Avatar answered Nov 17 '22 06:11

Nerian


Try Refinery CMS, which runs as an engine inside your Rails app:

http://refinerycms.com/

like image 2
Dominic Avatar answered Nov 17 '22 05:11

Dominic