Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ layout: learningpathall

## Introduction

This guide walks you through provisioning **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**.
This section walks you through creating **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**.

If you haven't got a Google Cloud account, you can follow the Learning Path on [Getting Started with Google Cloud Platform](https://learn.arm.com/learning-paths/servers-and-cloud-computing/csp/google/) to get started.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
---
title: Deploy MongoDB on Google Axion C4A virtual machine

minutes_to_complete: 60
minutes_to_complete: 15

who_is_this_for: This Learning Path is designed for software developers looking to migrate their MongoDB workloads from x86_64 to Arm-based platforms, specifically on Google Axion-based C4A virtual machines.
draft: true
cascade:
draft: true

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.

learning_objectives:
- Provision an Arm virtual machine on the Google Cloud Platform using the C4A Google Axion instance family, and RHEL 9 as the base image.
- Install and run MongoDB on an Arm-based GCP C4A instances.
- Validate the functionality of MongoDB through baseline testing.
- Create an Arm cloud instance on the Google Cloud Platform
- Install and run MongoDB on the Arm-based GCP C4A instance.
- Benchmark the MongoDB performance on Arm using Yahoo Cloud Serving Benchmark (YCSB).

prerequisites:
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free?utm_source=google&hl=en) account with billing enabled.
- Basic understanding of Linux command line.
- Familiarity with the [MongoDB architecture](https://www.mongodb.com/) and deployment practices on Arm64 platforms.

author: Jason Andrews
author: Annie Tallund

##### Tags
skilllevels: Advanced
skilllevels: Introductory
subjects: Databases
cloud_service_providers: Google Cloud

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ layout: "learningpathall"

## Google Axion C4A series

The Google Axion C4A series is a family of Arm-based virtual machines built on 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 ideal for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.
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.

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

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).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,37 @@ weight: 5
layout: learningpathall
---

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.

Since MongoDB is installed successfully on your GCP C4A Arm virtual machine, follow these steps to validate that the server is running and accepting local connections.

## MongoDB Baseline Testing (Using **mongosh**)

1. Connect to MongoDB
### 1. Connect to MongoDB

Open a shell session to the local MongoDB instance:

```console
mongosh mongodb://127.0.0.1:27017
```

2. Create a Test Database and Collection:
### 2. Create a Test Database and Collection

