About Migrating from MongoDB to Oracle NoSQL Database Cloud Service

Your organization has decided to migrate data from MongoDB to Oracle NoSQL Database Cloud Service to keep data in a non-relational database and maintain high availability and scalability. This playbook walks you through the steps to migrate data from MongoDB on-premises and MongoDB Atlas to Oracle NoSQL Database Cloud Service using the Oracle NoSQL Database Migrator.

Architecture

In this architecture, the Oracle NoSQL Database Migrator is installed on an OCI Compute Instance. We recommend using an OCI Always Free Compute instance to reduce costs.

MongoDB formatted JSON files are migrated to Oracle NoSQL Database Cloud Service using OCI Object Storage (intermediate storage), and an OCI Compute instance running the Oracle NoSQL Database Migrator.

Note:

When migrating data, Oracle reserves and manages the resources to meet your requirements and provisions capacity. Capacity is specified using read and write units for throughput and GB for storage units.

The following diagram illustrates this architecture.



migrate-mongodb-oracle-nosql-architecture.zip

This architecture supports the following components:

  • Region

    An Oracle Cloud Infrastructure region is a localized geographic area that contains one or more data centers, called availability domains. Regions are independent of other regions, and vast distances can separate them (across countries or even continents).

  • Availability domain

    Availability domains are standalone, independent data centers within a region. The physical resources in each availability domain are isolated from the resources in the other availability domains, which provides fault tolerance. Availability domains don’t share infrastructure such as power or cooling, or the internal availability domain network. So, a failure at one availability domain is unlikely to affect the other availability domains in the region.

  • Fault domain

    A fault domain is a grouping of hardware and infrastructure within an availability domain. Each availability domain has three fault domains with independent power and hardware. When you distribute resources across multiple fault domains, your applications can tolerate physical server failure, system maintenance, and power failures inside a fault domain.

  • Virtual cloud network (VCN) and subnet

    A VCN is a customizable, software-defined network that you set up in an Oracle Cloud Infrastructure region. Like traditional data center networks, VCNs give you complete control over your network environment. A VCN can have multiple non-overlapping CIDR blocks that you can change after you create the VCN. You can segment a VCN into subnets, which can be scoped to a region or to an availability domain. Each subnet consists of a contiguous range of addresses that don't overlap with the other subnets in the VCN. You can change the size of a subnet after creation. A subnet can be public or private.

  • Internet gateway

    The internet gateway allows traffic between the public subnets in a VCN and the public internet.

  • Service gateway

    The service gateway provides access from a VCN to other services, such as Oracle Cloud Infrastructure Object Storage. The traffic from the VCN to the Oracle service travels over the Oracle network fabric and never traverses the internet.

  • Identity and Access Management (IAM)

    Oracle Cloud Infrastructure Identity and Access Management (IAM) is the access control plane for Oracle Cloud Infrastructure (OCI) and Oracle Cloud Applications. The IAM API and the user interface enable you to manage identity domains and the resources within the identity domain. Each OCI IAM identity domain represents a standalone identity and access management solution or a different user population.

  • Object storage

    Object storage provides quick access to large amounts of structured and unstructured data of any content type, including database backups, analytic data, and rich content such as images and videos. You can safely and securely store and then retrieve data directly from the internet or from within the cloud platform. You can seamlessly scale storage without experiencing any degradation in performance or service reliability. Use standard storage for "hot" storage that you need to access quickly, immediately, and frequently. Use archive storage for "cold" storage that you retain for long periods of time and seldom or rarely access.

  • Oracle NoSQL Database Cloud Service

    Oracle NoSQL Database Cloud Service makes it easy for developers to build applications using document, columnar and key-value database models, delivering predictable single digit millisecond response times with data replication for high availability. The service offers ACID transactions, serverless scaling, comprehensive security, and low pay-per-use pricing for both on-demand and provisioned capacity modes, including 100% compatibility with on-premises Oracle NoSQL Database.

Before You Begin

Before you begin, check the versions of major components used in this setup, and review the product documentation for later reference.

Review Requirements

  • MongoDB running on Oracle Linux server
  • Ensure the OCI Compute Instance running Oracle NoSQL Database Migrator has at least 1 OCPU with 16GB of RAM running Oracle Linux 8.
  • The OCI Compute Instance must be running Oracle NoSQL Database Migrator version 1.5.0 and Java 11.
  • Intermediate storage must include OCI Object Storage

Download the Oracle NoSQL Database Migrator 1.5.0 binaries (V1033765-01.zip) under "Oracle NoSQL Database Migrator and Analytics Integrator":

About Required Products and Roles

This solution requires the following products and roles:

  • Oracle Cloud Infrastructure Identity and Access Management
  • Oracle NoSQL Database Cloud Service
  • Oracle Cloud Infrastructure Compute
  • Oracle Cloud Infrastructure Object Storage
  • MongoDB

These are the roles needed for each product.

Product Name: Role Required to...
Oracle Cloud Infrastructure Identity and Access Management: user Create API key to access OCI to create tables and import data to Oracle NoSQL Database Cloud Service.
Oracle NoSQL Database Cloud Service: admin Create tables and import data.
Oracle Cloud Infrastructure Compute: admin Create OCI compute instance to run Oracle NoSQL Data Migrator.
Oracle Cloud Infrastructure Compute VM: opc Install and run Oracle NoSQL Data Migrator.
Oracle Cloud Infrastructure Object Storage: user Upload and download files from and read files from Oracle Cloud Infrastructure Object Storage Bucket.
MongoDB: admin Export MongoDB collections to file.

See Oracle Products, Solutions, and Services to get what you need.

Considerations for Migration

Before you begin your migration, review these considerations.

  • There is a limit of 13,500 records per MongoDB formatted JSON file when migrating data using OCI Object Storage as intermediate storage. If a JSON file exceeds the 13,500 record limit, use the Oracle Linux split command to divide the file in multiple segments.
  • In MongoDB formatted JSON files, the first column is named _id. In Oracle NoSQL Database Cloud Service, column names must begin with a letter. Both data migration methods in this solution migrate the values from _id to id in Oracle NoSQL Database Cloud Service.