1 /
O

Developer Deep Dive & Migration Guide

Oracle MongoDB

Architecture, data model, query language, transactions, HA/DR, migration tooling — the complete modernization playbook.

Duration 20–25 min Audience Architects & Developers Focus Migration & Modernization

Scroll or press ↓ to begin

Agenda

01

Why Migrate?

Strategic rationale, architecture shift

02

Developer Deep Dive

Data model, queries, transactions, HA

03

Migration Tooling

Relational Migrator, schema analysis, code gen

04

Feature Matrix & Battlecard

Oracle → MongoDB mapping, positioning

01020304
Section 01 — Why Migrate?

Five Reasons to Leave Oracle

Data Model & Performance

Shift from normalization to rich documents designed around access patterns. Atomic single-document operations replace expensive multi-table JOINs.

Agility & Iteration Speed

Oracle's fixed DDL requires schema approval for every change. MongoDB's flexible schema lets developers iterate and deploy immediately.

Operational Simplicity

No DBA teams for patching, RMAN, capacity-based licensing. MongoDB Atlas automates scaling, backups, and upgrades.

Cloud & Vendor Flexibility

Oracle locks you to Exadata/OCI. Atlas runs on AWS, Azure, and GCP — multi-cloud by design, zero vendor lock-in.

AI Readiness

Store transactional data and vector embeddings in one platform. Atlas Vector Search enables RAG and semantic search — Oracle requires bolt-on AI infrastructure.

Licensing Cost

Oracle per-core licensing + mandatory support contracts + extra-cost options (RAC, partitioning, GoldenGate). MongoDB: pay-as-you-go consumption.

Section 02 — Architecture Comparison

Oracle RAC vs. MongoDB Replica Sets

Hover over any component to learn more

Oracle RAC Architecture Application (TNS/SCAN) Cache Fusion (GCS / GES) Instance 1 SGA · Redo · PGA Instance 2 SGA · Redo · PGA Instance N SGA · Redo · PGA Shared Storage (ASM / SAN) All nodes → same disk ⚠ Scale-up only · Exadata lock-in · Per-core licensing GoldenGate required for cross-region DR (extra license) vs MongoDB Atlas Architecture Application (SRV / Driver) mongos Router (sharded) Primary WiredTiger Reads + Writes Secondary WiredTiger Secondary WiredTiger mongot Search + Vector Local NVMe Shared-nothing · Auto-failover <10s · Online resharding AWS · Azure · GCP — 100+ regions · Pay-as-you-go
Oracle RAC: Shared-disk architecture. All nodes compete for the same storage via cache fusion. GC buffer busy waits are the #1 performance bottleneck. Scaling means bigger Exadata hardware. GoldenGate for DR adds cost and complexity.
MongoDB Atlas: Shared-nothing architecture. Each node owns its local storage. Auto-failover in <10 seconds. Horizontal scaling via sharding. Integrated search and vector search via mongot. Multi-cloud by default.
High-Level Comparison

Oracle vs MongoDB Atlas — At a Glance

10 8 6 4 2 Schema Flexibility Agile iteration vs rigid DDL Scaling Scale-out vs scale-up Platform Breadth Search, vectors, streams Operations DBA effort, automation Cost Model Licensing vs consumption MongoDB Atlas Oracle Database
DimensionMongoDB AtlasOracle Database
Schema Flexibility93
Scaling105
Platform Breadth104
Operations93
Cost Model102

Scores are directional estimates for positioning conversations, not formal benchmarks. Oracle scores higher on mature OLAP/DW — not reflected here.

Tables & JOINs → Rich Documents

The single largest paradigm shift. Co-locate related data in one document — eliminating JOINs for most reads.

Oracle — Normalized Tables

-- 3 tables, 2 JOINs to fetch one order
SELECT o.order_id, c.name, p.product_name
FROM orders o
JOIN customers c ON o.customer_id = c.id
JOIN order_items oi ON o.id = oi.order_id
JOIN products p ON oi.product_id = p.id
WHERE o.order_id = 12345;

Separate tables for every entity. Foreign keys enforce relationships. Every read = multi-table JOIN.

MongoDB — Embedded Document

{
  "_id": "order_12345",
  "customer": { "name": "Jane Doe", "id": "C1" },
  "items": [
    { "product": "Hiking Boots", "qty": 1, "price": 129.99 },
    { "product": "Wool Socks", "qty": 2, "price": 14.99 }
  ],
  "total": 159.97
}

