Coder Social home page Coder Social logo

Comments (3)

alf-mindshift avatar alf-mindshift commented on July 17, 2024 1

Yes, this helps a lot. Thank you for enumerating and describing the different options. This was very useful and insightful.

I like the volume-based approach and the pluggable database-approach and will experiment with this.

from oci-oracle-xe.

gvenzl avatar gvenzl commented on July 17, 2024

Hi @alf-mindshift,

Thank you very much, I'm glad you like them!

You have a couple of options here, depending on your scenario.

The two options that you have laid out above are definitely valid but I would recommend option No. 2 when considering them, as that one can be easily automated and added to a common (container) toolchain.

An important question is whether you would like to have a customized database as part of the image, or not.

A third approach could be to, for example, create a database with the steps outlined above in No. 1, but instead of doing a docker commit, you preserve the customized database in a volume once. The container script is smart enough to check whether there already is an existing database and if so, it will just start that database up. So you could point your container to a volume that already has such a customized database in it, and it will just start that database up for you. The downside, however, is that you will have to have that volume obviously readily available wherever the container will run and clone it each time you want to start another container. Depending on your environment, as I believe some orchestration technologies have such a concept of giving containers cloned images, this may not be much of a downside.

A fourth approach that will give you the fastest startup time and benefit of encapsulation would be to combine No. 2 above and the trick about the volume, i.e.:

  1. create the database with everything setup and the DB files pointing to a volume
  2. build a new image by copying the database files from that volume into the right place.
  3. use that new image

The downside of that approach is that your image on the host will have gotten bigger but when you run that image it will just start up your database, giving you the fastest possible startup time.

As to a fifth approach, Oracle 18c XE also comes with a new technology called "pluggable databases" that provides many flexibilities and possibilities when it comes to creating, cloning and relocating databases.
A more database-centric approach could be to create such a pluggable database that comes with all the starter data set included and unplug it as a "gold image". Then on database startup time you just plug in the PDB by providing an additional volume to that container and use the CREATE PLUGGABLE DATABASE FROM ... command in a SQL script in /container-entrypoint-initdb.d. The approach will be similar to approach No. 3 just that it leverages database built-in capabilities and provide you perhaps with better reusability.

Hope this helps!

from oci-oracle-xe.

gvenzl avatar gvenzl commented on July 17, 2024

Great, please do let me know how it goes! :)

from oci-oracle-xe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.