Updated on 2025-03-04 GMT+08:00

Getting Started with GeminiDB Mongo API

This section instructs you to create and connect to a GeminiDB Mongo instance.

Connection Methods

Process

Figure 1 shows how to connect to a GeminiDB Mongo instance over a private or public network.

Figure 1 Connecting to an instance over a private or public network
Table 1 Connection methods

Method

Scenario

Default Port

Description

Connecting to a Replica Set Instance over a Private Network

A private IP address is provided by default.

If your applications are deployed on an ECS that is in the same region and VPC as your instance, you can connect to the instance using a private IP address.

8635

High security and performance

  • The instances must be in the same VPC and subnet as the ECS.
  • The ECS must be allowed by the security group to access DB instances.
    • If the instance is associated with the default security group, you do not need to configure security group rules.
    • If the instance is not associated with the default security group, check whether the security group rules allow the ECS to access the instance.

      If the security group rule allows access from the ECS, you can connect to the instance through the ECS.

      If the security group rule does not allow access from the ECS, add an inbound rule to the security group. For details, see Configuring Security Group Rules.

Connecting to a Replica Set Instance over a Public Network

If you cannot access an instance over a private IP address, bind an EIP to the instance and then connect to it using the EIP.

8635

  • Low security
  • For faster transmission and improved security, you are advised to migrate your applications to an ECS that is in the same subnet as your instance and use a private IP address to access the instance.

Connecting to an Instance Using Java

An example of connecting to a GeminiDB Mongo instance using Java is provided.

8635

-

Connecting to an Instance Using Golang

An example of connecting to a GeminiDB Mongo instance using Go is provided.

8635

-

Connecting to an Instance Using Python

An example of connecting to a GeminiDB Mongo instance using Python is provided.

8635

-