Chapter 31 Quiz: DB2 in the Cloud

Multiple Choice Questions

Question 1

Which IBM Cloud service is optimized for transactional (OLTP) workloads?

A. Db2 Warehouse on Cloud B. Db2 on Cloud C. Db2 on Cloud Pak for Data D. Cloud Object Storage with SQL Query

Answer: B. Db2 on Cloud is a fully managed relational database service optimized for transactional (OLTP) workloads. Db2 Warehouse on Cloud is optimized for analytics using columnar (BLU) storage. Cloud Pak for Data is a broader data platform that can host either workload.


Question 2

What technology does Db2 Warehouse on Cloud use to achieve high-performance analytics queries?

A. In-memory row caching with OLTP optimization B. BLU Acceleration with columnar storage, compression, and SIMD processing C. Distributed hash partitioning across multiple servers D. Materialized views with automatic refresh

Answer: B. Db2 Warehouse on Cloud leverages BLU Acceleration, which combines columnar storage (reading only needed columns), aggressive compression (5:1 to 20:1), and SIMD (Single Instruction, Multiple Data) CPU instructions to deliver 10-100x performance improvement for analytics queries compared to traditional row-oriented storage.


Question 3

Why is the --privileged flag required when running Db2 in a Docker container?

A. Db2 requires root access to create database files B. Db2 uses Linux kernel features (IPC, semaphores) that are not available in unprivileged containers C. The Db2 license agreement requires privileged mode D. Db2 needs to modify the host system's network configuration

Answer: B. Db2 relies on Linux kernel features such as IPC (Inter-Process Communication) shared memory segments and semaphores that are restricted in unprivileged containers. The --privileged flag grants the container access to these kernel features. For production deployments, specific capabilities (--cap-add IPC_LOCK, --cap-add IPC_OWNER) can be used instead of full privileged mode.


Question 4

In a federated Db2 configuration, what is a "nickname"?

A. An alias for a local table that provides a shorter name B. A local metadata object that represents a remote table, enabling transparent cross-system queries C. A temporary table used during federated query processing D. A user-defined function that translates SQL dialects between platforms

Answer: B. A nickname is a local metadata object in the federated database that maps to a table on a remote data source. Applications query nicknames using standard SQL as if they were local tables. The federation engine translates the query into remote operations, fetches the results, and presents them to the application.


Question 5

What is the primary benefit of using CDC (Change Data Capture) replication for cloud migration over batch ETL?

A. CDC is always faster than batch ETL B. CDC provides near-real-time synchronization and enables zero-downtime migration C. CDC requires no configuration on the source database D. CDC eliminates the need for a target database

Answer: B. CDC captures changes (inserts, updates, deletes) from the source database's transaction log in near-real-time and applies them to the target. This enables zero-downtime migration: the target stays synchronized during the migration period, and the final cutover requires only seconds of quiesce time to verify synchronization. Batch ETL, by contrast, creates a point-in-time copy that becomes stale as soon as the extract completes.


Question 6

In the shared responsibility model for Db2 on Cloud, which of the following is the CUSTOMER's responsibility?

A. Physical server maintenance and hardware replacement B. Operating system patching and DB2 engine upgrades C. Data-level access control (GRANT/REVOKE) and compliance D. Network infrastructure within the IBM data center

Answer: C. In the shared responsibility model, IBM manages the physical infrastructure, operating system, and Db2 engine (patching, upgrades, HA configuration). The customer is responsible for data security, including access control (GRANT/REVOKE, roles, RCAC), encryption key management (BYOK), compliance with industry regulations, and application-level security.


Question 7

What happens to in-flight transactions during an automatic failover on Db2 on Cloud Enterprise HA?

A. All in-flight transactions are automatically committed on the new primary B. In-flight transactions that were not committed are rolled back; applications must retry C. In-flight transactions are paused and resume on the new primary D. The failover is delayed until all in-flight transactions complete

Answer: B. During automatic failover, uncommitted transactions are rolled back on the new primary. Applications receive a communication error (SQL -30108) and must retry the transaction. If Automatic Client Reroute (ACR) is enabled (default), the driver reconnects automatically, but the application must handle transaction retry logic.


Question 8

Which migration strategy involves moving a DB2 database to a cloud VM with minimal changes to the database configuration?

A. Re-architect B. Re-platform C. Lift and shift D. Hybrid federation

Answer: C. Lift and shift moves the existing database to a cloud VM (IaaS) with minimal changes. The same operating system, Db2 version, and configuration are replicated in the cloud. This is the fastest migration path but does not leverage managed services or cloud-native features.


Question 9

What is the main cause of poor performance when running a "chatty" application against a cloud database in a hybrid architecture?

