Buying and Connecting to a GeminiDB DynamoDB-Compatible Instance
This section instructs you to buy a GeminiDB DynamoDB-Compatible instance on the GeminiDB console.
By default, each tenant can create a maximum of 50 GeminiDB DynamoDB-Compatible instances. To request a higher quota, choose Service Tickets > Create Service Ticket in the upper right corner of the console and contact the customer service.
- Buying an Instance
- Connecting to an Instance Using Java
For details about other connection methods, see Connection Methods.
Prerequisites
- You have created a Huawei Cloud account.
Buying an Instance
For details, see Buying a GeminiDB DynamoDB-Compatible Instance.
- Log in to the GeminiDB console.
- On the Instances page, click Buy DB Instance.
- On the displayed page, select a billing mode, configure instance parameters, and click Next.
The following parameters are for reference only. Select proper specifications as needed. Table 1 lists details about the parameters.Figure 1 Billing mode and basic information
Parameter
Example Value
Description
Billing Mode
Pay-per-use
Billing mode of an instance
- Yearly/Monthly: You prepay for an instance based on a fixed subscription period (monthly or yearly). Longer subscriptions offer larger discounts. This mode is a good option for long-term stable workloads.
- Pay-per-use: You are billed based on how long you have actually used GeminiDB. Pricing is listed on a per-hour basis, and bills are calculated down to the second. This mode allows you to adjust resource usage easily. You neither need to prepare for resources in advance, nor end up with excessive or insufficient preset resources.
Region
Select EU-Dublin.
Region where a tenant is located
NOTE:To reduce network latency, select a region nearest from which you will access the instance. Instances deployed in different regions cannot communicate with each other over a private network. After you buy an instance, you cannot change its region.
DB Instance Name
User-defined
The instance name:
- Can be the same as an existing instance name.
- Can contain 4 to 64 characters and must start with a letter. It is case-sensitive and allows only letters, digits, hyphens (-), and underscores (_).
Compatible API
DynamoDB
GeminiDB is compatible with mainstream NoSQL databases, including Redis, DynamoDB, Cassandra, and InfluxDB. You can select GeminiDB APIs by following How Do I Select an API?
DB Instance Type
Cluster
Cluster
One cluster consists of at least three nodes. A cluster is easy to scale out to meet increasing data growth needs. A cluster is recommended when dealing with stringent availability demands, substantial data volumes, and the need for seamless scalability.
AZ
AZ 1, AZ 2, and AZ 3
Availability zone where the instance is created. An AZ is a part of a region with its own independent power supplies and networks. AZs are physically isolated but can communicate with each other over a private network.
Figure 2 Specifications and storage
Parameter
Example Value
Description
Instance Specifications
2U8GB
Select appropriate specifications based on the CPU-memory ratio.
After an instance is created, you can change its specifications. For details, see Changing vCPUs and Memory.
Nodes
3
Number of nodes that the instance is deployed on.
If the number of nodes exceeds the upper limit, you can choose Service Tickets > Create Service Ticket in the upper right corner of the console and contact the customer service.
After an instance is created, you can add nodes. For details, see Manually Adding Instance Nodes.
Storage Space
500 GB
Instance storage space. The range depends on the instance specifications. For details, see Instance Specifications.
After an instance is created, you can scale up its storage if necessary. For details, see Manually Scaling Up Storage Space.
Auto Scale
Toggled off
Whether autoscaling is enabled.
You can enable Auto Scale after an instance is created. For details, see Automatically Scaling Up Storage Space.
Disk Encryption
Disable
Whether a disk needs to be encrypted.
If you select Enable, your data will be encrypted on disks and stored in ciphertext after you create an instance. When you download encrypted objects, the ciphertext will be decrypted into plain text and then sent to you. Disk encryption can improve data security and may have slight impacts on database writes and reads.
Figure 3 Network configuration
Figure 4 Database configuration
Parameter
Example Value
Description
VPC
default_vpc
Virtual private network where your instances are located. A VPC isolates networks for different services. You can select an existing VPC or create a VPC.
NOTE:- After a GeminiDB DynamoDB-Compatible instance is created, the VPC where the instance is deployed cannot be changed.
- To connect a GeminiDB DynamoDB-Compatible instance to an ECS over a private network, ensure they are in the same VPC. If they are not, create a VPC peering connection between them.
Subnet
default_subnet
A subnet provides dedicated network resources that are logically isolated from other networks for security purposes.
Security Group
default
A security group controls access between GeminiDB DynamoDB-Compatible API and other services. Ensure that the security group you selected allows your client to access the instance.
Administrator Password
Configured based on the password policy
Password of the administrator account. The password:
- Can include 8 to 32 characters.
- Can include uppercase letters, lowercase letters, digits, and any of the following special characters: ~!@#%^*-_=+?
- For security reasons, set a strong password. The system will verify the password strength.
Keep your password secure. The system cannot retrieve it if it is lost.
Enterprise Project
default
This parameter is provided for enterprise users.
An enterprise project groups cloud resources, so you can manage resources and members by project. The default project is default.
Select an enterprise project from the drop-down list. For more information about enterprise projects, see Enterprise Management User Guide.
Retain the default values for other parameters.
- On the displayed page, confirm instance details. To modify the configurations, click Previous.
- If no modification is required, read and agree to the service agreement and click Submit.
- Click Back to Instance Management to go to the instance list.
- On the Instances page, view and manage the created instance.
- It takes about 5 to 9 minutes to create an instance. During the process, the instance status is Creating.
- After the instance is created, its status becomes Available.
Figure 5 Available instance
Connecting to an Instance Using Java
This section describes how to connect to a GeminiDB DynamoDB-Compatible instance using Java.
Prerequisites
- A GeminiDB DynamoDB-Compatible instance has been created.
- For details about how to create an ECS, see Purchasing an ECS in Getting Started with Elastic Cloud Server.
- JDK has been installed on the ECS.
Viewing the Load Balancer Address for Connecting to a GeminiDB DynamoDB-Compatible Instance
- Log in to the Huawei Cloud console.
- On the Instances page, click the target instance. On the displayed Basic Information page, view the load balancer address.
If no load balancer address is available, choose Service Tickets > Create Service Ticket in the upper right corner of the console and contact the customer service.
Figure 6 Viewing the IP address
Connecting to an Instance
import com.amazonaws.SDKGlobalConfiguration;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDB;
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClientBuilder;
import com.amazonaws.services.dynamodbv2.document.DynamoDB;
import com.amazonaws.services.dynamodbv2.document.TableCollection;
public class V1Demo {
public static AWSCredentialsProvider myCredentials = new AWSStaticCredentialsProvider(new BasicAWSCredentials("your_ak", "your_sk"));
public static void main(String[] args) {
AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard()
.withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration("http://ip", "cn_north_1"))
.withCredentials(myCredentials)
.build();
DynamoDB dynamoDB = new DynamoDB(client);
TableCollection res = dynamoDB.listTables();
System.out.println(res);
}
}
GeminiDB DynamoDB-Compatible API is completely compatible with DynamoDB. For details about common operations, see official DynamoDB documents.
FAQs
Question: What should I do if the DAS console cannot be redirected after I click Log In in the Operation column in the instance list or click Log In on the Basic Information page?
Solution: Set your browser to allow pop-ups and try again.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.