The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.

Database Features

Last updated: 2024-10-15 17:52:59

Does TcaplusDB support data removal?

TcaplusDB supports table-level data elimination based on the last write time of the record.

What are the data structures of TcaplusDB?

The data structures supported by TcaplusDB include list arrays, querying by partial key (index), key-value, and key-object (where the value of a single key can be any data structure, for example, the game server can serialize a Lua table into the value field).

What is the single-instance memory capacity and CPU utilization of the TcaplusDB API?

The memory consumption for a single instance of the API is up to 73MB, and CPU utilization is up to 30%.

How many tables are in a table group in TcaplusDB?

The maximum number of tables in a single table group in TcaplusDB is 256. If the number of tables in your group exceeds 256, you can add new table groups or merge tables. If you need technical support, please submit a work order and select "Other Tencent Cloud Products".

What are the restrictions on the key and value fields in TcaplusDB?

The number of key fields of the generic table is 4, the number of key fields of the list table is 3, and the size of a single key field is 1024 B. The number of value fields of the generic table is 128, the number of value fields of the list table is 127, the size of a single value field is 256 KB, and the maximum value of the overall record is 1 MB.

How long is the TcaplusDB backup file retained?

The engine files backed up by TcaplusDB are saved for 7 days, and the Ulog process is saved for 7 days. The storage periods in different TcaplusDB environments vary. For specific TcaplusDB environment details, please contact customer service.

Is the game server connected to all tcaproxy (access layer)?

To save costs on maintaining TCP connections for gameserver and tcaproxy (access layer), gameserver can choose to establish connections with selected tcaproxy (access layer).

How do I perform data analysis of TcaplusDB data?

TcaplusDB data can be exported in any format, including json, pb and other formats, and can be imported into data analysis systems such as tdw. TcaplusDB supports the import of real-time data into MySQL database and so on.

What is the maximum size of a single table in TcaplusDB? What is the limit on the number of records?

A single table can be subdivided into 10,000 data shard, each data shard is 256 GB, that is, the total size of a single table is 10,000 * 256 GB. A single table has no limit on the number of records, and the number of records in a single table is related to the size of a single record.

Does TcaplusDB support multi-table transaction operations and batch write operations?

TcaplusDB currently does not support multi-transaction operations, meaning it cannot simultaneously commit multiple operations and roll back all actions if subsequent operations fail. In such cases, solutions usually need to be found from the business side. A "subtract first, then add" strategy can be employed, or recording reconciliation logs of critical operations, and batch write operations are also not supported temporarily.

Is the TcaplusDB API upgrade backward compatible?

TcaplusDB API upgrade is forward compatible, and existing APIs, command words, and features will not be modified.

What is TcaplusDB?

Game Database (Tcaplus Database, TcaplusDB) is a distributed NoSQL database designed by Tencent specifically for games. It provides high performance, millisecond-level read/write latency, and secure data storage services for managing explosive growth and massive game data without business perception. It is widely used in hundreds of Tencent games, including Peacekeeper Elite, Honor of Kings, and CrossFire, supporting data requests from over 40 million concurrent users daily.

What scenarios is TcaplusDB suitable for?

Mobile games, PC games, web games, support for both zone and server segmentation and global server coverage deployment methods, and also non-game scenarios requiring high concurrency and low latency access requirements.

What advantages does TcaplusDB have over Redis+MySQL as a game database?

TcaplusDB uses a hybrid deployment method combining memory and efficient SSD Cloud Block Storage (CBS), meeting the needs for rapid data read/write and persistent storage simultaneously
For relational database users, TcaplusDB offers a SQL-like TCCLI (Tcaplus Client), allowing users to seamlessly switch and perform CRUD operations
Users do not need to worry about large table files causing slow query loading. TcaplusDB supports single table sizes up to 2.56PB without reducing query efficiency
Redis+MySQL scaling requires manual intervention and cannot cater to sudden spikes in business demand, which also incurs high costs. TcaplusDB users only need to focus on business development while all database scaling and performance optimization are handled backend by professional DBAs.

How does TcaplusDB ensure data security?

