Topic: Disabling Features and Upkeep

Hello everyone,

  I was wondering if anyone would like to share some thoughts, ideas, or concerns as to what are considered best practices for creating an application with features such as:

(1) Being able to disable a portion of the application without affecting everything else

(2) Administrative interfaces for being able to disable a portion of the application

(3) Is this something that would be best to implement into the application from the very beginning?

(4) What are the pros and cons to implementing such a feature


These are ideas I had jumping around in my head, but I am not too sure if this is something I should build out for those "just in case" situations.

All and any feedback, comments, ideas, or suggestions is MUCH appreciated.

Thanks in advanced!

Re: Disabling Features and Upkeep

Most likely you will just need to add a few before filters to restrict access to certain controllers/actions which you want to disable.

If you need to add an admin interface for this you can have it toggle a boolean which changes the behavior of the before_filter. I don't think it's something you need to implement at the very beginning, especially if you aren't sure if you will need it.

A few questions to ask yourself:
1. what if someone is in the process of using that porition of the site as you are disabling it?
2. what about bookmarks and old links?
3. do you really need to disable it? For example, if you are temporarily disabling a store application while you add products, try to find a way to add the products without disabling it.

Railscasts - Free Ruby on Rails Screencasts

Re: Disabling Features and Upkeep

Ryan,
 
  Those are excellent questions.  For I had the same questions coming up myself.  And I am still deciding on how to go about it.  But it almost seems like disabling a portion of the site is almost unnecessary unless something terrible has happened.  Such as a bug in the system when encountered by that specific portion of the site or something.

I had a few more concerns that follow, however...


Do you have any suggestions as to a "best practice" for deploying a rails app from my development environment (my laptop) to the production server (my webhost).

Because I've been reading this book, "Building Scalable Web Sites" by Cal Henderson.  And he mentions that having a one-step build process is a "best practice" that can automate all the required actions to deploy an app from dev to production.  Such as a web interface.

I read up on Capistrano, while the whole process makes sense, the only thing that doesn't make sense to me is where am I supposed to have Capistrano installed? On the dev or production environment?  And if it is supposed to be installed on the production environment, do I upload my rails app somewhere on my webhost temporarily while Cap deploys it for me?

Sorry for sounding like a "noob".

Last edited by xilo32 (2007-04-03 21:17:45)

Re: Disabling Features and Upkeep

Capistrano is conceptually very simple. It basically puts together a lot of different technologies and automates the deployment process. It only needs to be installed on the development side because it accesses the server remotely through ssh. Once you "apply" it to a project it will create a recipe "deploy.rb" file which is where you tell how you want capistrano to behave.

Usually, if you're having trouble with capistrano, you may be hung up on one of the other technologies Capistrano uses. Subversion is a big one. If your project is currently not under version control, this will be your biggest sumbling block. If that is the case, then I recommend taking some time and learning Subversion on its own.

Railscasts - Free Ruby on Rails Screencasts

Re: Disabling Features and Upkeep

xilo32 wrote:

But it almost seems like disabling a portion of the site is almost unnecessary unless something terrible has happened.  Such as a bug in the system when encountered by that specific portion of the site or something.

Capistrano will help you with this. You can create a "maintenance" page and give a command to capistrano to quickly turn on/off the maintenance page. You can also quickly rollback to a previuos deployment if the latest one has a big problem.

Railscasts - Free Ruby on Rails Screencasts