Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7190167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:27:24+00:00 2026-05-28T19:27:24+00:00

Background info: We are currently 3 web programmers (good, real-life friends, no distrust issues).

  • 0

Background info:

  • We are currently 3 web programmers (good, real-life friends, no distrust issues).
  • Each programmers SSH into the single Linux server, where the code resides, under their own username with sudo powers.
  • We all use work on the different files at one time. We ask the question “Are you in the file __?” sometimes. We use Vim so we know if the file is opened or not.
  • Our development code (no production yet) resides in /var/www/
  • Our remote repo is hosted on bitbucket.
  • I am *very* new to Git. I used subversion before but I was basically spoon-fed instructions and was told exactly what to type to sync up codes and commit.
  • I read about half of Scott Chacon’s Pro Git and that’s the extent to most of my Git knowledge.
  • In case it matters, we run Ubuntu 11.04, Apache 2.2.17, and Git 1.7.4.1.

So Jan Hudec gave me some advice in the previous question. He told me that a good practice to do the following:

  • Each developer have their own repo on their local computer.
  • Let the /var/www/ be the repo on the server. Set the .git folder to permission 770.

That would mean that each developer’s computer need to have their own LAMP stack (or at least Apache, PHP, MySQL, and Python installed).

The codes are mostly JavaScript and PHP files so it’s not a big deal to clone it over. However how do we locally manage the database?

In this case, we only have two tables and it’ll be simple to recreate the entire database locally (at least for testing). But in the future when the database gets too big, then should we just remotely log on the MySQL database on the server or should we just have a “sample” data for developing and testing purposes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:27:25+00:00Added an answer on May 28, 2026 at 7:27 pm

    What you’re doing is transitioning from “everybody works together in one environment” to “everybody has their own development environment”. The major benefit is everybody won’t be stepping on each other’s feet.

    Other benefits include a heterogeneous development environment, that is if everyone is developing on the same machine the software will become dependent on that one setup because developers are lazy. If everyone develops in different environments, even just with slightly different versions of the same stuff, they’ll be forced to write more robust code to deal with that.

    The main drawback, as you’ve noticed, is setting up the environment is harder. In particular, making sure the database works.

    First, each developer should have their own database. This doesn’t mean they all have to have their own database server (though its good for heterogeneous purposes) but they should have their own database instance which they control.

    Second, you should have a schema and not just whatever’s in the database. It should be in a version controlled file.

    Third, setting up a fresh database should be automatic. This lets developers set up a clean database with no hassle.

    Fourth, you’ll need to get interesting test data into that database. Here’s where things get interesting…

    You have several routes to do that.

    First is to make a dump of an existing database which contains realistic data, sanitized of course. This is easy, and provides realistic data, but it is very brittle. Developers will have to hunt around to find interesting data to do their testing. That data may change in the next dump, breaking their tests. Or it just might not exist at all.

    Second is to write “test fixtures”. Basically each test populates the database with the test data it needs. This has the benefit of allowing the developer to get precisely the data they want, and know precisely the state the database is in. The drawbacks are that it can be very time consuming, and often the data is too clean. The data will not contain all the gritty real data that can cause real bugs.

    Third is to not access the database at all and instead “mock” all the database calls. You trick all the methods which normally query a database into instead returning testing data. This is much like writing test fixtures, and has most of the same drawbacks and benefits, but it’s FAR more invasive. It will be difficult to do unless your system has been designed to do it. It also never actually tests if your database calls work.

    Finally, you can build up a set of libraries which generate semi-random data for you. I call this “The Sims Technique” after the video game where you create fake families, torture them and then throw them away. For example, lets say you have User object who needs a name, an age, a Payment object and a Session object. To test a User you might want users with different names, ages, ability to pay and login status. To control all that you need to generate test data for names, ages, Payments and Sessions. So you write a function to generate names and one to generate ages. These can be as simple as picking randomly from a list. Then you write one to make you a Payment object and one a Session object. By default, all the attributes will be random, but valid… unless you specify otherwise. For example…

    # Generate a random login session, but guarantee that it's logged in.
    session = Session.sim( logged_in = true )
    

    Then you can use this to put together an interesting User.

    # A user who is logged in but has an invalid Visa card
    # Their name and age will be random but valid
    user = User.sim(
        session = Session.sim( logged_in = true ),
        payment = Payment.sim( invalid = true, type = "Visa" ),
    );
    

    This has all the advantages of test fixtures, but since some of the data is unpredictable it has some of the advantages of real data. Adding “interesting” data to your default sim and rand functions will have wide ranging repercussions. For example, adding a Unicode name to random_name will likely discover all sorts of interesting bugs! It unfortunately is expensive and time consuming to build up.

    There you have it. Unfortunately there’s no easy answer to the database problem, but I implore you to not simply copy the production database as it’s a losing proposition in the long run. You’ll likely do a hybrid of all the choices: copying, fixtures, mocking, semi-random data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background Info: File Replication is Lame Currently, we have a massive, high-traffic ASP.NET web
Background Info A bug exists currently in IE9 where it thinks that the NodeFilter
Here's the background info first. ASP.NET 2.0 Web Site with AJAX Extensions 1.0. I
Background info : I was handed a Tool, which was made using MS-Access 2007,
Some background info; LanguageResource is the base class LanguageTranslatorResource and LanguageEditorResource inherit from LanguageResource
Can someone give me some info/background info on how I might go about writing
Please help! Background info I have a WPF application which accesses a SQL Server
Greetings, coders, Background Info and Code I am trying to create a daemon-type program
I am trying to debug web service call which uses JMS in the background.I
I'm currently attempting to set up background audio for an app I'm developing for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.