Data Disaster Recovery: The primary/secondary node clusters mainly adopt intra-city cross-IDC deployment (or cross-rack, cross-floor deployment methods, with primary/secondary node synchronization delay up to 10ms), with binlog backups every 15 minutes and full cold backups daily. Every module of the entire cluster supports lossless upgrades and scaling, ensuring business continuity without user perception
Data Consistency: Real-time synchronization of master-slave data with a req/ack mechanism ensures complete consistency. The master-slave switch is confirmed only after ensuring data consistency between master and slave. In case of failure, data recovery is performed using cold backups and binlog streams, ensuring data integrity. Periodic full checks for consistency and an exception repair mechanism are in place for master-slave data. At the user request level, the response code from real-time feedback determines the success of data operations
Data Content Security: Data landing uses CRC checks to prevent tampering. Data in CFS employs Google Snappy Compression, and data read/write operations involve serialization and deserialization. Even if data files are hijacked, the data content cannot be parsed
Access Security: Integrated with Tencent Cloud User Permission Management System (CAM). TcaplusDB backend supports access based on IP allowlists, allowing specified IP clients to read/write TcaplusDB data. Data interactions within a table group require password verification, and every user operation is logged in audit logs
External Compliance: Data files use AES-128-CBC encryption, complying with EU GDPR standards.

Field Size Limitation for TcaplusDB API Versions

For APIs earlier than Tcaplus 3.32.0, a single value field is 128KB, and a single record is 256KB.
For APIs from Tcaplus 3.32.0 to Tcaplus 3.40.0, a single value field is 256KB, and a single record is 1MB.
For APIs from Tcaplus 3.40.0 and onwards, a single value field and a single record can be up to 10MB.

What are the current sizes of TcaplusDB's send and receive buffers?

Currently, the send and receive buffers for gameserver and a single tcaproxy are 10MB each.

How to use the error codes for the batch interface?

The error codes for the batch interface are divided into two types: Total Error Code and Sub-operation Error Code. When at least one sub-operation is successful, the Total Error Code is 'Success'; when all sub-operations fail, the Total Error Code is 'Failure'. The Total Error Code can be obtained through the response return value, while the Sub-operation Error Code is obtained by fetching the return value of an individual record.

Is the maximum number of primary fields for a Tcaplus table 256?

Currently, a table supports up to 256 primary fields

For a game, how many connections does Tcaplus support at most?

By default, a proxy supports up to 3000 connections, but the connection count can be increased by modifying the configuration. Additionally, an API instance currently supports connecting up to 200 proxies

Is Tcaplus's access to the database parallel?

It supports parallel access. Requests for each connection (session) on the API side are serial, but different connections are parallel. On the API side, connections are not thread-safe, so avoid using the same connection with multiple threads.

How much data can a single shard store?

A single shard can store up to 256GB of data. It is generally recommended to maintain the data volume under 10GB. Note: A shard has initial space, but it is not fixed and depends on the specific table engine settings, such as the number of Hash Buckets. A table supports up to 10,000 shards, each with 256GB. TcaplusDB is a distributed database with no row limit.

What is the compatibility of TcaplusDB PB versions across different versions?

PB is forward and backward compatible

Compared to int, what should be noted when using string as Tcaplus's primary key or sharding key?

The performance gap compared to int is not significant. The general principle is to ensure the key is not too long.

If a table has a large data volume, for example, 1 billion records, and can't fit on one physical machine, will Tcaplus distribute this data across multiple physical machines?

During operation, machines can be added to distribute the data to new storage, and each storage group follows a master-slave mode.

When master-slave data is synchronized in real-time, if the master machine crashes due to physical reasons, will there theoretically be some short-term data loss?

Theoretically, there is a possibility of short-term data loss. It is an eventual consistency synchronization due to the system flushing from memory to disk. If the master machine crashes, it will immediately switch to master-slave mode.

If the remote meta version of Tcaplus is higher and the local svr's Tcaplus meta version is lower, will the differing data be stored in tcaplus_db (for instance, if a new field is added)? Or will it be directly discarded?

Written with default values

Regarding the Table Partition Factor in the table Definition, is there a default Table Partition Factor if not defined? Can existing table splittablekey add new fields?

TDR Table: Without a defined Table Partition Factor field, the system defaults the primary key field as the Table Partition Factor field.
PB Table: Without a defined Table Partition Factor field, the intersection field of multiple local indexes is the Table Partition Factor field. If no local index intersection field is defined, the primary key is the default Table Partition Factor.
Once the table splittablekey is defined, it cannot be modified, added, or deleted.

Regarding changes to the List Table, note the first addition of customattr2 in Definition listnum:

The number of elements in the List Table can be increased, but during the first addition of customattr2 for table modification, listnum in customattr2 cannot be increased immediately. It should be modified after the change is successful. Otherwise, the change will fail.

Is Tcaplus in Primary/Backup Mode? During a write request, does the host send a response package as soon as the write is successful, or does it wait for standby machine synchronization before responding?

Yes, it is a Primary/Backup Mode with one primary and one secondary. The host sends a response package as soon as the write is successful.