14 Implementing DevOps principles with Oracle Database / Version 1.1
Copyright © 2023, Oracle and/or its affiliates / Public
and various other workflow details. Most importantly, all the commits from the source branch and all the files
changed in it are listed, allowing everyone to assess the impact and comment on the changes.
Code Reviews are often performed based on Merge Requests, especially in Open Source projects (see below).
Forking a Project
Forking is less common in in-house software development projects than with Open Source Software (OSS). OSS
encourages contributions to the code, but for obvious reasons, these contributions need to undergo a lot of
scrutiny before they can be merged.
In other words, regular users don’t have write privileges on public software projects hosted on GitHub or GitLab.
To get around this limitation, developers wishing to contribute to the project create a copy, or a fork, in their own
namespace and modify it as if it were theirs. To integrate the changes back into the original project, the next step
is to raise a Pull Request (GitHub), or Merge Request (GitLab) once the contribution is ready.
Project maintainers can then review the contributions and either merge them or request further changes or
enhancements. Once the contributions have been merged, the contributor’s fork becomes redundant and can be
archived, deleted or synced with the original project repository for future contributions.
Your Database Project’s Git Repository
As with every aspect of the software development lifecycle, spending some time thinking about the future before
starting the implementation pays off. Mistakes made early in the project’s lifespan can prove costly and complex
to resolve later.
Single Repository vs Separate Frontend and Backend Repositories
There is an ongoing discussion in the developer community about whether application code like that of your
Angular, React, or any other frontend technology should coexist with database change code inside a single
repository. For most modern applications, especially those following a micro-service pattern it makes a lot of
sense to include frontend and backend code in the same repository.
For existing, complex software projects, especially those where the database is accessed by a multitude of
applications, creating a separate Git repository might make sense. There is a risk of introducing delay in the
release cadence if the application and database repositories are separate: changes required by the application
might not be incorporated in time, causing delay. The development workflow must ensure that there aren’t siloed
team structures in place, or carried over.
This tech brief was written under the assumption that developers own both the frontend and backend, therefore
combining both the user interface and the database schema changes in a single repository.
Directory Structure
When it comes to your database project’s directory structure, the file layout choice matters a lot. It primarily
depends on the method used for deploying changes:
Migration-based approach (“delta” or “increment” method)
State-based approach (“snapshot” method)
Using a migration-based approach, developers deploy their changes based on the expected state of the
database schema. Assuming a change at t0 deployed a table in the schema, the following database change uses
the ALTER TABLE statement to modify the table. The schema migration is a continuous process where one
change depends on the previous one.
Using a state-based approach, developers declare the target state, like for example the structure of a table. The
deployment tool assesses the current state of the table and creates a set of changes on the fly transitioning the
current state to the target state.
This tech brief suggests a method where both are combined. However, the state is stored only for reference or to
be used to populate an empty schema.