One document = one read. Atomic. No JOINs. Arrays and nested objects are first-class citizens.

When to reference instead of embed: Large arrays (>1000 elements), high-cardinality relationships (many-to-many), or data that changes independently. Use $lookup for server-side JOINs when needed. Data Modeling Docs →

SQL → MongoDB Query API

Declarative SQL becomes JSON-based queries and the powerful Aggregation Pipeline.

Oracle SQL

-- Filter + Sort
SELECT * FROM users
WHERE status = 'active' AND age > 30
ORDER BY created_at DESC;

-- GROUP BY
SELECT dept, COUNT(*) FROM employees
GROUP BY dept;

MongoDB MQL

// Filter + Sort
db.users.find({
  "status": "active",
  "age": { $gt: 30 }
}).sort({ "created_at": -1 });

// Aggregation Pipeline (GROUP BY)
db.employees.aggregate([
  { $group: { _id: "$dept", count: { $sum: 1 } } }
]);
The Aggregation Pipeline is the single most important concept for Oracle developers to master. It replaces complex Oracle views, stored procedures, and report-generating SQL. Stages chain together: $match → $group → $sort → $lookup → $project. Pipeline Docs →

Transactions & Consistency

Oracle is implicitly transactional. MongoDB provides ACID at the single-document level by default — and multi-document transactions when you need them.

Oracle Transaction

-- Implicit transaction (auto-begin)
UPDATE accounts SET balance = balance - 100
  WHERE id = 'A';
UPDATE accounts SET balance = balance + 100
  WHERE id = 'B';
COMMIT; -- or ROLLBACK

MongoDB Multi-Document Transaction

const session = client.startSession();
session.startTransaction({
  readConcern: { level: "snapshot" },
  writeConcern: { w: "majority" }
});
try {
  accounts.updateOne(
    { _id: "A" }, { $inc: { balance: -100 } }, { session });
  accounts.updateOne(
    { _id: "B" }, { $inc: { balance: 100 } }, { session });
  session.commitTransaction();
} catch(e) { session.abortTransaction(); }
Key insight: Because MongoDB documents can contain arrays and nested objects, most operations that require multi-statement transactions in Oracle are single-document atomic operations in MongoDB. Multi-document transactions exist for the remaining cases. Transactions Docs →

HA & Disaster Recovery

Oracle Data Guard + GoldenGate vs. MongoDB's built-in replica sets and change streams.

Oracle HA/DR

Data Guard: Standby databases (physical/logical). Manual or scripted failover. RPO depends on redo log shipping frequency.

GoldenGate: Real-time replication across heterogeneous systems. Complex setup, extra-cost license, dedicated infrastructure.

RAC: Multi-instance on shared storage. HA within one data center only. Does not protect against site failure.

MongoDB HA/DR

Replica Sets: 3+ nodes with automatic failover in seconds. No manual intervention. Built into every deployment.

Change Streams: Real-time event-driven architecture. Subscribe to the oplog — triggers, CDC, audit trail — no GoldenGate needed.

Global Clusters: Atlas deploys across continents with zone-aware sharding. Low-latency reads from the nearest node. RPO ≈ 0 with majority write concern.

Cost comparison: Oracle Data Guard + GoldenGate + RAC requires three separate licenses plus specialized hardware (Exadata). MongoDB replica sets and change streams are included in every deployment at no extra cost. Replication Docs →

Indexing & Performance Tuning

Oracle and MongoDB both use B-tree indexes. MongoDB adds compound indexes (ESR rule), text, vector, wildcard, and geospatial.

Oracle Index Types

-- Composite index
CREATE INDEX idx_cust_date
  ON policies(customer_id, issue_date DESC);

-- Bitmap (low-cardinality columns)
CREATE BITMAP INDEX idx_status
  ON policies(status);

-- Function-based
CREATE INDEX idx_upper_name
  ON customers(UPPER(name));

MongoDB Index Types

// Compound (ESR: Equality, Sort, Range)
db.policies.createIndex(
  { customerId: 1, issueDate: -1 }
);

// Text index (full-text search)
db.products.createIndex({ description: "text" });

// Wildcard (dynamic schemas)
db.events.createIndex({ "metadata.$**": 1 });

// Vector (Atlas Vector Search)
// Defined in Atlas Search index definition
Key difference: Oracle has bitmap indexes for OLAP workloads. MongoDB doesn't — it's not designed for data warehousing. For performance tuning, replace Oracle's EXPLAIN PLAN with MongoDB's explain("executionStats"). Indexes Docs →

