1

As an organisation we are (finally) moving to a good CI/CD setup. We use Github for development and now have a nice CI setup where we auto deploy specific tags to different environments.

Now I want to setup a system where we have a live environment for every pull request untill it it either merged or closed. But I'm not entirely sure how I would get to creating a database per environment with good data. I've tought of multiple solutions myself, but maybe people here have different insights.

Things I've thought of so far.

  1. Just connect to the staging database. Pros: probably easiest to setup. Cons: Very hard to manage with database migrations.

  2. Create a copy of the staging database, and delete it when done with the branch. Pros: probably the best database state management. Cons: I'm not sure how to automate creation of access credentials to the new database.

  3. Have excelent seed data and create a new database with that. Pros: Probably also very easy to setup. Cons: Developers need to make sure the seed data is up to date.

To give a bit more context, we are a project based organisation so we have a lot of different projects for different clients going on.

I was wondering how other companies manage this.

4
  • 1
    Spinning up new databases isn't hard but creating full copies of large databases of sensitive data can be very expensive and problematic. One large organisation I have worked at uses Delphix for database virtualisation to creating data environments using less space and also anonymising sensitive data (customer sensitive data they don't want used by large dev/test teams). I don't have personal experience of it to recommend it but teams who used it seemed happy with it. I am not sure they automated it per PR more like the setup a pool of test envs and had CI run against one that was stable.
    – simbo1905
    Nov 10, 2018 at 8:13
  • 1
    Can you please state what database you are using as more mature ones have features that make sharing data storage easier ?
    – simbo1905
    Nov 10, 2018 at 8:18
  • 1
    Also, can you give some indication about the ”freshness” and ”sensitivity” of your data? Ond company might be able to test on any old database copy of live env that has old data but some organizations are much more dynamic and want to teat against recent copies of live data that has sensitive personal and financial data anonymized.
    – simbo1905
    Nov 10, 2018 at 8:23
  • 1
    I think the question as currently asked risks lots of different answers that would be suboptimal solutions for either your company of any others. We should avoid questions that ask none specific open ended questions. Please edit your question to be more specific to your needs that might help future people who have similar needs.
    – simbo1905
    Nov 10, 2018 at 8:36

0