<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shrutimalgatti on Medium]]></title>
        <description><![CDATA[Stories by Shrutimalgatti on Medium]]></description>
        <link>https://medium.com/@shrutimalgatti?source=rss-8feb728be677------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ecBJ5lkf3646dvlRSvKoag.jpeg</url>
            <title>Stories by Shrutimalgatti on Medium</title>
            <link>https://medium.com/@shrutimalgatti?source=rss-8feb728be677------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 09:15:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shrutimalgatti/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AWS Aurora to Cloud SQL via Database Migration Service (DMS) on Private Service Connect interfaces]]></title>
            <link>https://medium.com/google-cloud/aws-aurora-to-cloud-sql-via-database-migration-service-dms-on-private-service-connect-interfaces-17d9a120b9b9?source=rss-8feb728be677------2</link>
            <guid isPermaLink="false">https://medium.com/p/17d9a120b9b9</guid>
            <category><![CDATA[dms]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[aroura]]></category>
            <category><![CDATA[cloud-sql]]></category>
            <dc:creator><![CDATA[Shrutimalgatti]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 06:08:02 GMT</pubDate>
            <atom:updated>2025-11-14T06:08:02.060Z</atom:updated>
            <content:encoded><![CDATA[<p>Migrating a database from <strong>Amazon Web Services (AWS) Aurora</strong> to <strong>Google Cloud SQL</strong> involves moving a core relational data workload from one major cloud provider to another. This process is part of a broader <strong>multi-cloud</strong> or <strong>GCP consolidation</strong> strategy, often driven by the desire to leverage Google Cloud’s specific strengths, such as integration with BigQuery, Vertex AI, or superior regional pricing/compliance.</p><p><strong>AWS Aurora</strong> is Amazon’s proprietary, high-performance, and fully managed relational database service (RDBMS), compatible with MySQL and PostgreSQL. <strong>Google Cloud SQL</strong> is GCP’s fully managed RDBMS offering, supporting popular open-source databases like MySQL, PostgreSQL, and SQL Server.</p><p>A <strong>Database Migration Service (DMS)</strong> is a managed, usually cloud-based, service that helps you migrate (move) your databases from a source location to a target location efficiently, securely, and with minimal downtime.</p><h4>AWS Source DB Instance Configuration</h4><ol><li>RDS user used to connect to source DB needs below permissions for DMS to extract initial dump followed by continuous replication</li></ol><pre># Example<br>CREATE USER ‘dmsuser’@’%’ IDENTIFIED BY ‘password’;<br>GRANT SELECT, LOCK TABLES, SHOW VIEW, EVENT, TRIGGER, RELOAD,EXECUTE,REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO ‘dmsuser’@’%’;</pre><p>2. For continuous replication, enable Binary Logging on source. DMS reads these logs to capture changes (inserts, updates, deletes) made to the source database after the initial snapshot and apply them to the Cloud SQL destination.</p><p>Set binlog_format=ROW <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.MySQL.BinaryFormat.html">https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.MySQL.BinaryFormat.html</a></p><p>Retain <a href="https://cloud.google.com/sql/docs/mysql/replication/replication-from-external#binary-log-retention">binary logs</a> for a long enough period to support the database migration (typically 7 days)</p><pre>call mysql.rds_set_configuration(‘binlog retention hours’, 168);</pre><p>3. Ensure database hostname of source database is &lt;60 characters or create a DNS CNAME record due to MySQL limitations</p><h4><em>GCP Destination Cloud SQL (PSC based) Instance Configuration</em></h4><p>Create private connectivity (Interconnect, or VPN or similar) between AWS and GCP Networks (Ref: <a href="https://cloud.google.com/database-migration/docs/mysql/configure-connectivity-vpns#static-routes">Configure connectivity using VPNs | Database Migration Service | Google Cloud</a>)</p><h4><a href="https://cloud.google.com/database-migration/docs/sqlserver/access-control#permissions_and_roles">IAM Roles</a> needed to perform the migration</h4><h4>a. User account that performs the migration:</h4><ol><li><a href="https://cloud.google.com/iam/docs/understanding-roles#datamigration.admin">Database Migration Admin</a> (roles/datamigration.admin)</li><li><a href="https://cloud.google.com/iam/docs/understanding-roles#storage.admin">Storage Admin</a> (roles/storage.admin)</li><li><a href="https://cloud.google.com/iam/docs/understanding-roles#cloudsql.editor">Cloud SQL Editor</a> (roles/cloudsql.editor)</li></ol><h4>b. Database Migration Service service account:</h4><ol><li><a href="https://cloud.google.com/iam/docs/roles-permissions/datamigration#datamigration.serviceAgent">Database Migration Service Agent </a>(roles/datamigration.serviceAgent)</li></ol><h4>Set temporary vars</h4><pre>PROJECT_ID=&lt;GCP_PROJECT_ID&gt;<br>DMS_JOB_NAME=&quot;aurora-to-mysql-p&quot;<br>REGION=&lt;REGION&gt;<br><br>CLOUD_SQL_INSTANCE_ID=&lt;SQL_INSTANCE_NAME&gt;<br>NETWORK_ID=&quot;projects/&lt;GCP_PROJECT_ID&gt;/global/networks/&lt;SHARED_VPC_NAME&gt;&quot;<br>SUBNET_ID=&quot;projects/&lt;GCP_PROJECT_ID&gt;/regions/&lt;REGION&gt;/subnetworks/&lt;SUBNET&gt;&quot;<br>NETWORK_ATTACHMENT_NAME=mysql-shared-nw<br><br>#Get Cloud SQL Tenant project<br>PRODUCER_PROJECT_ID=$(gcloud --project=$PROJECT_ID sql instances describe $CLOUD_SQL_INSTANCE_ID | grep pscServiceAttachmentLink | cut -f 2 -d &quot;/&quot;)</pre><h4>Enable DMS API</h4><pre>gcloud services enable datamigration.googleapis.com --project=${PROJECT_ID}</pre><p>Add a outbound Network Attachment to the Cloud SQL for the migration (ref: <a href="https://cloud.google.com/sql/docs/mysql/configure-private-service-connect#configure-psc-outbound">Connect to an instance using Private Service Connect</a>) <strong><em>This steps is crucial for PSC enabled migration</em></strong></p><p>Create Network Attachment</p><pre>gcloud compute network-attachments create $NETWORK_ATTACHMENT_NAME --region=$REGION --connection-preference=ACCEPT_MANUAL --subnets=$SUBNET_ID --project $PROJECT_ID</pre><p>Update NA to allow-list CloudSQL PSC enabled instance’s producer project</p><pre>gcloud compute network-attachments update $NETWORK_ATTACHMENT_NAME --region=$REGION --producer-accept-list=$PRODUCER_PROJECT_ID --project $PROJECT_ID</pre><p><strong>Update Network Attachment in Cloud SQL</strong></p><ol><li>NOTE: Cloud SQL network attachments enable bi-directional communication enabling Cloud SQL to connect to the source DB to migrate the data, as of July 2025 this feature is in Private Preview and so it requires gcloud beta CLI with below versions (no UI or Terraform support yet)</li></ol><p>Google Cloud SDK 521.0.0, <strong>beta 2025.05.02</strong></p><pre>gcloud beta sql instances patch $CLOUD_SQL_INSTANCE_ID --psc-network-attachment-uri=projects/$PROJECT_ID/regions/$REGION/networkAttachments/$NETWORK_ATTACHMENT_NAME --project=$PROJECT_ID</pre><p>Verify the network attachment</p><pre>gcloud sql instances describe $CLOUD_SQL_INSTANCE_ID --project $PROJECT_ID | grep pscConfig -A 5</pre><h4>Setup DMS Job</h4><p>Create source profile (Created using UI since gcloud doesn’t support Aurora MySQL source)</p><ol><li>Use ${DMS_JOB_NAME}-src as the name of the connection profile</li><li>Set the Hostname or IP address and Port for source MySql Instance</li><li>Set the username and password configured in Step 1 on source instance.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xEj_jYzVlV7r4D1ul8uXiw.png" /></figure><p>Create target profile</p><pre>gcloud database-migration connection-profiles \<br>create mysql &quot;${DMS_JOB_NAME}-dst&quot; \<br>  --no-async \<br>  --cloudsql-instance=${CLOUD_SQL_INSTANCE_ID} \<br>  --region=$REGION \<br>  --display-name=&quot;${DMS_JOB_NAME}-dst&quot; \<br>  --project=${PROJECT_ID}<br><br></pre><p>Create migration job</p><p>If doing this via UI, select <strong>PSC Interface</strong> in the connectivity options (ref: <a href="https://cloud.google.com/database-migration/docs/mysql/configure-connectivity-vpc-peering#psc-interfaces">Configure connectivity using VPC peering</a>)</p><pre>gcloud database-migration migration-jobs \<br>create ${DMS_JOB_NAME} \<br>  --no-async \<br>  --region=$REGION \<br>  --display-name=$DMS_JOB_NAME \<br>  --source=&quot;${DMS_JOB_NAME}-src&quot; \<br>  --destination=&quot;${DMS_JOB_NAME}-dst&quot; \<br>  --type=CONTINUOUS \<br>  --project=$PROJECT_ID</pre><p>For the migration, DMS requires destination DB Instance to be a <strong>read replica</strong>, this can be done using the demote-destination command:</p><pre>gcloud database-migration migration-jobs demote-destination ${DMS_JOB_NAME} --region=${REGION} --project ${PROJECT_ID}</pre><p>Verify/Test the connections for migration job</p><pre>gcloud database-migration migration-jobs verify $DMS_JOB_NAME --region=$REGION --project $PROJECT_ID</pre><p>Start the migration job</p><p>When the job status initially changes to Starting | Waiting for source writes to stop, disable replication from the AWS primary and its replica for about 20 seconds.</p><p>After the status of the migration job changes to Running | Full dump in progress, re-enable replication to the read replica in AWS</p><p>Stop all DDL operations on source (ALTER, DROP, TRUNCATE, CREATE) when migration status is ‘Running | Full dump in progress’ to avoid breaking the migration process.</p><pre>gcloud database-migration migration-jobs start $DMS_JOB_NAME --region=$REGION --project $PROJECT_ID</pre><p><strong>Performing Cutover by promoting the migration job</strong></p><ol><li>Assumption: Application is already migrated to GCP and is already configured to read from CloudSql instead of RDS</li><li>Once the migration job reaches the Change Data Capture (CDC) phase, promote the destination database instance from a read replica to a standalone/writeable instance</li><li>Wait for the DMS job to enter CDC and the replication delay to decrease significantly</li><li>Stop all writes, running scripts, and client connections to the source database</li><li>Wait until the replication delay is 0, which means that the migration job has finished processing all changes</li><li>Run the below command to promote, or click “Promote” in GCP Console UI</li></ol><pre>gcloud database-migration migration-jobs promote $DMS_JOB_NAME - region=$REGION</pre><h4>Challenges with AWS AURORA migration</h4><p>AWS Aurora doesnt not support enabling binlog on read replica instance, for DMS job to start disable writes on the primary replica for about 20 seconds, this would mean a downtime of 20 sec to users.</p><p>If no downtime or zero user disruptions needed , apply a firewall to stop writes for 20 sec.</p><h4>Known limitations of DMS and troubleshooting steps</h4><ol><li><a href="https://cloud.google.com/database-migration/docs/mysql/diagnose-issues#existing-instance-terraform-config-drift">Terraform configuration drift</a> : Database Migration Service will modify some destination database settings for migrations to existing databases during migration. Re-apply terraform once the job is promoted and migration is completed.</li></ol><p>2. For an existing destination instance DMS can migrate only if the destination db is empty and has no user data. <a href="https://cloud.google.com/database-migration/docs/mysql/diagnose-issues#clear-ext-instance-data-steps">Steps to clear existing user data</a>.</p><p>3. Database Migration Service doesn’t migrate the mysql performance_schema, information_schema, ndbinfo, or sys system schemas. The migration job might fail if the source database contains <strong>objects that reference tables from any of these schemas</strong>.</p><p><a href="https://cloud.google.com/database-migration/docs/mysql/diagnose-issues">3. Guide</a> for diagnosing common issues and resolving them</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17d9a120b9b9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/aws-aurora-to-cloud-sql-via-database-migration-service-dms-on-private-service-connect-interfaces-17d9a120b9b9">AWS Aurora to Cloud SQL via Database Migration Service (DMS) on Private Service Connect interfaces</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Data Build Tool Project Artifacts using google ADK]]></title>
            <link>https://medium.com/google-cloud/build-data-build-tool-project-artifacts-using-google-adk-051ea7584656?source=rss-8feb728be677------2</link>
            <guid isPermaLink="false">https://medium.com/p/051ea7584656</guid>
            <category><![CDATA[dbt]]></category>
            <category><![CDATA[agent-development-kit]]></category>
            <category><![CDATA[vertex-ai]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[bigquery]]></category>
            <dc:creator><![CDATA[Shrutimalgatti]]></dc:creator>
            <pubDate>Fri, 07 Nov 2025 09:21:20 GMT</pubDate>
            <atom:updated>2025-11-07T09:21:20.582Z</atom:updated>
            <content:encoded><![CDATA[<h4>Automating the Entire DBT Lifecycle using AI Agent</h4><p><em>Written by: Shruti Malgatti , Reviewed by: Gaurav Khandelwal</em></p><h3>What is Data Build Tool</h3><p>The Data Build Tool (dbt) is an open-source command-line tool that enables data analysts and engineers to effectively transform data directly within their data warehouse.</p><p>dbt’s core philosophy is to bring software engineering best practices (like modularity, version control, testing, and documentation) to the world of data analytics and data modeling, all while using the language most familiar to data professionals SQL.</p><h3><strong>Automating DBT Lifecycle using AI Agent</strong></h3><p>In the high-stakes world of enterprise data operations, the speed at which you can transform raw data into actionable insights is the ultimate competitive advantage. We have successfully standardized modern data transformation with <strong>dbt (data build tool)</strong> and powerful warehouses like <strong>BigQuery</strong>. Yet, a critical bottleneck remains: the manual, repetitive grind of the development lifecycle.</p><p>Today’s data engineers still spend countless hours manually translating source-to-target mapping documents into boilerplate code — painstakingly writing models, defining schema YAML files, and crafting repetitive test scripts. This manual “grunt work” doesn’t just slow down delivery; it introduces human error and pulls valuable engineering talent away from high-value architectural tasks.</p><p>It’s time to automate the ‘T’ in ELT. Enter the <strong>DBT Agent</strong>.</p><p>The DBT Agent is an autonomous, agentic tool designed to revolutionize how we approach BigQuery data transformation. By automating the entire development lifecycle, it instantly translates your mapping requirements into a complete, enterprise-ready, and fully runnable dbt project. From generating compliant models and snapshots to auto-creating comprehensive test plans and documentation, the DBT Agent doesn’t just assist developers — it accelerates them, ensuring best practices are met while drastically reducing time-to-production.</p><h3>What is Google ADK?</h3><p>The <strong>Google Agent Development Kit (ADK)</strong> is a framework designed to simplify building complex AI agents powered by <strong>large language models (LLMs)</strong>. It lets developers define an agent’s behavior, specify its LLM, and equip it with <strong>tools</strong> (functions/APIs) for external actions. A key strength is its support for creating agent hierarchies, often using a <strong>“coordinator-worker” pattern</strong>, where a high-level agent delegates tasks to specialized worker agents. This modular design makes agents easier to develop, debug, and scale compared to building a single, all-encompassing system.</p><h3>Capabilities of DBT Agent</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1gZ-qxRy0IX_4vJ0nMj5w.png" /><figcaption>DBT Agent Flow</figcaption></figure><p>Intelligent agent that automates the creation and validation of dbt (data build tool) projects. Given a source-to-target mapping (STTM) file, the agent can autonomously generate a complete, runnable dbt project, including models, schemas, and tests.</p><p><strong>Autonomous dbt Project Generation: </strong>The agent follows a comprehensive 9-step process to build and validate a dbt project:</p><ol><li>Generate `schema.yml`</li></ol><p>2. Generate `profiles.yml`</p><p>3. Generate dbt model SQL files</p><p>4. Generate `dbt_project.yml`</p><p>5. Run and validate the dbt project (with self-correction)</p><p>6. Generate a test plan</p><p>7. Generate test scripts from the plan</p><p>8. Run and validate the dbt tests (with self-correction)</p><p>9. Generate a final, downloadable test report</p><p><strong>On-Demand Artifact Generation:</strong> The agent can also generate specific dbt artifacts, such as snapshots, on request.</p><p><strong>Multiple Interfaces:</strong> Interact with the agent through a command-line interface (CLI), a Gradio-based web UI, or the Agent Development Kit (ADK) playground.</p><p><strong>Self-Correction: </strong>The agent can identify and fix errors during dbt project and test runs.</p><h3>Setting Up Your Environment</h3><h3>Install the Google ADK</h3><p>Open your terminal or Cloud Workstation command line and run the following command to install the necessary Python library from PyPI:</p><pre>pip install google-adk</pre><p>This command fetches and installs the core ADK library and its dependencies, giving you access to the classes and functions needed to define your agents and tools.</p><h3>Authenticate with Google Cloud</h3><p>Create a file named `.env` and add the following variables.</p><pre>* **For API Key usage:**<br>```bash<br># If using API key: ML Dev backend config.<br>GOOGLE_API_KEY=YOUR_VALUE_HERE<br>GOOGLE_GENAI_USE_VERTEXAI=false<br>```<br>* **For Vertex AI on GCP:**<br>```bash<br># If using Vertex on GCP: Vertex backend config<br>GOOGLE_CLOUD_PROJECT=YOUR_VALUE_HERE<br>GOOGLE_CLOUD_LOCATION=YOUR_VALUE_HERE<br>GOOGLE_GENAI_USE_VERTEXAI=true</pre><p>If you plan to use Google Cloud services, such as Vertex AI for accessing powerful LLMs like Gemini, you’ll need to authenticate your development environment. This command sets up your application default credentials, allowing your code running in the environment to access Google Cloud resources securely:</p><pre>gcloud auth application-default login</pre><p>Follow the prompts to log in with your Google account. This step is crucial if GOOGLE_GENAI_USE_VERTEXAI is set to &quot;TRUE&quot; in your environment configuration.</p><h3>Project Structure</h3><p>Code and project artifacts can be found in</p><p><a href="https://github.com/shrutimalgatti/dbt-query-generator.git">https://github.com/shrutimalgatti/dbt-query-generator.git</a></p><h3>Running the Agent</h3><p>With the .env, __init__.py, and agent.py files correctly set up in your europe_property_investor directory, you can now run your agent using the ADK command-line interface. Navigate in your terminal to the directory <em>containing</em> your europe_property_investor folder and execute the following command:</p><pre>adk web</pre><p>This command does several things: it finds the root_agent defined in your package (thanks to the __init__.py file), initializes it, and starts a local web server. This server provides a simple chat interface in your web browser, allowing you to interact directly with your root_agent.</p><p>Once the server is running (usually accessible at <a href="http://localhost:8000/">http://localhost:8000</a>), open your web browser and navigate to the provided address. You&#39;ll see a chat window where you can type your queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EazXWQNfXnubZdaqZl_2ng.png" /><figcaption>ADK web UI</figcaption></figure><h3>Spinning up frontend</h3><p>For a more <strong>user-friendly experience</strong>, a frontend — such as one built with <strong>Gradio or Streamlit</strong> — can be deployed. This serves as an interactive chat interface, with the <strong>dbt ADK Agent operating seamlessly in the background</strong> to handle the requests.</p><pre>python app.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0QrYLXIeXuqm2CG4B4yRLA.png" /></figure><h3>Demo</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*uIAVRw4fwOIjuXTwdAk74A.gif" /><figcaption>Agent in action</figcaption></figure><h3>Conclusion</h3><p>This practical demonstration using the Google Agent Development Kit illustrates how you can build intelligent agents with structured behavior. By defining specialized tools and organizing agents in a hierarchical coordinator-worker pattern, you can create applications that are modular, maintainable, and capable of handling complex, domain-specific queries.</p><p>The agent significantly <strong>reduces manual effort</strong> by automating the translation of Source-to-Target Mappings (STTM) into complete <strong>dbt artifacts</strong> (models, schemas, and configurations). This automated generation accelerates the design phase by ensuring the code is <strong>instantly compliant</strong> with best practices, thus minimizing time spent on code reviews and debugging. Furthermore, the agent boosts data reliability by autonomously generating comprehensive <strong>dbt test scripts and test cases</strong>, and it <strong>streamlines the development lifecycle</strong> through automated execution of dbt model validation and unit testing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=051ea7584656" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/build-data-build-tool-project-artifacts-using-google-adk-051ea7584656">Build Data Build Tool Project Artifacts using google ADK</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Importing data from GCS to MongoDB using Java & Dataproc Serverless]]></title>
            <link>https://medium.com/google-cloud/importing-data-from-gcs-to-mongodb-using-java-dataproc-serverless-6ff5c8d6f6d5?source=rss-8feb728be677------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ff5c8d6f6d5</guid>
            <category><![CDATA[dataproc-serverless]]></category>
            <category><![CDATA[cloud-storage]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Shrutimalgatti]]></dc:creator>
            <pubDate>Tue, 30 Apr 2024 09:14:41 GMT</pubDate>
            <atom:updated>2024-04-30T09:14:41.634Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MyiX9jPxy2RefZBk3J7vZA.png" /></figure><p>In today’s data-driven world, cloud-based storage solutions like Google Cloud Storage (GCS) Buckets have become increasingly popular. GCS Buckets offer a simple and scalable way to store massive amounts of data, regardless of file type, making it a cost-effective choice for businesses handling terabytes of information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*sJd7N193VJjRt3uWSg9WEA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*ITp9BII0SYzXxVs-vx-EFA.png" /></figure><p>MongoDB, a popular NoSQL database known for its flexibility with unstructured data, is often the destination for large-scale data imports from cloud storage like Google Cloud Storage (GCS). While JSON is a common format, the challenge lies in importing data that’s not in JSON.</p><p>This article will guide you through a solution using Dataproc Serverless, a managed Apache Spark service, to import data of any file format from GCS into your MongoDB collections seamlessly.</p><h3>Key Benefits</h3><ol><li>Use <strong>Dataproc Serverless</strong> to run Spark batch workloads without managing Spark framework. Batch size is also configurable in this template.</li><li><strong>GCSToMONGO</strong> Template is open source, configuration driven, and ready to use. Only MongoDB and GCS credentials are required to execute the code.</li><li>Supported File formats are JSON, Avro, Parquet and CSV.</li></ol><p><strong>Required JAR files</strong></p><p><a href="https://www.mongodb.com/products/spark-connector">MongoDB Spark Connector</a> and <a href="https://jar-download.com/?search_box=mongo-java-driver">MongoDB Java Driver</a></p><p>Usage</p><p>1. Create a GCS bucket and staging location for jar files.</p><p>2. Clone git repo in a cloud shell which is pre-installed with <a href="https://cloud.google.com/shell/docs/how-cloud-shell-works">various tools</a>. Alternatively use any machine pre-installed with JDK 8+, Maven and Git.</p><pre>git clone https://github.com/GoogleCloudPlatform/dataproc-templates.git<br>cd dataproc-templates/python</pre><p>3. Obtain authentication credentials (to submit the job).</p><pre>gcloud auth application-default login</pre><p>4. Configure the Dataproc Serverless job by exporting the variables needed for submission —</p><p>GCP_PROJECT : GCP project id to run Dataproc Serverless on</p><p>REGION : Region to run Dataproc Serverless in</p><p>GCS_STAGING_LOCATION : GCS staging bucket location, created in Step 3</p><p>SUBNET : The VPC subnet to run Dataproc Serverless on, if not using the default subnet (format: <em>projects/&lt;project_id&gt;/regions/&lt;region&gt;/subnetworks/&lt;subnetwork&gt;)</em></p><pre>export GCP_PROJECT=&lt;project-id&gt;\<br>export REGION=&lt;region&gt;\<br>export SUBNET=&lt;subnet&gt;\<br>export GCS_STAGING_LOCATION=&lt;gcs-staging-location-folder&gt;\<br>export JARS=&lt;gcs-location-to-mongodb-drivers&gt;\<br><br>bin/start.sh \<br>-- --template GCSTOMONGO \<br>--templateProperty log.level=&quot;ERROR&quot; \<br>--templateProperty gcs.mongodb.input.format=&lt;csv|avro|parquet|json&gt; \<br>--templateProperty gcs.mongodb.input.location=&lt;gcs-input-location&gt; \<br>--templateProperty gcs.mongodb.output.uri=&lt;mongodb-output-uri&gt; \<br>--templateProperty gcs.mongodb.output.database=&lt;database-name&gt;\<br>--templateProperty gcs.mongodb.output.collection=&lt;collection-name&gt; \<br>--templateProperty gcs.mongo.output.mode=&lt;Append|Overwrite|ErrorIfExists|Ignore&gt;</pre><p>Arguments:</p><ul><li>templateProperty mongo.gcs.input.format: GCS Input File Format (one of: avro,parquet,csv,json)</li><li>templateProperty mongo.gcs.input.location: GCS Location to put Input Files (format: gs://BUCKET/...)</li><li>templateProperty mongo.gcs.output.uri : MongoDB Connection String as an Input URI (format: mongodb://host_name:port_no)</li><li>templateProperty mongo.gcs.output.database : MongoDB Database Name (format: Database_name)</li><li>templateProperty mongo.gcs.output.collection: MongoDB Input Collection Name (format: Collection_name)</li><li>templateProperty mongo.gcs.output.mode: Output write mode (one of: append,overwrite,ignore,errorifexists) (Defaults to append)</li></ul><p>6. Monitor the Spark batch job</p><p>After submitting the job, you will be able to view the job in the Dataproc Batch UI. From there, we can view both metrics and logs for the job.</p><h3>References</h3><ul><li><a href="https://cloud.google.com/dataproc-serverless/docs/overview">Dataproc Serverless Documentation</a></li><li><a href="https://github.com/GoogleCloudPlatform/dataproc-templates">Dataproc Templates GitHub Repository</a></li><li><a href="https://medium.com/google-cloud/importing-data-from-gcs-to-mongodb-using-dataproc-serverless-fed58904633a">https://medium.com/google-cloud/importing-data-from-gcs-to-mongodb-using-dataproc-serverless-fed58904633a</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ff5c8d6f6d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/importing-data-from-gcs-to-mongodb-using-java-dataproc-serverless-6ff5c8d6f6d5">Importing data from GCS to MongoDB using Java &amp; Dataproc Serverless</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrate data from Cassandra to BigQuery Using Java and Dataproc Serverless]]></title>
            <link>https://medium.com/google-cloud/migrate-data-from-cassandra-to-bigquery-using-java-and-dataproc-serverless-926110c44413?source=rss-8feb728be677------2</link>
            <guid isPermaLink="false">https://medium.com/p/926110c44413</guid>
            <category><![CDATA[dataproc-serverless]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[bigquery]]></category>
            <category><![CDATA[cassandra]]></category>
            <dc:creator><![CDATA[Shrutimalgatti]]></dc:creator>
            <pubDate>Mon, 22 Apr 2024 09:01:28 GMT</pubDate>
            <atom:updated>2024-04-22T09:01:28.459Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MyiX9jPxy2RefZBk3J7vZA.png" /></figure><p>In this post we will explore how to extract data from Cassandra to BigQuery using Dataproc serverless pre-built templates</p><p>The <a href="https://github.com/GoogleCloudPlatform/dataproc-templates/blob/main/README.md">Dataproc Templates</a> provide a flexible and easy-to-use mechanism for managing and executing use cases on Dataproc serverless without the need to develop them.</p><p>Cassandra is an open-source NoSQL distributed database that manages large amounts of data across commodity servers. It is a decentralized, scalable storage system designed to handle vast volumes of data across multiple commodity servers, providing high availability without a single point of failure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*KlQ9wlBytTOrfBRKXczbUQ.png" /></figure><h3>Key Benefits</h3><ol><li>These templates are open source and can be used by anyone for their workload migration.</li><li>These templates are customisable in nature. It means that, the GitHub repository could be clone very easily and can be used ahead as per our requirement by doing the corresponding code changes.</li><li>Dataproc Serverless design frees up the developer from the headache of managing a Dataproc cluster.</li><li>Supported File formats are JSON, Avro, Parquet and CSV.</li><li>These templates are configuration driven and can be used for similar use cases very easily by just changing the connection parameters.</li></ol><h3>Pre-requisites</h3><p>For running these templates, we will need:</p><ul><li>The Google Cloud SDK installed and authenticated</li><li>A VPC subnet with Private Google Access enabled. The default subnet is suitable, as long as Private Google Access was enabled.</li></ul><p><strong>Steps to Run the Template</strong></p><ol><li>Create a GCS bucket for staging location.</li><li>Clone git repo in a cloud shell which is pre-installed with <a href="https://cloud.google.com/shell/docs/how-cloud-shell-works">various tools</a>. Alternatively use any machine pre-installed with JDK 8+, Maven and Git.</li></ol><pre>git clone https://github.com/GoogleCloudPlatform/dataproc-templates.git<br>cd dataproc-templates/java</pre><p>3. Ensure you have enabled the subnet with Private Google Access. If you are using “default” VPC created by GCP, you will still have to enable private access as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/0*8h8iHu3WpFq2YR5g.jpeg" /></figure><pre>gcloud compute networks subnets update default --region=us-central1 --enable-private-ip-google-access</pre><p>4. Authenticate the GCloud CLI credentials.</p><pre>gcloud auth login</pre><p>5. Configure the Dataproc Serverless job by exporting the variables needed for submission</p><p>GCP_PROJECT : GCP project id to run Dataproc Serverless on</p><p>REGION : Region to run Dataproc Serverless in</p><p>GCS_STAGING_LOCATION : GCS staging bucket location, created in Step 3</p><p>SUBNET : The VPC subnet to run Dataproc Serverless on, if not using the default subnet (format: <em>projects/&lt;project_id&gt;/regions/&lt;region&gt;/subnetworks/&lt;subnetwork&gt;)</em></p><pre>export REGION=&lt;gcp-region&gt;<br>export GCP_PROJECT=&lt;gcp-project-id&gt;<br>export GCS_STAGING_LOCATION=&lt;gcs-staging-location&gt;<br>export JOB_TYPE=SERVERLESS <br>export SUBNET=&lt;dataproc-serverless-subnet&gt;</pre><pre>bin/start.sh \<br>-- --template CASSANDRATOBQ \<br>--templateProperty project.id=&lt;gcp-project-id&gt; \<br>--templateProperty cassandratobq.input.keyspace=&lt;keyspace-name&gt; \<br>--templateProperty cassandratobq.input.table=&lt;input-table-name&gt; \<br>--templateProperty cassandratobq.input.host=&lt;cassandra-host-ip&gt; \<br>--templateProperty cassandratobq.bigquery.location=&lt;dataset&gt;.&lt;table-name&gt; \<br>--templateProperty cassandratobq.output.mode=&lt;Append|Overwrite|ErrorIfExists|Ignore&gt; \<br>--templateProperty cassandratobq.temp.gcs.location=&lt;gcs-bucket-name&gt;</pre><ul><li>templateProperty cassandratobq.input.keyspace: namespace defined in Cassandra DB</li><li>templateProperty cassandratobq.input.table : table name in cassandra to query</li><li>templateProperty cassandratobq.input.host : cassandra host ip address</li><li>templateProperty cassandratobq.bigquery.location : dataset name and table name in bigquery to load</li><li>templateProperty output.mode : Output write mode (one of: append,overwrite,ignore,errorifexists) (Defaults to append)</li><li>templateProperty cassandratobq.temp.gcs.location : Temp cloud storage bucket name</li></ul><p>Additional parameters that can be passed are below</p><pre>--templateProperty cassandratogcs.input.catalog.name=&lt;catalog-name&gt;<br>--templateProperty cassandratogcs.input.query=&quot;select * from &lt;catalog-name&gt;.&lt;keyspace-name&gt;.&lt;table-name&gt;&quot;</pre><ul><li>templateProperty cassandratogcs.input.catalog.name : Cassandra connection name (default value : casscon)</li></ul><p>6. Monitor the Spark batch job</p><p>After submitting the job, you will be able to view the job in the Dataproc Batch UI. From there, we can view both metrics and logs for the job.</p><h3>References</h3><ul><li><a href="https://cloud.google.com/dataproc-serverless/docs/overview">Dataproc Serverless Documentation</a></li><li><a href="https://github.com/GoogleCloudPlatform/dataproc-templates">Dataproc Templates GitHub Repository</a></li></ul><p>For any queries or suggestions reach out to: dataproc-templates-support-external@googlegroups.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=926110c44413" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/migrate-data-from-cassandra-to-bigquery-using-java-and-dataproc-serverless-926110c44413">Migrate data from Cassandra to BigQuery Using Java and Dataproc Serverless</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrate data from Cassandra to GCS Using Java and Dataproc Serverless]]></title>
            <link>https://medium.com/google-cloud/migrate-data-from-cassandra-to-gcs-using-java-and-dataproc-serverless-5358ef498f6b?source=rss-8feb728be677------2</link>
            <guid isPermaLink="false">https://medium.com/p/5358ef498f6b</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[dataproc-serverless]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[cassandra]]></category>
            <category><![CDATA[gcp-app-dev]]></category>
            <dc:creator><![CDATA[Shrutimalgatti]]></dc:creator>
            <pubDate>Wed, 06 Dec 2023 04:35:16 GMT</pubDate>
            <atom:updated>2023-12-06T04:35:16.641Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PmR1uioZLAFia5eS.jpeg" /></figure><p>In this post we will explore how to extract data from Cassandra to GCS using Dataproc serverless pre-built templates</p><p>The <a href="https://github.com/GoogleCloudPlatform/dataproc-templates/blob/main/README.md">Dataproc Templates</a> provide a flexible and easy-to-use mechanism for managing and executing use cases on Dataproc serverless without the need to develop them.</p><p>Cassandra is an open-source NoSQL distributed database that manages large amounts of data across commodity servers. It is a decentralized, scalable storage system designed to handle vast volumes of data across multiple commodity servers, providing high availability without a single point of failure</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4bYX30cmJ9bzJdiT.jpeg" /></figure><h3>Key Benefits</h3><ol><li>These templates are open source and can be used by anyone for their workload migration.</li><li>These templates are customisable in nature. It means that, the GitHub repository could be clone very easily and can be used ahead as per our requirement by doing the corresponding code changes.</li><li>Dataproc Serverless design frees up the developer from the headache of managing a Dataproc cluster.</li><li>Supported File formats are JSON, Avro, Parquet and CSV.</li><li>These templates are configuration driven and can be used for similar use cases very easily by just changing the connection parameters.</li></ol><h3>Pre-requisites</h3><p>For running these templates, we will need:</p><ul><li>The Google Cloud SDK installed and authenticated</li><li>A VPC subnet with Private Google Access enabled. The default subnet is suitable, as long as Private Google Access was enabled.</li></ul><p><strong>Steps to Run the Template</strong></p><ol><li>Create a GCS bucket for staging location.</li><li>Clone git repo in a cloud shell which is pre-installed with <a href="https://cloud.google.com/shell/docs/how-cloud-shell-works">various tools</a>. Alternatively use any machine pre-installed with JDK 8+, Maven and Git.</li></ol><pre>git clone https://github.com/GoogleCloudPlatform/dataproc-templates.git<br>cd dataproc-templates/java</pre><p>3. Ensure you have enabled the subnet with Private Google Access. If you are using “default” VPC created by GCP, you will still have to enable private access as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/0*py-eOTqZQ8pE7XJ-.jpeg" /></figure><pre>gcloud compute networks subnets update default --region=us-central1 --enable-private-ip-google-access</pre><p>4. Authenticate the GCloud CLI credentials.</p><pre>gcloud auth login</pre><p>5. Configure the Dataproc Serverless job by exporting the variables needed for submission</p><p>GCP_PROJECT : GCP project id to run Dataproc Serverless on</p><p>REGION : Region to run Dataproc Serverless in</p><p>GCS_STAGING_LOCATION : GCS staging bucket location, created in Step 3</p><p>SUBNET : The VPC subnet to run Dataproc Serverless on, if not using the default subnet (format: <em>projects/&lt;project_id&gt;/regions/&lt;region&gt;/subnetworks/&lt;subnetwork&gt;)</em></p><pre>export REGION=&lt;gcp-region&gt;<br>export GCP_PROJECT=&lt;gcp-project-id&gt;<br>export GCS_STAGING_LOCATION=&lt;gcs-staging-location&gt;<br>export JOB_TYPE=SERVERLESS <br>export SUBNET=&lt;dataproc-serverless-subnet&gt;</pre><pre>bin/start.sh \<br>-- --template CASSANDRATOGCS \<br>--templateProperty project.id=&lt;gcp-project-id&gt; \<br>--templateProperty cassandratogcs.input.keyspace=&lt;keyspace-name&gt; \<br>--templateProperty cassandratogcs.input.table=&lt;input-table-name&gt; \<br>--templateProperty cassandratogcs.input.host=&lt;cassandra-host-ip&gt; \<br>--templateProperty cassandratogcs.output.format=&lt;avro|csv|parquet|json|orc&gt; \<br>--templateProperty cassandratogcs.output.savemode=&lt;Append|Overwrite|ErrorIfExists|Ignore&gt; \<br>--templateProperty cassandratogcs.output.path=&lt;gcs-output-path&gt;</pre><p>Arguments:</p><ul><li>templateProperty cassandratogcs.input.keyspace: namespace defined in Cassandra DB</li><li>templateProperty cassandratogcs.input.table : table name in cassandra to query</li><li>templateProperty cassandratogcs.input.host : cassandra host ip address</li><li>templateProperty mongo.gcs.output.format: GCS Output File Format (one of: avro,parquet,csv,json)</li><li>templateProperty mongo.gcs.output.location: GCS Location to put Output Files (format: gs://BUCKET/...)</li><li>templateProperty mongo.gcs.output.mode: Output write mode (one of: append,overwrite,ignore,errorifexists) (Defaults to append)</li></ul><p>Additional parameters that can be passed are below</p><pre>--templateProperty cassandratogcs.input.catalog.name=&lt;catalog-name&gt;<br>--templateProperty cassandratogcs.input.query=&quot;select * from &lt;catalog-name&gt;.&lt;keyspace-name&gt;.&lt;table-name&gt;&quot;</pre><ul><li>templateProperty cassandratogcs.input.catalog.name : Cassandra connection name (default value : casscon)</li></ul><p>6. Monitor the Spark batch job</p><p>After submitting the job, you will be able to view the job in the Dataproc Batch UI. From there, we can view both metrics and logs for the job.</p><h3>References</h3><ul><li><a href="https://cloud.google.com/dataproc-serverless/docs/overview">Dataproc Serverless Documentation</a></li><li><a href="https://github.com/GoogleCloudPlatform/dataproc-templates">Dataproc Templates GitHub Repository</a></li><li><a href="https://medium.com/google-cloud/export-data-from-cassandra-to-google-cloud-storage-using-dataproc-serverless-2569a00e17fe">https://medium.com/google-cloud/export-data-from-cassandra-to-google-cloud-storage-using-dataproc-serverless-2569a00e17fe</a></li></ul><p>For any queries or suggestions reach out to: dataproc-templates-support-external@googlegroups.com</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5358ef498f6b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/migrate-data-from-cassandra-to-gcs-using-java-and-dataproc-serverless-5358ef498f6b">Migrate data from Cassandra to GCS Using Java and Dataproc Serverless</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating data from Mongo to GCS using Java and Dataproc Serverless template]]></title>
            <link>https://medium.com/google-cloud/migrating-data-from-mongo-to-gcs-using-java-and-dataproc-serverless-template-390500481804?source=rss-8feb728be677------2</link>
            <guid isPermaLink="false">https://medium.com/p/390500481804</guid>
            <category><![CDATA[gcp-app-dev]]></category>
            <category><![CDATA[cloud-storage]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[dataproc-serverless]]></category>
            <dc:creator><![CDATA[Shrutimalgatti]]></dc:creator>
            <pubDate>Mon, 20 Nov 2023 07:34:06 GMT</pubDate>
            <atom:updated>2023-11-20T07:34:06.427Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SesceFx_1IKQ-M11Hyt0oA.jpeg" /></figure><p>Dataproc is a managed Spark and Hadoop service that lets you take advantage of open source data tools for batch processing, querying, streaming, and machine learning</p><p>The <a href="https://github.com/GoogleCloudPlatform/dataproc-templates/blob/main/README.md">Dataproc Templates</a> provide a flexible and easy-to-use mechanism for managing and executing use cases on Dataproc serverless without the need to develop them.</p><p>These templates implement common Spark workloads, lets you customize and run them easily.</p><h3>Pre-requisites</h3><p>For running these templates, we will need:</p><ul><li>The Google Cloud SDK installed and authenticated</li><li>A VPC subnet with Private Google Access enabled. The default subnet is suitable, as long as Private Google Access was enabled.</li></ul><p>In this post we will explore how to extract data from Mongo db to GCS using Dataproc serverless pre-built templates</p><p>MongoDB is an open-source document database built on a horizontal scale-out architecture that uses a flexible schema for storing data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*ITp9BII0SYzXxVs-vx-EFA.jpeg" /></figure><h3>Key Benefits</h3><ol><li>These templates are open source and can be used by anyone for their workload migration.</li><li>These templates are customisable in nature. It means that, the GitHub repository could be clone very easily and can be used ahead as per our requirement by doing the corresponding code changes.</li><li>Dataproc Serverless design frees up the developer from the headache of managing a Dataproc cluster.</li><li>Supported File formats are JSON, Avro, Parquet and CSV.</li><li>These templates are configuration driven and can be used for similar use cases very easily by just changing the connection parameters.</li></ol><p><strong>Required JAR files</strong></p><p><a href="https://www.mongodb.com/products/spark-connector">MongoDB Spark Connector</a> and <a href="https://jar-download.com/?search_box=mongo-java-driver">MongoDB Java Driver</a></p><p><strong>Steps to Run the Template</strong></p><ol><li>Create a GCS bucket for staging location and place required JAR files.</li><li>Clone git repo in a cloud shell which is pre-installed with <a href="https://cloud.google.com/shell/docs/how-cloud-shell-works">various tools</a>. Alternatively use any machine pre-installed with JDK 8+, Maven and Git.</li></ol><pre>git clone https://github.com/GoogleCloudPlatform/dataproc-templates.git<br>cd dataproc-templates/java</pre><p>3. Ensure you have enabled the subnet with Private Google Access. If you are using “default” VPC created by GCP, you will still have to enable private access as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/285/1*yD2_7qP7RN4G5e_CLqUT4g.jpeg" /></figure><pre>gcloud compute networks subnets update default --region=us-central1 --enable-private-ip-google-access</pre><p>4. Authenticate the GCloud CLI credentials.</p><pre>gcloud auth login</pre><p>5. Configure the Dataproc Serverless job by exporting the variables needed for submission —</p><p>GCP_PROJECT : GCP project id to run Dataproc Serverless on</p><p>REGION : Region to run Dataproc Serverless in</p><p>GCS_STAGING_LOCATION : GCS staging bucket location, created in Step 3</p><p>SUBNET : The VPC subnet to run Dataproc Serverless on, if not using the default subnet (format: <em>projects/&lt;project_id&gt;/regions/&lt;region&gt;/subnetworks/&lt;subnetwork&gt;)</em></p><pre>export GCP_PROJECT=&lt;gcp-project-id&gt;<br>export SUBNET=&lt;dataproc-serverless-subnet&gt;<br>export GCS_STAGING_LOCATION=&lt;gcs-staging-location&gt;<br>export REGION=&lt;gcp-region&gt;<br>export JARS=&quot;gs://{jar-bucket}/mongo_dependencies_mongo-java-driver-3.9.1.jar,gs://{jar-bucket}/kafka-clients-2.8.0.jar,gs://{jar-bucket}/commons-pool2-2.6.2.jar,gs://{jar-bucket}/mongo_dependencies_mongo-spark-connector-10.0.5.jar&quot;<br>./bin/start.sh \<br>-- --template=MONGOTOGCS \<br>    --templateProperty mongo.gcs.input.uri=&lt;mongo-uri&gt; \<br>    --templateProperty mongo.gcs.input.database=&lt;input-database&gt; \<br>    --templateProperty mongo.gcs.input.collection=&lt;input-collection&gt; \<br>    --templateProperty mongo.gcs.output.format=&lt;avro|parquet|csv|json&gt; \<br>    --templateProperty mongo.gcs.output.location=&lt;gcs-output-location&gt; \<br>    --templateProperty mongo.gcs.output.mode=&lt;append|overwrite|ignore|errorifexists&gt;</pre><p>Arguments:</p><ul><li>templateProperty mongo.gcs.input.uri: MongoDB Connection String as an Input URI (format: mongodb://host_name:port_no)</li><li>templateProperty mongo.gcs.input.database: MongoDB Database Name (format: Database_name)</li><li>templateProperty mongo.gcs.input.collection: MongoDB Input Collection Name (format: Collection_name)</li><li>templateProperty mongo.gcs.output.format: GCS Output File Format (one of: avro,parquet,csv,json)</li><li>templateProperty mongo.gcs.output.location: GCS Location to put Output Files (format: gs://BUCKET/...)</li><li>templateProperty mongo.gcs.output.mode: Output write mode (one of: append,overwrite,ignore,errorifexists) (Defaults to append)</li></ul><p>6. Monitor the Spark batch job</p><p>After submitting the job, you will be able to view the job in the Dataproc Batch UI. From there, we can view both metrics and logs for the job.</p><h3>References</h3><ul><li><a href="https://cloud.google.com/dataproc-serverless/docs/overview">Dataproc Serverless Documentation</a></li><li><a href="https://github.com/GoogleCloudPlatform/dataproc-templates">Dataproc Templates GitHub Repository</a></li><li><a href="https://medium.com/google-cloud/exporting-data-from-mongodb-to-gcs-buckets-using-dataproc-serverless-64830fb15b51">https://medium.com/google-cloud/exporting-data-from-mongodb-to-gcs-buckets-using-dataproc-serverless-64830fb15b51</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=390500481804" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/migrating-data-from-mongo-to-gcs-using-java-and-dataproc-serverless-template-390500481804">Migrating data from Mongo to GCS using Java and Dataproc Serverless template</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>