Database schema design serves as a bridge between business requirements and database capabilities. A well-designed schema can fully leverage the distributed architecture of OceanBase AI Database, striking a balance among query performance, storage efficiency, and scalability. This chapter covers the following aspects.
Table design
This topic introduces the table types and update modes supported by OceanBase AI Database. Table types can be understood from dimensions such as data organization, primary key, storage format, and special purposes, including partitioned tables, replicated tables, heap tables, columnar tables, and hybrid row-column tables. Table update modes include two strategies: delete_insert (full column update) and partial_update (partial update). For more information, see Table design.
Data distribution
This topic introduces partitioning strategies (Hash/Key, Range, List) and their impact on data distribution, load balancing, and query performance. A proper partitioning design can reduce the amount of data scanned through partition pruning and leverage multi-machine resources to improve query performance. For more information, see Data distribution.
Indexes
This topic introduces index types such as B-tree indexes, full-text indexes, JSON multi-valued indexes, spatial indexes, and vector indexes, as well as classification dimensions like local/global and row/column storage. For more information, see Indexes.
Data types
Select appropriate data types for each column to reduce storage space and improve query speed. Common types include primitive types (INT, VARCHAR, DATE, etc.) and complex types (JSON, ARRAY, BITMAP, etc.). For more information, see Data types.
Views
OceanBase AI Database supports regular views and materialized views. Regular views store only query definitions, not query results; materialized views physically retain query results and support asynchronous updates, making them suitable for scenarios such as pre-aggregation, reporting, and dashboards. For more information, see Overview of materialized views.
Logical tables
Logical tables are designed for scenarios where a large number of isolated domains need to share the underlying storage. They provide logical isolation at the Namespace level, avoiding the need to create separate physical tables for each user, Agent, or application. They are currently implemented mainly for two scenarios: Agent hybrid search and Flash App. For more information, see Logical table overview.
The dimensions above are interrelated: table type determines how data is stored, data distribution affects query parallelism, indexes determine data access paths, and data types and views affect storage efficiency and analytical capabilities, while logical tables are used to share underlying storage across a large number of isolated domains. It is recommended to consider them comprehensively based on the actual business scenario—whether OLTP, OLAP, HTAP, or AI Agent / Flash App—rather than choosing them in isolation.