Skip to content

Commit 880e5ff

Browse files
authored
Merge pull request #2291 from madeline-underwood/mongoDB
Mongo db_PV to sign off
2 parents 606e6cd + 74e74cf commit 880e5ff

File tree

6 files changed

+98
-91
lines changed

6 files changed

+98
-91
lines changed

content/learning-paths/servers-and-cloud-computing/mongodb-on-gcp/_index.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
---
2-
title: Deploy MongoDB on Google Axion C4A virtual machine
2+
title: Deploy MongoDB on an Arm-based Google Axion C4A VM
33

44
minutes_to_complete: 15
55

6-
draft: true
7-
cascade:
8-
draft: true
9-
10-
who_is_this_for: This is an introductory topic for software developers looking to migrate their MongoDB workloads from x86_64 to Arm-based platforms, specifically on Google Axion-based C4A virtual machines.
6+
who_is_this_for: This introductory topic is for software developers who want to migrate MongoDB workloads from x86_64 to Arm-based platforms, specifically on Google Axion-based C4A virtual machines.
117

128
learning_objectives:
13-
- Create an Arm cloud instance on the Google Cloud Platform
14-
- Install and run MongoDB on the Arm-based GCP C4A instance.
15-
- Benchmark the MongoDB performance on Arm using Yahoo Cloud Serving Benchmark (YCSB).
9+
- Create an Arm virtual machine on Google Cloud (C4A Axion family)
10+
- Install and run MongoDB on the Arm-based C4A instance
11+
- Benchmark MongoDB performance with Yahoo Cloud Serving Benchmark (YCSB)
1612

1713
prerequisites:
18-
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free?utm_source=google&hl=en) account with billing enabled.
14+
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free?utm_source=google&hl=en) account with billing enabled
1915

2016
author: Annie Tallund
2117

content/learning-paths/servers-and-cloud-computing/mongodb-on-gcp/background.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ layout: "learningpathall"
88

99
## Google Axion C4A series
1010

11-
The C4A series is a family of Arm-based instance types for Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these virtual machine offer strong performance suitable for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.
11+
The C4A series is a family of Arm-based instance types for Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high performance and energy-efficient computing, these virtual machine offer strong performance suitable for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.
1212

1313
The C4A series provides a cost-effective virtual machine while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
1414

15-
To learn more about Google Axion, refer to the blog [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu).
15+
To learn more about Google Axion, see the blog post [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu).
1616

1717
## MongoDB
18-
MongoDB is a popular open-source NoSQL database designed for high performance, scalability, and flexibility.
1918

20-
It stores data in JSON-like BSON documents, making it ideal for modern applications that require dynamic, schema-less data structures.
19+
MongoDB is a popular open-source NoSQL database designed for performance, scalability, and flexibility. It stores data in JSON-like BSON documents, making it well suited to applications that require dynamic, schema-less data models.
2120

