OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

KV - V4.3.5

  • OBKV overview
  • Architecture
  • OBKV-Table
    • Introduction to OBKV-Table
      • Overview
      • OBKV-Table operation types
      • Core features of OBKV-Table
      • Differences between replace and insert_or_update
      • Supported value types
      • OBKV-Table data models
    • Use the OBKV-Table Java client
      • Java development guide for OBKV-Table
      • Prepare for development with OBKV-Table
      • Use the OBKV-Table Java client to connect to a cluster
      • Set client parameters
      • Supported client interfaces
      • Use the OBKV-Table Java client
    • Use the OBKV-Table GO client
      • Use the OBKV-Table Go client to connect to a cluster
      • Overview of the Go client
      • Individual API operations
      • Batch operations
      • About queries
      • Aggregation API
      • Filters
    • FAQ
  • OBKV-HBase
    • Overview
    • OBKV-HBase core features
    • Compatibility with HBase
    • Deployment
    • Application development with OBKV-HBase
      • Overview of OBKV-HBase application development
      • Data model
      • Data model design
      • Connect to a cluster using the OBKV-HBase client
      • Migrate HBase business code to OBKV-HBase
      • Data operation examples
      • Delete expired data
    • OBKV-HBase migration guide
    • OBKV-HBase management
      • Overview
      • High availability
      • Security and permissions
      • Monitoring metrics
    • Performance test
    • OBKV-HBase integrations
      • Flink
        • Synchronize data to OBKV-HBase by using Flink
    • Views
    • FAQ

Download PDF

OBKV overview Architecture Overview OBKV-Table operation types Core features of OBKV-Table Differences between replace and insert_or_update Supported value types OBKV-Table data models Java development guide for OBKV-Table Prepare for development with OBKV-Table Use the OBKV-Table Java client to connect to a cluster Set client parameters Supported client interfaces Use the OBKV-Table Java client Use the OBKV-Table Go client to connect to a cluster Overview of the Go client Individual API operations Batch operations About queries Aggregation API Filters FAQ Overview OBKV-HBase core features Compatibility with HBase Deployment Overview of OBKV-HBase application development Data model Data model design Connect to a cluster using the OBKV-HBase client Migrate HBase business code to OBKV-HBase Data operation examples Delete expired data OBKV-HBase migration guide Overview High availability Security and permissions Monitoring metrics Performance test Views FAQ
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Database
  3. KV
  4. V4.3.5
iconOceanBase Database
KV - V 4.3.5
SQL
KV
  • V 4.3.5

OBKV-Table operation types

Last Updated:2025-09-08 11:49:18  Updated
share
What is on this page
Execute
Insert
Get
Delete
Update
Insert_or_update
Replace
Increment
Append
Batch execute
Query

folded

share

OBKV-Table supports four different operation types: login, execute, batch_execute, and query (scan query).

Each operation type is managed by a separate processor class, with each type having its own process function that handles different RPC message requests through inheritance and derivation.

OBKV-Table

  • ObTableLoginRequest: the login operation type. It requires the username and password of the OceanBase tenant for authentication, which is similar to SQL statements. You can call other OBKV-Table operations only after successful authentication.
  • ObTableOperationRequest: the execute type. Operations of this type include insert, update, replace, get, increment, and append.
  • ObTableBatchOperationRequest: the batch execute type that consists of multiple execute operations.
  • ObTableQueryRequest: the type for streaming queries, such as the range scan for a specific primary key.

The following class diagram shows the implementation of different operation types.

operation-type

Execute

The OBServer node processes the ObTableOperationRequest operations and returns the values of errno and affected_rows to the client.

Note

In the following sections, subheadings such as Insert and Get are the names of operations instead of actual functions or APIs.

Insert

You can call this operation to insert a row.

