Rails environment best practices

I have heard from friends that they use different Rails environments for different purposes like:

  • Production
  • Staging
  • Development
  • Test
  • Beta
  • SIT (System Integration Testing )
  • UAT (User Acceptance Testing)
  • Sandbox

I don’t know If I’m too conservative but I would say everything can be funnel into the default environments Production, Staging, Development.

Like the beta environment … if this is a beta test … I guess we want to test the real thing and we could use Staging or even Production envs.

What do you guys think? Is there any list of best practices for Rails environments?

Thanks.

I prefer to have only the standard set – development, test, production.

The other environments are usually slight variations on production, so this can be managed via configuration, e.g. with environment variables or feature toggles. Adding additional Rails environments can lead to complexity and confusion.

2 Likes

Totally agree with all that @andyw8 shared. As a data point, we recently removed the Staging environment from suspenders (you can see the conversation around this decision in this PR). Dev & Test are sufficiently different, but we prefer to have all other environments run as closely as possible to production, using ENV vars to tweak the specific details for a given instance.

1 Like

Awesome!

I agree, it’s a good idea to have all the environments as closely as Production. Also I didn’t know you guys removed the Staging environment from suspenders.

Thanks a lot for the quick responses and the links! @andyw8 & @christoomey