Created using DDL (defines data types & primary keys).
Can be:
Unstructured: Rows are JSON docs.
Structured: Row types are defined & enforced.
Hybrid: Typed data with JSON data fields.
Must have one or more fields designated as primary key.
Primary & shard keys are designated at table creation & cannot be changed or dropped.
Row: Key & data fields defined at table creation.
Index:
Any data field with supported data type can be indexed.
JSON index is created using path expression into JSON data.
Consumes storage & throughput.
1 Write Unit = 1 KB/s write.
1 Read Unit = 1 KB/s eventually consistent read.
1 Storage Unit = 1 GB
Distribution & Sharding:
Tables are sharded & replicated for availability & performance.
Data in table is automatically sharded based on a portion of the primary key, called the shard key.
Rows containing same values for all shard keys are guaranteed to be stored on the same shard.
Avoid shard keys that have low cardinality i.e. few unique values.
Only objects that share the shard key can participate in a transaction. If you require ACID transactions that span multiple records, choose a shard key appropriately.
Best practices:
Distribute shard keys uniformly.
Target queries to specific shard.
Read Consistency:
Determines which copy of data is used to fulfill a read op.
2 consistency levels:
EVENTUAL: Returns possibly outdated data. Faster than ABSOLUTE.
ABSOLUTE:
Guarantees that read returns most recently written data.
Costs more. Consumes double read units relative to EVENTUAL.
Consistency can be set at:
Either a NoSQL handle in code, affecting all reads using that handle.
Or optionally on individual read ops.
Service endpoint is https://nosql.{region}.oci.oraclecloud.com.
Identity Columns:
Special columns whose values are auto-assigned by Oracle.
Values are generated from a sequence generator.
Not supported from OCI console, only programmatically.