PL/SQL → Application Layer

Oracle couples business logic to the database. MongoDB shifts it to the application layer — testable, scalable, and decoupled.

Stored Procedures → Microservices

PL/SQL logic moves to application code (Java, Node.js, Python). Relational Migrator automates rewriting stored procedures into application-compatible code or aggregation pipelines.

Triggers → Change Streams

Oracle BEFORE/AFTER triggers become Change Streams — subscribe to the oplog for real-time events. Atlas Database Triggers run serverless JavaScript. Docs →

Sequences → findAndModify

No native sequences. Use a dedicated collection + atomic findAndModify with $inc for gap-free auto-increment. Cache blocks of IDs in the app for throughput.

DBMS_JOB → Scheduled Triggers / K8s

Oracle job schedulers decouple to Atlas Scheduled Triggers (CRON-based serverless) or Kubernetes CronJobs. No database dependency for scheduling.

Foreign Keys → Embedding + Validation

Referential integrity via embedded documents (inherent). When references are used, enforce integrity at the app layer within multi-document transactions. Schema Validation →

VPD/RLS → Views + $cond

Row-level security via dynamic views using $cond and $$USER_ROLES. Data masking with field-level conditional logic inside view pipelines.

Scaling Deep Dive

Scaling — Scale-Up vs Scale-Out

Oracle scales vertically (bigger hardware). MongoDB scales horizontally (more nodes). The difference compounds at every tier.

Oracle Database

≤ 100 GB Single instance. Straightforward. Performance depends on instance class (CPU/RAM). Licensing cost already significant.
100 GB–1 TB RAC required for HA. Cache fusion overhead begins. Shared storage (ASM/SAN) must be sized for peak. Per-core licensing multiplies with each RAC node.
1–10 TB Pain point: Partitioning required (extra-cost option). RAC interconnect latency becomes critical. Exadata often "recommended" (proprietary hardware). GoldenGate for cross-region DR adds another license and operational burden.
10 TB+ Hard ceiling approaching. Scale-up architecture hits physical limits. Sharding requires Oracle Sharding (12.2+) — complex, rarely deployed, limited driver support. Most orgs resort to application-level partitioning or data archival.

RAC Admin Guide · Oracle Sharding

MongoDB Atlas

≤ 100 GB Single replica set. M10–M40 tiers. Auto-scaling adjusts tier based on utilization. Read secondaries for analytics workloads.
100 GB–1 TB Scale up to M50–M80. Or start sharding (hash/range/zone). Sharding is additive — no data migration needed. Search Nodes scale independently.
1–10 TB Sharded cluster. Add shards as needed — no hard limit. Live resharding lets you change shard keys without downtime. Zone-sharding for geo-distribution.
10 TB+ Petabyte-scale deployments in production. Auto-balancer redistributes chunks. Binary quantization for vector indexes (32× compression). Atlas auto-scaling tiers. One bill. No per-core licensing.

Sharding Docs · Multi-Cloud Distribution

The cost asymmetry: At 1 TB, an Oracle RAC deployment typically requires RAC licensing (per-core), Partitioning option, GoldenGate for DR, and possibly Exadata. MongoDB Atlas at the same scale is a sharded cluster with consumption pricing — no hidden options, no per-core multipliers, no proprietary hardware. The cost gap widens at every tier.
Section 03 — Migration Tooling

Relational Migrator

Purpose-built for Oracle → MongoDB migration. Schema analysis, data migration, stored procedure conversion — in one tool.

Oracle SchemaTables · Views · PL/SQL Relational MigratorSchema AnalysisData MigrationCode Generation MongoDBCollections · Indexes · Code

Schema Analysis

Reads Oracle data dictionary, foreign keys, and constraints. Recommends embedding vs. referencing based on relationship cardinality and access patterns.

Data Migration

Snapshot + CDC modes. Validates row counts between source and target. Handles type mapping (NUMBER → Double, DATE → ISODate). RM Docs →

Code Generation

Rewrites PL/SQL stored procedures to Java/Node.js/Python + Aggregation Pipelines. LLM-assisted for complex procedures. Breaks large blocks for context windows.

Section 04 — Feature Mapping

Oracle → MongoDB Feature Matrix