This operation returns the following results:

  • If the row is inserted, the return value of errno is OB_SUCCESS, and that of affected_rows is 1.
  • If the insertion fails, the return value of affected_rows is 0.
  • If the insertion fails because of a primary key conflict, which means the row already exists, the return value of errno is OB_ERR_PRIMARY_KEY_DUPLICATE.
  • Other common values of errno are as follows:
    • OB_TIMEOUT: indicates an execution timeout.
    • OB_TRY_LOCK_ROW_CONFLICT: indicates a lock wait timeout.

Get

You can call this operation to retrieve a row.

The target row is returned if it exists, and null is returned if the target row does not exist.

Delete

You can call this operation to delete a row.

This operation returns the following results:

  • If the target row is deleted, the return value of errno is OB_SUCCESS, and that of affected_rows is 1.
  • If the target row does not exist, the return value of errno is OB_SUCCESS, and that of affected_rows is 0.

Update

You can call this operation to update a row.

This operation returns the following results:

  • If the target row is updated, the return value of errno is OB_SUCCESS, and that of affected_rows is 1.
  • If the target row does not exist, the return value of errno is OB_SUCCESS, and that of affected_rows is 0.

Insert_or_update

You can call this operation to insert or update a row.

This operation returns the following results:

  • If the target row does not exist, the new row is inserted, and the return value of errno is OB_SUCCESS, and that of affected_rows is 1.
  • If the target row already exists, which means a primary key conflict, the row is updated. The return value of errno is OB_SUCCESS, and that of affected_rows is 1.
  • If the insertion encounters a unique index conflict, the target row is also updated.

Replace

You can call this operation to replace a row.

This operation returns the following results:

  • If the target row does not exist, the new row is inserted, and the return value of errno is OB_SUCCESS, and that of affected_rows is 1.
  • If the target row already exists, which means a primary key conflict, the original row is deleted and the new row is inserted. The return value of errno is OB_SUCCESS, and that of affected_rows is greater than 1.
  • If a unique index conflict takes place, conflicting rows are deleted, and rows to be replaced are inserted. The return value of errno is OB_SUCCESS, and that of affected_rows is greater than 1 because the deleted rows are counted.

Increment

You can call this operation to atomically increment the value of the specified column by an increment value. The increment value can be negative.

This operation is supported since OceanBase Database V1.4.75. It supports columns of integer data types: TINYINT, SMALLINT, MEDIUMINT, INT, and BIGINT, and their unsigned versions. Errors are returned for columns of other data types.

This operation returns the following results:

  • If the calculation result overflows the value range of the column type, an error is returned.
  • If the target row does not exist, the new row is inserted and the increment value is set as the initial value, which is equivalent to having an original value of 0.
  • If the target row exists but the value of the specified column is NULL, the increment value is set as the initial value, which is equivalent to having an original value of 0.

Append

You can call this operation to atomically append a string to the value of the specified column.

This operation is supported since OceanBase Database V1.4.75. It supports columns of VARCHAR and VARBINARY data types. Errors are returned for columns of other data types.

This operation returns the following results:

  • If the calculation result overflows the length of the column, an error is returned.
  • If the target row does not exist, the new row is inserted and the increment value is set as the initial value, which is equivalent to having an original value of an empty string.
  • If the target row exists but the specified column value is NULL, the increment value is set as the initial value, which is equivalent to having an original value of an empty string.

Batch execute

A batch execute operation includes a collection of execute operations. For more information about a specific execute operation, see the Execute section.

To accelerate the batch operation, the OBServer node is optimized for batch processing read-only transactions. Therefore, it demonstrates better performance in batch operations of read-only requests than those of read/write requests.

Query

OBKV-Table supports range scan based on the primary key or the prefix of the primary key. When the primary key is not specified, OBKV-Table also supports range scan based on the index or index prefix.

You can call query operations to scan multiple specified segments. At present, the OBServer node can return a result set of at most 64 MB of data (adjustable) in the RPC message interaction process of a Query.

Previous topic

Overview
Last

Next topic

Core features of OBKV-Table
Next
What is on this page
Execute
Insert
Get
Delete
Update
Insert_or_update
Replace
Increment
Append
Batch execute
Query