A. Cloud CPUs are slower than on-premises CPUs B. Cloud storage has lower IOPS than on-premises storage C. Network latency multiplied by the number of SQL round trips D. Cloud databases do not support stored procedures

Answer: C. A chatty application that executes many individual SQL statements per business transaction accumulates network latency on each round trip. On-premises, 100 statements at 0.1 ms latency = 10 ms overhead. In a hybrid setup (on-premises app to cloud DB) with 30 ms latency, the same 100 statements add 3 seconds of overhead. Mitigation includes stored procedures, batch operations, and deploying the application in the same region as the database.


Question 10

Which Kubernetes resource type is recommended for deploying Db2 and why?

A. Deployment — because it provides rolling updates B. DaemonSet — because Db2 should run on every node C. StatefulSet — because it provides stable network identities and persistent storage D. Job — because database initialization is a one-time operation

Answer: C. A StatefulSet provides stable, persistent network identities (predictable pod names) and ordered, graceful deployment and scaling. Most importantly, it manages PersistentVolumeClaims that survive pod restarts — essential for a database that must not lose its data files. A Deployment does not guarantee persistent storage association across pod reschedules.


Question 11

When federating a query that joins a z/OS table (filtered by BRANCH_ID = 101) with a cloud table, what does "predicate pushdown" accomplish?

A. The entire query is executed on the remote server with the most data B. The filter BRANCH_ID = 101 is sent to the z/OS server so only qualifying rows are transferred C. The cloud table's data is pushed to the z/OS server for local join processing D. Both tables are fully transferred to the federation server before joining

Answer: B. Predicate pushdown sends filter predicates to the remote data source so that only rows matching the predicate are transferred across the network. In this case, the z/OS server applies BRANCH_ID = 101 locally and returns only the matching rows, dramatically reducing network traffic compared to transferring the entire table.


Question 12

Which is NOT a valid reason to choose Db2 on Cloud over a self-managed Db2 on an AWS EC2 instance?

A. Automatic high availability with synchronous replication B. Managed backups with point-in-time recovery C. Elimination of the need for any database administration D. Reduced operational overhead for patching and upgrades

Answer: C. Db2 on Cloud reduces but does not eliminate database administration. You still need to manage schema design, query performance tuning, access control, data modeling, and application-level concerns. What the managed service eliminates is infrastructure administration — OS patching, DB2 engine upgrades, HA configuration, backup scheduling, and storage management.


Short Answer Questions

Question 13

Describe the three tiers of Meridian National Bank's hybrid cloud architecture and explain why each tier uses a different database deployment model.

Answer: Tier 1 is the core banking system on DB2 for z/OS, which remains on-premises because it requires the mainframe's unmatched transaction throughput, deep integration with CICS and batch processing, and decades of optimized application code. Tier 2 is the digital banking platform on Db2 on Cloud Enterprise HA, which uses the managed cloud service because digital banking needs rapid deployment, elastic scaling for variable mobile/web traffic, and global availability without the overhead of managing infrastructure. Tier 3 is the analytics platform on Db2 Warehouse on Cloud, which uses the columnar analytics service because reporting and fraud detection queries benefit from BLU Acceleration's columnar storage and compression, and the analytics workload is separate from the OLTP workload.


Question 14

Explain the difference between "encryption at rest" and "encryption in transit" for Db2 on Cloud, and state which standards/algorithms are used for each.

Answer: Encryption at rest protects data stored on disk — database files, backup files, and log files are encrypted using AES-256. The encryption keys are managed by IBM Key Protect or Hyper Protect Crypto Services, and customers can bring their own keys (BYOK). Encryption in transit protects data as it moves between the application and the database over the network. All connections use TLS 1.2 or higher with SSL certificates managed by IBM. Applications connect on port 50001 (SSL port) and should enable certificate verification. Together, they ensure data is protected both when stored and when transmitted.


Question 15

A developer proposes using federation to query z/OS transaction data from the cloud application 500 times per second. Explain why this is problematic and suggest an alternative approach.

Answer: Federation queries are not designed for high-frequency OLTP access. Each federated query incurs network round-trip latency between the federation server and z/OS (typically 5-50 ms in a hybrid setup), which at 500 queries per second would consume 2.5-25 seconds of cumulative latency per second — creating a bottleneck. Additionally, 500 federation queries per second would place significant load on the z/OS system, competing with core banking transactions. The alternative is CDC replication: replicate the z/OS transaction data to Db2 on Cloud in near-real-time, and have the cloud application query the local replica. This eliminates cross-network latency for each query and offloads read traffic from z/OS. Federation should be reserved for ad-hoc, low-frequency queries where real-time data access justifies the latency cost.