Slide 1

Slide 1 text

The Hitchhiker's Guide to Cloud Native Databases Prepare for the Cloud Native database future APAC Tour '23 December 11, 2023 Auckland, New Zealand @ViscosityNA www.viscosityna.com Sean Scott

Slide 2

Slide 2 text

Database Reliability Engineering 
 Business Continuity ⁘ HA & DR 
 Automation ⁘ Observability Real Application Clusters ⁘ Data Guard ⁘ Sharding Containerization ⁘ Terraform ⁘ Ansible Exadata & Engineered Systems AHF ⁘ TFA ⁘ GIMR ⁘ CHA Sean Scott Oracle ACE Director Data on Kubernetes Community Ambassador Managing Principal Consultant Viscosity North America @ViscosityNA www.viscosityna.com

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

An Open Community for 
 Data on Kubernetes https://dok.community

Slide 5

Slide 5 text

@ViscosityNA www.viscosityna.com Oracle on Docker Running Oracle Databases in Linux Containers Free sample chapter: 
 https://oraclesean.com

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

BOI - SEA 642 km SEA - ICN 8,394 km ICN - NRT 1,260 km NRT - MEL 8,144 km MEL - AKL 2,644 km AKL - LAX 10,467 km LAX - BOI 1,085 km 32,635 km

Slide 8

Slide 8 text

@ViscosityNA www.viscosityna.com Evolution From on-premises to Cloud to Cloud Native

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

@ViscosityNA www.viscosityna.com On-Prem: Bare Metal and VM Resources directly provisioned to workloads Inflexible, scales poorly Capacity based on projected requirements Difficult to move

Slide 11

Slide 11 text

@ViscosityNA www.viscosityna.com Cloud: Containers Workloads decoupled from resources Scale to meet demand Moving within a cloud is easier Moving to different clouds is difficult

Slide 12

Slide 12 text

@ViscosityNA www.viscosityna.com Cloud Native: Orchestration/Automation Workloads decoupled from the Cloud Portable across Clouds

Slide 13

Slide 13 text

@ViscosityNA www.viscosityna.com Cloud Native = DBA 2.0

Slide 14

Slide 14 text

@ViscosityNA www.viscosityna.com Running Stateful Workloads in Containers

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

@ViscosityNA www.viscosityna.com Containers are building blocks for the Cloud

Slide 17

Slide 17 text

@ViscosityNA www.viscosityna.com Containers are more Efficient. They maximize Capacity and deliver more Cost-Effective solutions.

Slide 18

Slide 18 text

@ViscosityNA www.viscosityna.com Containers are Portable and improve Reliability, leading to more Durable systems.

Slide 19

Slide 19 text

Containers are like lightweight Virtual Machines, right?

Slide 20

Slide 20 text

@ViscosityNA www.viscosityna.com Virtual Machines Containers Three full operating systems bin/lib app 3 Guest OS bin/lib app 1 Guest OS bin/lib app 2 Guest OS Hypervisor Host OS Three application/executable directories bin/lib app 3 bin/lib app 1 bin/lib app 2 Container Runtime Host OS Extra Capacity!

Slide 21

Slide 21 text

@ViscosityNA www.viscosityna.com www.viscosityna.com @ViscosityNA 13 Oracle Databases on a Laptop 2018 MacBook Pro 15", 2.2GHz 6-core Intel Core i7, 16GB, 1TB SSD

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

@ViscosityNA www.viscosityna.com Virtual Machines: Bootable OS, often heavy Install MS Word separately for every document A 100-page book of games & puzzles Containers: Support one application or service One copy of MS Word shared by all documents A sheet of paper with a Tic-Tac-Toe grid

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

@ViscosityNA www.viscosityna.com Applications and Games exist within structured environments defined by rules.

Slide 27

Slide 27 text

@ViscosityNA www.viscosityna.com The rules and "game board" are expressed as Images: minimal filesystems & metadata that deliver services.

Slide 28

Slide 28 text

@ViscosityNA www.viscosityna.com "Running" an image creates a Union Filesystem and starts an isolated process on the host. These are Containers.

Slide 29

Slide 29 text

@ViscosityNA www.viscosityna.com A Union Filesystem has three layers: A Merge or Union Layer. An Upper Layer. A Lower Layer.

Slide 30

Slide 30 text

@ViscosityNA www.viscosityna.com A Union Filesystem has three layers: A Merge or Union Layer: The service. An Upper Layer: The container. A Lower Layer: The image.

Slide 31

Slide 31 text

@ViscosityNA www.viscosityna.com

Slide 32

Slide 32 text

@ViscosityNA www.viscosityna.com The Upper (merge) layer isn't "real."

Slide 33

Slide 33 text

@ViscosityNA www.viscosityna.com The Upper (merge) layer isn't "real." It's a perceived (calculated) union of: • The game board & rules • Game play

Slide 34

Slide 34 text

@ViscosityNA www.viscosityna.com Containers persist state (moves) in the run-time layer of its Union Filesystem. Containers are stateful.

Slide 35

Slide 35 text

@ViscosityNA www.viscosityna.com Deleting a container removes its Union Filesystem (and its run-time layer). Containers are Ephemeral

Slide 36

Slide 36 text

@ViscosityNA www.viscosityna.com Images are immutable and never change.

Slide 37

Slide 37 text

@ViscosityNA www.viscosityna.com Stalemate!

Slide 38

Slide 38 text

@ViscosityNA www.viscosityna.com Shift the Image Right Moves fall off the game board: Changing an image changes the game!

Slide 39

Slide 39 text

@ViscosityNA www.viscosityna.com Images are immutable and can't persist state information. They are stateless.

