0

I am a little new to cloud hosting. For the smallish projects I have done so far, I am used to having one sandbox/testing server and one production server, and that's it. Now I'm developing something that will likely come under a lot more strain, and I'd like to give Amazon's Elastic Beanstalk a try.

I have so far been developing a PHP application on an Ubuntu machine. Amazon's Elastic Beanstalk's AMIs, however, are all "Amazon Linux." Can I continue to develop on my Ubuntu machine, or should I switch to Amazon Linux for my testing environment as well?

voretaq7
  • 79,879
  • 17
  • 130
  • 214
Jake
  • 103
  • 1
  • 1
    You want your test environment to mirror as closely as possible the production environment, so there aren't surprises when your code runs on a different infrastructure. – ceejayoz Feb 25 '13 at 23:11

1 Answers1

2

You're asking two different questions.

Does my dev server need to be exactly like my production server?

No.
You can do your development on whatever you want, and then deploy that code to whatever production environment you'd like.


Should my dev server be exactly like my production server?

Yes. - It makes life much easer.

If your development and production environments are different you will eventually have the "It works on my machine" developer moment, where some developer (maybe even you) writes (and hopefully extensively tests) some code on the development machine, then deploys it into production and it breaks horribly (missing/mismatched library versions, a different interpreter, package differences between the two systems, binaries not where the app expects them to be, etc.).

This means you'll spend hours (maybe days) re-writing parts of your code to deal with the fact that production isn't like the machine you developed on. Then one day you'll be in a release crunch and hacks start slipping in - if (is_production) { A } else { B } - and someone later will see that and think it's acceptable.

Your code quickly spirals into an unmaintainable mess, and your only option is Seppuku.


Bottom line?

Spare yourself the pain, suffering, and ritual disemboweling and try to develop and test on the same platform you're eventually going to deploy to.

voretaq7
  • 79,879
  • 17
  • 130
  • 214