```console
Switch to a new database and create a collection:

```javascript
use baselineDB
db.createCollection("test")
```
This creates a new database **baselineDB** and an empty collection named test.

You should see an output similar to:
This creates a new database named `baselineDB` and an empty collection called `test`.

Expected output:

```output
test> use baselineDB
... db.createCollection("test")
...
switched to db baselineDB
{ ok: 1 }
```
3. Insert 10,000 Test Documents:

### 3. Insert 10,000 Test Documents

Populate the collection with 10,000 timestamped documents:

```javascript
for (let i = 0; i < 10000; i++) {
Expand All @@ -45,168 +47,134 @@ for (let i = 0; i < 10000; i++) {
})
}
```
This simulates basic write operations with timestamped records.
10,000 documents will be cretaed and inserted into the test collection of the currently selected database.
The record field would increment from 0 to 9999. The status is always "new".
The timestamp would capture the insertion time for each document using ***new Date()***.

You should see an output similar to:
Each document will contain:
- `record`: a counter from 0 to 9999
- `status`: always `"new"`
- `timestamp`: the current date/time of insertion

Sample output:

```output
{
acknowledged: true,
insertedId: ObjectId('6892dacfbd44e23df4750aa9')
}
{ acknowledged: true, insertedId: ObjectId('...') }
```

4. Read (Query) a Subset of Documents:
### 4. Read a Subset of Documents

Verify read functionality by querying the first few documents:

Fetch a few documents to verify read functionality.
```javascript
db.test.find({ status: "new" }).limit(5)
```
This command is a simple read operation to verify that your data is inserted correctly. It queries the test collection in the current database, and only returns documents where the status is "new". ***limit(5)*** returns only the first 5 matching documents.

You should see an output similar to:
This returns the first 5 documents where `status` is `"new"`.

### 5. Update a Document

Update a specific document by changing its status:

```output
[
{
_id: ObjectId('6892dacbbd44e23df474e39a'),
record: 0,
status: 'new',
timestamp: ISODate('2025-08-06T04:32:11.090Z')
},
{
_id: ObjectId('6892dacbbd44e23df474e39b'),
record: 1,
status: 'new',
timestamp: ISODate('2025-08-06T04:32:11.101Z')
},
{
_id: ObjectId('6892dacbbd44e23df474e39c'),
record: 2,
status: 'new',
timestamp: ISODate('2025-08-06T04:32:11.103Z')
},
{
_id: ObjectId('6892dacbbd44e23df474e39d'),
record: 3,
status: 'new',
timestamp: ISODate('2025-08-06T04:32:11.104Z')
},
{
_id: ObjectId('6892dacbbd44e23df474e39e'),
record: 4,
status: 'new',
timestamp: ISODate('2025-08-06T04:32:11.106Z')
}
]
```
5. Update a Document:

Update a specific document's field to validate update capability.
```javascript
db.test.updateOne({ record: 100 }, { $set: { status: "processed" } })
```
Above command will find the first document where record is exactly 100, and updates that document by setting its status field to "processed".

You should see an output similar to:
This finds the document where `record` is 100 and updates the `status`.

Expected output:

```output
{
acknowledged: true,
insertedId: null,
matchedCount: 1,
modifiedCount: 1,
upsertedCount: 0
modifiedCount: 1
}
```
6. View the Updated Document Before Deletion

```console
### 6. View the Updated Document

Confirm that the document was updated:

```javascript
db.test.findOne({ record: 100 })
```
This retrieves the document where record is 100, allowing you to verify that its status has been updated to "processed".

You should see output similar to:
Expected output:

```output
{
_id: ObjectId('689490ddb7235c65ca74e3fe'),
_id: ObjectId('...'),
record: 100,
status: 'processed',
timestamp: ISODate('2025-08-07T11:41:17.508Z')
timestamp: ISODate('...')
}
```

7. Delete a Document:
### 7. Delete a Document

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

```javascript
db.test.deleteOne({ record: 100 })
```
This tells MongoDB to delete one document from the test collection, where record is exactly 100.

You should see an output similar to:

```output
{ acknowledged: true, deletedCount: 1 }
```
Now, confirm the deletion:
Verify that it was deleted:

```console
```javascript
db.test.findOne({ record: 100 })
```
The above command confirms that the document was successfully deleted.

You should see an output similar to:
Expected output:

```output
null
```

8. Measure Execution Time (Optional):
### 8. Measure Execution Time (Optional)

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

The below snippet measures how long it takes to insert documents for performance insight.
```javascript
var start = new Date()
for (let i = 0; i < 10000; i++) {
db.test.insertOne({ sample: i })
}
print("Insert duration (ms):", new Date() - start)
```
You should see an output similar to:

Sample output:

```output
Insert duration (ms): 4427
```
9. Count Total Documents:

Count total entries to confirm expected data volume.
### 9. Count Total Documents

Check the total number of documents in the collection:

```javascript
db.test.countDocuments()
```
You should see an output similar to:

Expected output:

```output
19999
```

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).

10. Clean Up (Optional):

Deletes the **baselineDB** database and all its contents.
### 10. Clean Up (Optional)

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:

```javascript
db.dropDatabase()
```
You should see an output similar to:

Expected output:

```output
{ ok: 1, dropped: 'baselineDB' }
```

The above is a destructive command that completely deletes the current database you are connected to in mongosh.

The above operations confirm that MongoDB is installed successfully and is functioning as expected on the GCP Arm64 environment.

Using **mongosh**, you validated key database operations such as **insert**, **read**, **update**, **delete**, and **count**.
Now, your MongoDB instance is ready for further benchmarking and production use.
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.
Loading