News for hackers. Stuff that matters.
Re:Auto increment is a terrible idea by EGreg on Thursday November 30, 2017 @10:25AM (#15816420)
Let me tell you from my experience. One time I was editing code on the live server using SFTP, before I knew about version control. And the whole thing was deleted, with no way to get it back.

It doesn't take that long to put some safeguards.

Here is the thing: WHENEVER you say "you have to be VERY careful" or blame someone for making a mistake, that's a place you need to put more checks. The computer should check routine things, not people.

"The problem I'm having is where do you start? How do you simulate the data flowing through live in the test / dev enviornment."

I am guessing you use MySQL so simply set up MYSQL REPLICATION and test all your stuff on the replica database first. Actually you should periodically dump the replica and test on a snapshot, so you can mess up the snapshot.

Main db -> Replica -> Snapshot.

Re:Auto increment is a terrible idea by LandR on Thursday November 30, 2017 @10:38AM (#15816522)
It's a SQLSERVER, which at this point is about 200GB. Can I say just replicate the schema and then run a script to populate some test data. Or just move over a subset of the main DB?

Got any good articles on how to setup test environments. I would then need all the dev code to point to the test one, not the live db and any Web APIs to be able to switch to point to the test db (which must mean running 2 web apis, a live and a test one...)

Seems like it gets very complicated, but probably worth figuring out.

We don't even have CI yet.

Re:Auto increment is a terrible idea by thehardsphere on Thursday November 30, 2017 @10:49AM (#15816638)
Yes, typically when testing web applications, you have a second instance of the application running on a different machine than the production server, configured to run against a different database server as well. The exact details of how to do this well depend on how your application is written and its requirements.

If all you want to do is functional testing of the application by yourself, then it is OK to deploy a copy of the software on your desktop along with a test database. I do this for the application I work on, and when I need to test against MSSQL, the Express edition is good enough.

If you need to do load testing or integration testing or other more complicated forms of testing, you usually try to duplicated the expected production environment as well as you can. This may not be possible, so you may have to make decisions about what's most relevant and simply accept those tradeoffs.

EDIT: Don't worry about CI or anything else that fancy and complicated for now. You may not even need it; that depends on your team and how often your application changes. Just for now take the simplest steps you can until you get this basic stuff figured out first.