views:

141

answers:

6

Assumption: live/production web app suppresses errors being shown to end-users.

Suppose your tech support team wants to see live data but through the eyes of the development-side of the application (maybe you want to see what errors are occurring, or want to see when you've got an issue fixed using an end-user's data).

Right now we've got one database serving both the dev and live boxes (not my idea - I know it's gross).

Ideas?

Edit: Best/handy tools for implementing your suggestion?

+4  A: 

We replicate the data back to a different database. Yes, there is a delay, but it keeps people hands out of the production servers. This also allows us to "hide" information that tech support (and other people for that matter) aren't supposed to see.

Kevin
Any good tools you use to automate this, etc?
Jon Smock
+2  A: 

In addition to replicating data down, on production, we see who's logged into the application, and if it's a member of the company, send them to the real error page versus the happy kitten playing with a ball of yarn apologizing.

Tom Ritter
+2  A: 

Back up and restore from live to dev on a regular basis (once, twice a day). It doesn't need to be realtime (as you might be entering data from the dev side anyway, which could cause problems).

If you have PCI or HIPAA data, make sure you don't put that in your dev environment -- that might break laws.

Macho Matt
+1 on the data/privacy protection policies. If you do have regulatory constraints on the data, then you can generate fake records to fill in the blanks. Just use the "shape" of the prod data to give you a realistic set.
Ben Scheirman
+1  A: 

I generally like to have a 3-tier system for web development:
Development
Testing
Live

Most of the time testing is an exact copy of the live system, except that errors are turned on, when a new version is about to be moved live it's replaced with the new version BEFORE live is, to detect upgrade issues.

Development is completely separate from live, to allow for major changes to things like the database, or changes to the production environment.

acrosman
A: 

I would firstly make errors are either emailed to someone with details of how the user got there or at minimum logged so you can watch the error log while you perform similar actions to see if you get the same messages in the log.

And yes, copying the database on the dev server/site is probably your only option. You don't want any changes made by the development team to live data and you'll probably also have changes that won't work with the production database at some point.

I wouldn't recommend doing a nightly copy as a developer might be in the middle of some new feature where they have added data and then it's erased that night. I usually copy the production database(s) to dev each time a major version is released. This also allows me to do speed testing with a lot of live data. On some systems I also change everyones password to a default so I can login easily as any user.

Darryl Hein
A: 

If your configuration permits it:

a. Add a logging function (if there isn't one already) to write messages of interest to a log file.

b. Run the unix command

tail -f < logfile.txt

which will stream the growing log file to your console.

http://www.monkey.org/cgi-bin/man2html?tail

If you have Windows, you might try this:

http://tailforwin32.sourceforge.net/

le dorfier