5

I am in the midst of setting up the development environment (PHP/MySQL) for my start-up. We use three sets of servers:

LIVE - the servers which provide the actual application TEST - providing a testing version before it is actually released DEV - the development servers

The development servers run SVN with each developer checking out their local copy. At the end of each day completed fixes are checked in and then we use Hudson to automate our build process and then transfer it over to TEST. We then check the application still functions correctly using a tester and then if everything is fine move it to LIVE. I am happy with this process but I do have two questions:

  • How would you recommend we do local testing - as each developer adds new pages or changes functionality I want them to be able to test what they are doing. Would you just setup local Apache and a local database and have them test locally on their own machine?

  • How would you recommend dealing with data layer changes?

  • Is there anything else you would recommend doing to really make our development process as easy and efficient as possible?

Thanks in advance

christophmccann
  • 4,043
  • 7
  • 39
  • 63

2 Answers2

3

+1 to each developer running her own setup, complete with Apache and database.

Keep the database schema under version control.

Possibly you could keep (maybe in a separate repository) a small but representative set of data, in a test database. Each morning you check out the latest copy of this test database, and start hacking. When you change schemas, update your test data repository accordingly.

Frank Shearar
  • 16,631
  • 8
  • 63
  • 90
  • How do you keep the database schema in version control? Sounds like a really good idea - I have just not seen it done before. – christophmccann Mar 08 '10 at 11:33
  • i wrote an article about it : http://www.gsdesign.ro/blog/mysql-database-versioning-strategy/ and you could read more here also: http://stackoverflow.com/questions/1607/mechanisms-for-tracking-db-schema-changes – Gabriel Solomon Mar 08 '10 at 11:41
0

Anyone doing development SHOULD have their own local environment. I use Mac so I run MAMP so that I can have my own LAMP environment local and independent of any other environment. This will also allow me to know that nobody else is changing / working on the same components I am and removes any possible confusion. If you are a windows user, there are also easy to install local versions of the LAMP stack such as XAMP, etc. If you are running Linux as your desktop, you will most likely already know how to install LAMP for the flavor of Linux you are running.

The database schema version is a great idea. It is what we use as well. In addition to the schema under version control, we add a schema version table to the schema and keep it updated so we can quickly tell what version is in production/qa/dev when we need to compare.

As for the data layer changes there are two things I would recommend.

  1. Always create your migration path, forward and backward. This means that when you have the schema you want to put on production to upgrade an existing schema, you should always make it part of the release. A clear concise process for ALTERing the tables. By the same token, you need to have a working and tested ROLLBACK version as well in case something goes wrong.

  2. What I have found helpful is using a backup of production to load on my local (or QA/DEV) so that I have the most up-to-date data / schema to play with without affecting production. If you are not performing regular backups of production, maybe now is a good time to implement a policy. Then you will kill two birds with one stone. You will have backups for any outage and a useful live schema with data you can load to test with on another machine. This will also lend itself to raising any possible issues with schema changes as the data will be matching production. So if it works locally (and on DEV/QA), it reduces the risk of something going wrong in production.

Chuck Burgess
  • 11,430
  • 5
  • 38
  • 73