Slide 40

Slide 40 text

@ViscosityNA www.viscosityna.com Images = Static templates Containers = Editable documents

Slide 41

Slide 41 text

@ViscosityNA www.viscosityna.com Containers are Magic!

Slide 42

Slide 42 text

@ViscosityNA www.viscosityna.com How much space do three containers use? 500MB
 + 500MB 
 + 500MB 500MB 500MB
 + 500MB 
 + 500MB 1,500MB 500MB 500MB 500MB +

Slide 43

Slide 43 text

@ViscosityNA www.viscosityna.com A Containerfile is a recipe for building images. Each step creates a Layer.

Slide 44

Slide 44 text

@ViscosityNA www.viscosityna.com Multiple identical containers will share an image. Different containers may share common layers.

Slide 45

Slide 45 text

@ViscosityNA www.viscosityna.com Base Linux OS Oracle 19.3 Home Preinstall RPM Oracle 19.20 RU One-off Patches Base Linux OS Oracle 19.3 Home Preinstall RPM Oracle 19.21 RU One-off Patches

Slide 46

Slide 46 text

@ViscosityNA www.viscosityna.com Base Linux OS Oracle 19.3 Home Preinstall RPM Oracle 19.20 RU One-off Patches Oracle 19.21 RU One-off Patches

Slide 47

Slide 47 text

@ViscosityNA www.viscosityna.com Oracle mixes software and configuration.

Slide 48

Slide 48 text

@ViscosityNA www.viscosityna.com Bare Metal/VM Host /etc/oratab /u01 ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin /u02 /u03 oraInventory ORACLE_BASE/audit Software Configuration

Slide 49

Slide 49 text

@ViscosityNA www.viscosityna.com Container /etc/oratab /u01 ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin /u02 /u03 oraInventory ORACLE_BASE/audit Software Configuration (Image) (Container)

Slide 50

Slide 50 text

@ViscosityNA www.viscosityna.com Image Layer Container Layer Union Layer Immutable image layer Ephemeral container layer Computed union layer Oracle Database software + default configurations Modified configurations + log and audit files Unchanged software + overlaid configuration + added log and audit files

Slide 51

Slide 51 text

@ViscosityNA www.viscosityna.com Container /etc/oratab /u01 ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin /u02 /u03 oraInventory ORACLE_BASE/audit ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin oraInventory ORACLE_BASE/audit /etc/oratab

Slide 52

Slide 52 text

@ViscosityNA www.viscosityna.com Image Layer Container Layer Volume Union Layer

Slide 53

Slide 53 text

@ViscosityNA www.viscosityna.com Container Image /u01 ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin /u02 /u03 oraInventory ORACLE_BASE/audit /etc/oratab

Slide 54

Slide 54 text

@ViscosityNA www.viscosityna.com Container Image /u01 ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin /u02 /u03 oraInventory ORACLE_BASE/audit /etc/oratab podman run --name ORCLDB \ --volume /oradata/ORCLDB/inv:/u01/app/oracle/oraInventory \ --volume /oradata/ORCLDB/cfg:/dbconfig \ --volume /oradata/ORCLDB/diag:/ORACLE_BASE/diag \ --volume /oradata/ORCLDB/audit:/ORACLE_BASE/audit \ --volume /oradata/ORCLDB/data:/u02 \ --volume /oradata/ORCLDB/redo:/u03 \ oracle/database:19.20-EE

Slide 55

Slide 55 text

@ViscosityNA www.viscosityna.com Container 19.20 Image /u01 ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin /u02 /u03 oraInventory ORACLE_BASE/audit /etc/oratab

Slide 56

Slide 56 text

@ViscosityNA www.viscosityna.com Container 19.20 Image /u01 ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin /u02 /u03 oraInventory ORACLE_BASE/audit /etc/oratab podman stop ORCLDB podman rm ORCLDB podman run --name ORCLDB \ --volume /oradata/ORCLDB/inv:/u01/app/oracle/oraInventory \ --volume /oradata/ORCLDB/cfg:/dbconfig \ --volume /oradata/ORCLDB/diag:/ORACLE_BASE/diag \ --volume /oradata/ORCLDB/audit:/ORACLE_BASE/audit \ --volume /oradata/ORCLDB/data:/u02 \ --volume /oradata/ORCLDB/redo:/u03 \ oracle/database:19.21-EE

Slide 57

Slide 57 text

@ViscosityNA www.viscosityna.com Container 19.21 Image /u01 ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin /u02 /u03 oraInventory ORACLE_BASE/audit /etc/oratab

Slide 58

Slide 58 text

@ViscosityNA www.viscosityna.com Container 19.21 Image /u01 ORACLE_HOME/dbs ORACLE_BASE/diag ORACLE_HOME/network/admin /u02 /u03 oraInventory ORACLE_BASE/audit /etc/oratab podman stop ORCLDB podman rm ORCLDB podman run --name ORCLDB \ --volume /oradata/ORCLDB/inv:/u01/app/oracle/oraInventory \ --volume /oradata/ORCLDB/cfg:/dbconfig \ --volume /oradata/ORCLDB/diag:/ORACLE_BASE/diag \ --volume /oradata/ORCLDB/audit:/ORACLE_BASE/audit \ --volume /oradata/ORCLDB/data:/u02 \ --volume /oradata/ORCLDB/redo:/u03 \ oracle/database:19.21-EE

Slide 59

Slide 59 text

@ViscosityNA www.viscosityna.com Questions

Slide 60

Slide 60 text

@ViscosityNA www.viscosityna.com Contact Me: [email protected] https://linktr.ee/oraclesean