What I’m really looking for would be the equivalent of a lightweight database snapshot that could be further modified.
The database could be huge, but the snapshot itself should be tiny and maintain a relationship to the parent.
Something like this would allow me to have, essentially, a database per branch. It could also be used for testing environment that go almost directly against production, but without the possibility of affecting it.
I most interested in relational database implementations or extensions. But would be open to anything.
I don’t think branching exists for any RDBMS; about the closest you can get is cloning the entire database via backing up and restoring or BULK INSERTing into a new database.
You could try rolling your own branching system by cloning the target database’s schema for each branch and storing “diffs” (i.e., edited records) in them, but that would then require querying across both databases, resolving edit conflicts, and descending into a unique circle of hell when it comes time to insert or delete records.
Personally, I’d just go with a full/partial clone for primary testing and a smaller subset for branches where you’re editing the schema.