22-
MongoDB is widely used for web, mobile, IoT, and real-time analytics workloads. Learn more from the [MongoDB official website](https://www.mongodb.com/) and its [official documentation](https://www.mongodb.com/docs/).
21+
MongoDB is widely used for web, mobile, IoT, and real-time analytics workloads. Learn more on the [MongoDB website](https://www.mongodb.com/) and in the [MongoDB documentation](https://www.mongodb.com/docs/).

content/learning-paths/servers-and-cloud-computing/mongodb-on-gcp/baseline-testing.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@ weight: 5
66
layout: learningpathall
77
---
88

9-
Now that MongoDB is successfully installed on your GCP C4A Arm virtual machine, follow these steps to verify that the server is running correctly and accepting local connections.
9+
## Overview
1010

11-
### 1. Connect to MongoDB
11+
Now that MongoDB is installed on your Google Axion C4A Arm VM, verify that the server is running and accepting local connections.
12+
13+
Use mongosh to create a test database, run basic CRUD operations, and capture a quick insert-time baseline before you start benchmarking.
14+
15+
## Connect to MongoDB
1216

1317
Open a shell session to the local MongoDB instance:
1418

1519
```console
1620
mongosh mongodb://127.0.0.1:27017
1721
```
1822

19-
### 2. Create a Test Database and Collection
23+
24+
## Create a test database and collection
2025

2126
Switch to a new database and create a collection:
2227

@@ -34,7 +39,7 @@ switched to db baselineDB
3439
{ ok: 1 }
3540
```
3641

37-
### 3. Insert 10,000 Test Documents
42+
## Insert 10,000 test documents
3843

3944
Populate the collection with 10,000 timestamped documents:
4045

@@ -48,9 +53,9 @@ for (let i = 0; i < 10000; i++) {
4853
}
4954
```
5055

51-
Each document will contain:
56+
Each document contains:
5257
- `record`: a counter from 0 to 9999
53-
- `status`: always `"new"`
58+
- `status`: `"new"`
5459
- `timestamp`: the current date/time of insertion
5560

5661
Sample output:
@@ -59,7 +64,7 @@ Sample output:
5964
{ acknowledged: true, insertedId: ObjectId('...') }
6065
```
6166

62-
### 4. Read a Subset of Documents
67+
## Read a subset of documents
6368

6469
Verify read functionality by querying the first few documents:
6570

@@ -69,7 +74,7 @@ db.test.find({ status: "new" }).limit(5)
6974

7075
This returns the first 5 documents where `status` is `"new"`.
7176

72-
### 5. Update a Document
77+
## Update a document
7378

7479
Update a specific document by changing its status:
7580

@@ -89,7 +94,7 @@ Expected output:
8994
}
9095
```
9196

92-
### 6. View the Updated Document
97+
## View the updated document
9398

9499
Confirm that the document was updated:
95100

@@ -108,15 +113,15 @@ Expected output:
108113
}
109114
```
110115

111-
### 7. Delete a Document
116+
## Delete a document
112117

113118
The command below tells MongoDB to delete one document from the test collection, where record is exactly 100:
114119

115120
```javascript
116121
db.test.deleteOne({ record: 100 })
117122
```
118123

119-
Verify that it was deleted:
124+
Verify deletion:
120125

121126
```javascript
122127
db.test.findOne({ record: 100 })
@@ -128,7 +133,7 @@ Expected output:
128133
null
129134
```
130135

131-
### 8. Measure Execution Time (Optional)
136+
## Measure execution time (optional)
132137

133138
Measure how long it takes to insert 10,000 documents:
134139

@@ -146,7 +151,7 @@ Sample output:
146151
Insert duration (ms): 4427
147152
```
148153

149-
### 9. Count Total Documents
154+
## Count total documents
150155

151156
Check the total number of documents in the collection:
152157

@@ -163,9 +168,11 @@ Expected output:
163168
The count **19999** reflects the total documents after inserting 10,000 initial records, adding 10,000 more (in point 8), and deleting one (record: 100).
164169

165170

166-
### 10. Clean Up (Optional)
171+
## Clean up (optional)
172+
173+
For the sake of resetting the environment, this following command deletes the current database you are connected to in mongosh.
167174

168-
For the sake of resetting the environment, this following command deletes the current database you are connected to in mongosh. Drop the `baselineDB` database to remove all test data:
175+
Drop the `baselineDB` database to remove all test data:
169176

170177
```javascript
171178
db.dropDatabase()
@@ -177,4 +184,4 @@ Expected output:
177184
{ ok: 1, dropped: 'baselineDB' }
178185
```
179186

180-
These baseline operations confirm that MongoDB is functioning properly on your GCP Arm64 environment. Using `mongosh`, you validated key database capabilities including **inserts**, **queries**, **updates**, **deletes**, and **performance metrics**. Your instance is now ready for benchmarking or application integration.
187+
These baseline operations confirm that MongoDB is functioning properly on your GCP Arm64 environment. Using `mongosh`, you validated inserts, queries, updates, deletes, and basic performance timing. Your instance is now ready for benchmarking or application integration.

content/learning-paths/servers-and-cloud-computing/mongodb-on-gcp/benchmarking.md

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,36 @@ weight: 6
55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
8-
## MongoDB Benchmarking with YCSB (Yahoo! Cloud Serving Benchmark)
98

10-
**YCSB (Yahoo! Cloud Serving Benchmark)** is an open-source tool for evaluating the performance of NoSQL databases under various workloads. It simulates operations such as reads, writes, updates, and scans to mimic real-world usage patterns.
9+
## Benchmark MongoDB with YCSB
1110

12-
### Install YCSB (Build from Source)
11+
YCSB (Yahoo! Cloud Serving Benchmark) is an open-source tool for evaluating NoSQL databases under various workloads. It simulates operations such as writes, updates, and scans to mimic production traffic.
1312

14-
First, install the required build tools and clone the YCSB repository:
13+
## Install YCSB from source
14+
15+
Install build tools and clone YCSB, then build the MongoDB binding:
1516

1617
```console
1718
sudo dnf install -y git maven java-11-openjdk-devel
1819
git clone https://github.com/brianfrankcooper/YCSB.git
1920
cd YCSB
2021
mvn -pl site.ycsb:mongodb-binding -am clean package
21-
```
2222

23-
### Load Phase – Insert Initial Dataset
2423

25-
This phase inserts a set of documents into MongoDB to simulate a typical starting workload. By default, it inserts 1,000 records.
24+
## Load initial data
2625

26+
Load a starter dataset (defaults to 1,000 records) into MongoDB:
2727
```console
2828
./bin/ycsb load mongodb -s \
2929
-P workloads/workloada \
3030
-p mongodb.url=mongodb://127.0.0.1:27017/ycsb
3131
```
3232

33-
This prepares the database for the actual performance test.
33+
This prepares the database for the performance test.
3434

35-
### Execute Benchmark Workload
35+
## Run a mixed workload
3636

37-
Run the actual benchmark with the predefined workload. This command performs mixed read/write operations and collects performance metrics.
37+
Run Workload A (50% reads, 50% updates) and collect metrics:
3838

3939
```console
4040
./bin/ycsb run mongodb -s \
@@ -48,7 +48,7 @@ Run the actual benchmark with the predefined workload. This command performs mix
4848

4949
This simulates common real-world applications like session stores or shopping carts.
5050

51-
You’ll see performance output that looks like this:
51+
Sample output:
5252

5353
```output
5454
[READ], Operations, 534
@@ -65,39 +65,41 @@ You’ll see performance output that looks like this:
6565
[OVERALL], Throughput(ops/sec), 1953.125
6666
```
6767

68-
### YCSB Operations & Latency Metrics Explained
68+
## Understand YCSB metrics
6969

70-
- **Operations Count**: Total operations performed for each type (e.g., READ, UPDATE).
70+
- **Operations Count**: Total operations performed for each type (for example, READ, UPDATE).
7171
- **Average Latency (us)**: The average time to complete each operation, measured in microseconds.
7272
- **Min Latency / Max Latency (us)**: The fastest and slowest observed times for any single operation of that type.
7373

7474
With YCSB installed and benchmark results captured, you now have a baseline for MongoDB's performance under mixed workloads.
7575

76-
### Benchmark summary on x86_64
76+
## Benchmark summary on x86_64
7777

7878
To better understand how MongoDB behaves across architectures, YCSB benchmark workloads were run on both an **x86_64 (C3 Standard)** and an **Arm64 (C4A Standard)** virtual machine, each with 4 vCPUs and 16 GB of memory, running RHEL 9.
7979

80-
The following benchmark results are collected on a c3-standard-4 (4 vCPU, 2 core, 16 GB Memory) x86_64 environment, running RHEL 9.
80+
Results from a c3-standard-4 instance (4 vCPUs, 16 GB RAM) on RHEL 9:
8181

8282
| Operation | Count | Avg Latency (us) | Min Latency (us) | Max Latency (us) | 50th Percentile (us) | 95th Percentile (us) | 99th Percentile (us) |
8383
|-----------|-------|------------------|------------------|------------------|-----------------------|----------------------|-----------------------|
8484
| READ | 472 | 672.27 | 177 | 56703 | 514 | 903 | 1331 |
8585
| UPDATE | 528 | 621.27 | 214 | 12855 | 554 | 971 | 1224 |
8686
| CLEANUP | 1 | 4702 | 4700 | 4703 | 4703 | 4703 | 4703 |
8787

88-
### Benchmark summary on Arm64:
89-
The following benchmark results are collected on a c4a-standard-4 (4 vCPU, 16 GB Memory) Arm64 environment, running RHEL 9.
88+
## Benchmark summary on Arm64 (Google Axion C4A):
89+
Results from a c4a-standard-4 instance (4 vCPUs, 16 GB RAM) on RHEL 9:
9090

9191
| Operation | Count | Avg Latency (us) | Min Latency (us) | Max Latency (us) | 50th Percentile (us) | 95th Percentile (us) | 99th Percentile (us) |
9292
|----------|------------------|------------------|------------------|------------------|----------------------|----------------------|----------------------|
9393
| READ | 534 | 312.96 | 156 | 8279 | 261 | 524 | 758 |
9494
| UPDATE | 466 | 384.45 | 186 | 26543 | 296 | 498 | 821 |
9595
| CLEANUP | 1 | 4138 | 4136 | 4139 | 4139 | 4139 | 4139 |
9696

97-
### **Highlights from GCP C4A Arm virtual machine**
97+
## Highlights from the C4A Arm VM
98+
99+
- Lower average latencies on Arm: ~313 µs (READ) and ~384 µs (UPDATE).
100+
101+
- Stable p50–p99 latencies indicate consistent performance.
98102

99-
- Arm results show low **average latencies**, **READ** at **313 us** and **UPDATE** at **384 us**.
100-
- **50th** to **99th percentile** latencies remain stable, indicating consistent performance.
101-
- **Max latency** spikes (**8279 us READ**, **26543 us UPDATE**) suggest rare outliers.
103+
- Occasional max-latency outliers suggest transient spikes common in mixed workloads.
102104

103-
This Learning Path walked you through setting up and benchmarking MongoDB on an Arm-based GCP instance, highlighting how to run core operations, validate performance, and interpret benchmarking results with YCSB. Alongside, you explored some performance numbers, showing that Arm is a powerful and cost-efficient alternative for modern data-serving workloads like MongoDB.
105+
With YCSB built and results captured, you now have a baseline for MongoDB performance on Arm-based Google Axion C4A. You can iterate on dataset size, thread counts, and workloads (A–F) to profile additional scenarios and compare cost-performance across architectures.

content/learning-paths/servers-and-cloud-computing/mongodb-on-gcp/create-instance.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,29 @@ weight: 3
66
layout: learningpathall
77
---
88

9-
## Introduction
9+
## Overview
1010

11-
This section walks you through creating a **Google Axion C4A Arm virtual machine** on GCP with the **c4a-standard-4 (4 vCPUs, 16 GB Memory)** machine type, using the **Google Cloud Console**.
11+
This section walks you through creating a Google Axion C4A Arm virtual machine on GCP with the `c4a-standard-4` (4 vCPUs, 16 GB Memory) machine type, using the **Google Cloud Console**.
1212

13-
If you haven't set up a Google Cloud account, check out the Learning Path on [Getting Started with Google Cloud Platform](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/google/).
13+
If you haven't set up a Google Cloud account, see the Learning Path [Getting started with Google Cloud Platform](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/google/).
1414

15-
### Create an Arm-based Virtual Machine (C4A)
15+
## Create an Arm-based virtual machine (C4A)
1616

17-
To create a virtual machine based on the C4A Arm architecture:
18-
1. Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
19-
2. Go to **Compute Engine** and click on **Create Instance**.
20-
3. Under the **Machine Configuration**:
21-
- Fill in basic details like **Instance Name**, **Region**, and **Zone**.
22-
- Select the **Series** as `C4A`.
23-
- Choose a machine type such as `c4a-standard-4`.
24-
![Instance Screenshot](./select-instance.png)
25-
4. Under the **OS and Storage**, click on **Change**, and select **Red Hat Enterprise Linux** as the Operating System with **Red Hat Enterprise Linux 9** as the Version. Make sure you pick the version of image for Arm.
26-
5. Under **Networking**, enable **Allow HTTP traffic** to allow interacting for later steps in the Learning Path.
27-
6. Click on **Create**, and the instance will launch.
17+
To create a VM based on the C4A Arm architecture:
18+
19+
1. Open the [Google Cloud Console](https://console.cloud.google.com/).
20+
2. Go to **Compute Engine** and select **Create instance**.
21+
3. In **Machine configuration**:
22+
- Enter the **Instance name**, **Region**, and **Zone**.
23+
- Set **Series** to `C4A`.
24+
- Choose a machine type such as `c4a-standard-4`.
25+
![Screenshot of GCP Create instance page showing C4A series and c4a-standard-4 selected alt-text#center](./select-instance.png "Selecting the C4A series and c4a-standard-4 machine type")
26+
4. In **OS and storage**, select **Change**, choose **Red Hat Enterprise Linux** as the operating system, and **Red Hat Enterprise Linux 9** as the version. Make sure you select the **Arm** image.
27+
5. In **Networking**, enable **Allow HTTP traffic** so you can test services later in this Learning Path.
28+
6. Select **Create** to launch the instance.
2829

2930
{{% notice Important %}}
30-
Avoid enabling Allow HTTP traffic permanently, as it introduces a security vulnerability. Instead, configure access to allow only your own IP address for long-term use.
31+
Do not leave **Allow HTTP traffic** enabled permanently. For long-term use, restrict access to only the IP addresses you need.
3132
{{% /notice %}}
3233

33-
To access the Google Cloud Console, click the SSH button in your instance overview. This will open a command line interface (CLI), which you’ll use to run the remaining commands in this Learning Path. Continue to the next section to set up MongoDB on your instance.
34+
To open a shell on the VM, select **SSH** in the instance details page. Use this terminal for the commands in the next sections, where you will install and configure MongoDB on your Axion C4A instance.

0 commit comments

Comments
 (0)