Oracle FeatureMongoDB EquivalentNotes
Tables + RowsCollections + DocumentsDocuments can contain nested objects and arrays
SQLMQL + Aggregation PipelineAlso: Atlas SQL Interface for BI tools
JOINsEmbedding / $lookupEmbed for 1:few; $lookup for 1:many
Foreign KeysEmbedding / App-layer validationJSON Schema Validation for constraints
PL/SQL ProceduresApp layer + Aggregation PipelineRelational Migrator auto-converts
TriggersChange Streams / Atlas TriggersReal-time, event-driven, serverless
SequencesfindAndModify + counter collectionAtomic increment; cache for throughput
Data Guard / RACReplica Sets (auto-failover)Built-in, no extra license
GoldenGateChange StreamsReal-time CDC included free
RMAN (Backup)Atlas Cloud Backup + PITRContinuous backup with point-in-time restore
Tablespace PartitioningShardingHorizontal scaling across servers
VPD / RLSViews + $cond + $$USER_ROLESDynamic row/field filtering
Materialized Views$merge / Atlas ChartsAggregation output to collection + visualization
DBMS_JOBAtlas Scheduled Triggers / K8s CronJobsDecoupled from database
SELECT FOR UPDATEAtomic findAndModifyCheck-and-set in one operation
DB LinksREST/gRPC / Atlas Data FederationApplication-layer integration
Advanced QueuingKafka / RabbitMQ / Change StreamsModern messaging infrastructure
Oracle AnalyticsAtlas Charts / BI ConnectorEmbedded dashboards or Tableau/PowerBI

Enterprise Readiness

MongoDB Atlas matches or exceeds Oracle on enterprise requirements — with dramatically simpler operations.

CapabilityOracleMongoDB Atlas
SLA99.995% (Exadata Cloud)99.995%
Multi-CloudOCI primary, limited multi-cloudAWS, Azure, GCP — 100+ regions
EncryptionTDE, Network EncryptionTLS, at-rest, Client-Side FLE, Queryable Encryption
Auth & AuthZLDAP, Kerberos, Oracle DB VaultLDAP, x.509, OIDC, SCRAM, fine-grained RBAC
ComplianceSOC 2, HIPAA, PCI DSS, FedRAMPSOC 2, HIPAA, PCI DSS, ISO 27001, FedRAMP, GDPR
BackupRMAN + scriptsContinuous cloud backup + PITR (managed)
LicensingPer-core + options (RAC, partitioning, GoldenGate)Pay-as-you-go consumption

Sources: Oracle Database Docs · MongoDB Atlas Docs

When to Migrate, When Oracle Stays

MongoDB Wins When…

  • Greenfield applications or complete modernization
  • Data model is document-oriented (nested, polymorphic)
  • Team wants developer velocity over DBA control
  • Workload needs horizontal scaling beyond single-node capacity
  • Multi-cloud or cloud-native is a requirement
  • Need real-time search + vector search alongside OLTP
  • Oracle licensing cost is unsustainable

Oracle Stays When…

  • Application is deeply coupled to PL/SQL with 100K+ LOC and migration cost exceeds benefit
  • Workload requires complex analytical queries (data warehousing, OLAP cubes)
  • Organization mandates Oracle-specific compliance or tooling
  • Existing ERP/CRM system (SAP, Siebel) requires Oracle backend
  • Team has deep Oracle DBA expertise but no app development capacity

Battlecard — Key Talking Points

MongoDB Advantages

"One document replaces five tables." Rich documents eliminate JOINs for most reads. Faster, simpler, atomic by default.
"No Oracle tax." Per-core licensing, mandatory support, extra-cost options (RAC, partitioning, GoldenGate). Atlas is consumption-based.
"Multi-cloud freedom." Oracle pushes OCI. MongoDB runs on AWS, Azure, and GCP — switch with zero code changes.
"AI-ready by default." Vector search, full-text search, and ACID transactions in one platform. Oracle requires separate AI infrastructure.
"Relational Migrator does the heavy lifting." Schema analysis, data migration, PL/SQL rewriting — purpose-built automation.

Common Objections

"Oracle has stronger transactions." MongoDB has full multi-document ACID with snapshot isolation. Most operations are single-document atomic — no transaction needed.
"We need JOINs." Most JOINs disappear with proper document modeling. $lookup handles the rest.
"What about our PL/SQL?" Relational Migrator converts stored procedures to application code. It's an investment in modern, testable architecture.
"Can MongoDB handle our scale?" MongoDB shards horizontally. The world's largest deployments run on Atlas (trillions of docs, petabyte-scale).

References & Further Reading

End of Briefing

Questions & Discussion

Modernize the data layer. Free the developers. Win on velocity, cost, and cloud readiness.

MongoDB Solutions Architecture