El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ GeminiDB/ GeminiDB Cassandra API/ FAQs/ Database Usage/ What Should I Pay Attention to When Creating a GeminiDB Cassandra Table?

What Should I Pay Attention to When Creating a GeminiDB Cassandra Table?

Updated on 2024-09-04 GMT+08:00

When you create tables in a GeminiDB Cassandra database, pre-allocate memory to guarantee database performance. GeminiDB Cassandra has a limit on the number of tables.

Precautions

  • Half of node memory is allocated to the storage engine.
  • An odd number of clusters can tolerate N/2-1 faulty nodes, and an even number of clusters can tolerate N/2 faulty nodes.
  • GeminiDB Cassandra API utilizes a table-level hash ring, with the tokens parameter indicating the number of data shards for a table. This parameter differs from the num_tokens used in open-source Cassandra.

Calculating the Number of Tables

The memory required for creating tables depends on the instance specifications. Assume that an instance has 4 vCPUs and 16 GB memory and the size of a single table is 768 MB.

Maximum number of tables that can be created = Total available memory of the cluster / Memory required by a single table

  • Cluster with an odd number of nodes

    Available cluster memory = Node memory/2 x (N/2 + 1)

  • Cluster with an even number of nodes

    Available cluster memory = Node memory/2 x (N/2)

For example:
  • Available memory of an instance with 3 nodes, 4 vCPUs, and 16 GB memory = 16/2 x (3/2 + 1) = 16 GB

    Maximum number of created tables = 16 x 1024 MB/768 MB = 21

  • Available memory of an instance with 4 nodes, 4 vCPUs, and 16 GB memory = 16/2 x (4/2) = 16 GB

    Maximum number of created tables = 16 x 1024 MB/768 MB = 21

  • Available memory of an instance with 5 nodes, 4 vCPUs, and 16 GB memory = 16/2 x (5/2 + 1) = 24 GB

    Maximum number of created tables = 24 x 1024 MB/768 MB = 32

For details about the mapping between the number of nodes (4 vCPUs, 16 GB) and the number of tables, see Table 1.
Table 1 Upper limit on the number of tables

Instance Class

Number of Nodes

Number of Tables

4 vCPUs | 16 GB

3

21

4

21

5

32

6

32

7

42

8

42

9

53

10

53

11

64

12

64

NOTE:
  • A single table occupies 768 MB memory, and the default number of table tokens is 12. If tokens are separately set, calculate the number of tables using the following formula: (768/12) x Number of tokens.
  • The preceding formula is designed for common tables. If stream table is enabled, one stream table consumes resources 2.5 times more than common tables.
For details about the mapping between the number of nodes (8 vCPUs, 32 GB) and the number of tables, see Table 2.
Table 2 Upper limit on the number of tables

Instance Class

Number of Nodes

Number of Tables

8 vCPUs | 32 GB

3

22

4

22

5

34

6

34

7

45

8

45

9

56

10

56

11

68

12

68

NOTE:
  • A single table occupies 1440 MB memory, and the default number of table tokens is 12. If tokens are set separately, calculate the number of tables using the following formula: (1440/12) x Number of tokens.
  • The preceding formula is designed for common tables. If stream table is enabled, one stream table consumes resources 2.5 times more than common tables.
For details about the mapping between the number of nodes (16 vCPUs, 64 GB) and the number of tables, see Table 3.
Table 3 Upper limit on the number of tables

Instance Class

Number of Nodes

Number of Tables

16 vCPUs | 64 GB

3

45

4

45

5

68

6

68

7

91

8

91

9

113

10

113

11

136

12

136

NOTE:
  • A single table occupies 1440 MB memory, and the default number of table tokens is 12. If tokens are set separately, calculate the number of tables using the following formula: (1440/12) x Number of tokens.
  • The preceding formula is designed for common tables. If stream table is enabled, one stream table consumes resources 2.5 times more than common tables.
For details about the mapping between the number of nodes (32 vCPUs, 128 GB) and the number of tables, see Table 4.
Table 4 Mapping between the number of nodes (32U128GB) and the number of tables

Instance Class

Number of Nodes

Number of Tables

32 vCPUs | 128 GB

3

68

4

68

5

102

6

102

7

136

8

136

9

170

10

170

11

204

12

204

NOTE:
  • A single table occupies 1920 MB memory, and the default number of table tokens is 12. If tokens are separately set, calculate the number of tables using the following formula: (1920/12) x Number of tokens
  • The preceding formula is designed for common tables. If stream table is enabled, one stream table consumes resources 2.5 times more than common tables.

Parameters for Creating a Table

  1. Z00_THROUGHPUT (throughput parameter) is related to the upper limit of table write performance. The default value is big, indicating the upper limit of standard write performance.
    • Low throughput
      CREATE TABLE test1 (k int,p int,s int static,v int,PRIMARY KEY (k, p)) WITH Z00_THROUGHPUT = 'small';
    • Medium throughput
      CREATE TABLE test2 (k int,p int,s int static,v int,PRIMARY KEY (k, p)) WITH Z00_THROUGHPUT = 'medium';
    • High throughput
      CREATE TABLE test3 (k int,p int,s int static,v int,PRIMARY KEY (k, p)) WITH Z00_THROUGHPUT = 'big';
  2. Number of table tokens: indicates the number of table tokens when a table is created. The number of tokens must be greater than 1.
    CREATE TABLE test4 (k int,p int,s int static,v int,PRIMARY KEY (k, p)) WITH Z01_TABLE_TOKENS = 24;
  3. Table parameters: Z00_BUFFER_SIZE and Z00_BUFFER_NUMBER (not recommended).

    When creating a table, you can specify the number of memtables in the storage layer and the size of each memtable.

    • Z00_BUFFER_SIZE is of the map type and specifies the CF name and value. The value ranges from 2 to 32.
      CREATE TABLE test6 (k int,p int,s int static,v int,PRIMARY KEY (k, p)) WITH Z00_BUFFER_SIZE = {'default': 16};
    • Z00_BUFFER_NUMBER is of the map type and specifies the CF name and value. The value ranges from 2 to 8.
      CREATE TABLE test5 (k int,p int,s int static,v int,PRIMARY KEY (k, p)) WITH Z00_BUFFER_NUMBER = {'default': 3};
NOTE:

If you need to adjust the table specifications after the table is created, for example, when the maximum number of the tables is reached, you can reduce the table specifications to create more tables by adjusting the following parameters.

  • If you set the throughput of all created tables to medium, the number of tables can be doubled
    ALTER TABLE keyspace_name.table_name WITH Z00_THROUGHPUT = 'medium';
  • If you set the throughput of all created tables to small, the number of tables can be tripled.
    ALTER TABLE keyspace_name.table_name WITH Z00_THROUGHPUT = 'small';

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback