YugabyteDB Documentation

repository·master·Indexed 27 days ago

https://github.com/yugabyte/yugabyte-db

A distributed, PostgreSQL-compatible SQL database for high-performance, cloud-native OLTP applications. Documentation covers deployment via Kubernetes StatefulSets, Docker, and Docker Compose; monitoring with Prometheus and Grafana; and API access via YCQL (Cassandra-compatible) and YEDIS (Redis-compatible). Includes guides for the Asynchronous Native Java Client, Change Data Capture (CDC) connectors, and YugabyteDB Anywhere (YBA) local development.

Tokens
194.1K
Snippets
387
Records
1K
Agent score
93%

What's inside YugabyteDB

  1. Overview of DocumentDB Components

    master

    DocumentDB is a MongoDB-compatible open-source document database built on PostgreSQL. It enables CRUD operations on BSON (Binary JSON) data types within a PostgreSQL framework and supports full-text search, geospatial queries, and vector search. The system consists of three main components:

    • pg_documentdb_core: A PostgreSQL extension that introduces BSON datatype support and operations for native Postgres.
    • pg_documentdb: The public API surface providing CRUD functionality on documents.
    • pg_documentdb_gw: A gateway protocol translation layer that converts MongoDB APIs into PostgreSQL queries.
  2. Overview of the hll data type

    master

    The hll module introduces a HyperLogLog data structure, a fixed-size, set-like structure used for estimating the count of distinct values with tunable precision. It uses a promotion hierarchy of algorithms to balance accuracy, memory, and performance:

    • EMPTY: A constant representing an empty set.
    • EXPLICIT: A sorted list of unique integers (exact representation) maintained up to a fixed cardinality.
    • SPARSE: A map-based probabilistic implementation that stores only non-zero registers.
    • FULL: A fully-materialized, list-based implementation storing every register.

    Cardinality estimates for EMPTY and EXPLICIT are exact, while SPARSE and FULL provide probabilistic guarantees.

  3. Overview of RocksDB Key-Value Store

    master
    RocksDB is a persistent key-value store library designed for fast storage on flash drives and RAM. It utilizes a Log-Structured-Merge-Database (LSM) design, allowing developers to tune the balance between Write-Amplification-Factor (WAF), Read-Amplification-Factor (RAF), and Space-Amplification-Factor (SAF). It supports multi-threaded compactions, making it suitable for managing multiple terabytes of data in a single database instance.
  4. Overview of pgrx

    master

    pgrx is a framework that allows developers to write PostgreSQL extensions using Rust instead of C. It provides safe abstractions to handle complex PostgreSQL requirements, such as:

    • Binding Postgres headers and creating loadable dynamic libraries.
    • Generating SQL CREATE FUNCTION and CREATE TYPE declarations.
    • Managing C language invariants and SQL invariants.
    • Handling Postgres-specific invariants like the function argument ABI.

    By using Rust, pgrx leverages procedural macros and type-safe abstractions to encode these invariants, reducing the need for expert-level knowledge of Postgres internals, C, and FFI.

  5. Overview of Odyssey

    master

    Odyssey is an advanced multi-threaded PostgreSQL connection pooler and request router. It is designed for high-performance scaling through worker threads that handle authentication and proxying. Key features include:

    • Multi-threaded processing: Scales performance by using worker threads for client-to-server and server-to-client requests, sharing global server connection pools.
    • Advanced transactional pooling: Tracks transaction state to automatically emit Cancel connections and perform Rollback on abandoned transactions during unexpected client disconnections.
    • Granular pooling control: Allows defining connection pools based on a Database and User pair, each with independent authentication, pooling modes, and limits.
    • Flexible Authentication: Supports SSL/TLS, md5, clear text, PAM, and LDAP authentication.
    • Traceable Logging: Generates unique uuids for client and server connections, allowing log events and error responses to be uniquely tracked.
  6. Overview of Kiwi PostgreSQL Protocol Library

    master

    Kiwi is a C library designed for handling PostgreSQL protocol-level messages. It provides functionality for both Frontend (client-to-server) and Backend (server-to-client) communication, making it suitable for writing client or server simulation applications.

    Key Constraints:

    • It does not support networking. It is strictly limited to buffer management and packet validation.
    • It is intended to be used in conjunction with the machinarium framework.
  7. Overview of pg_hint_plan

    master

    pg_hint_plan

    pg_hint_plan is an extension that allows you to manually influence PostgreSQL execution plans by using "hints" embedded within SQL comments.

    While PostgreSQL uses a cost-based optimizer that estimates the lowest-cost execution plan based on data statistics, the optimizer may not always account for certain data properties (such as correlation between columns). pg_hint_plan provides a mechanism to override these decisions using syntax like /*+ SeqScan(a) */ to ensure specific execution strategies are used.

  8. Overview of YugabyteDB Anywhere (YBA) features and management

    master

    YugabyteDB Anywhere (YBA) is a self-managed database-as-a-service for deploying and operating YugabyteDB database clusters (universes) at scale.

    Key Capabilities

    • Fault Tolerance: Supports deployments that tolerate single/multiple node, availability zone, region, or cloud provider failures.
    • Replication: Supports xCluster deployments for asynchronous data replication between universes (e.g., for disaster recovery).
    • Security: Provides encryption in transit (CA and self-signed certificates) and encryption at rest via integration with AWS, GCP, Azure, and Hashicorp Vault KMS.
    • Backups: Supports scheduled, incremental, and full backups to AWS S3, Google GCS, Azure Storage, and vanilla NFS.
    • Observability: Integrated alerting and monitoring using Prometheus.
    • Authentication: Supports LDAP and OIDC.

    Day 2 Operations

    YBA enables several online management tasks without disrupting existing clients:

    • Online scale in/out and vertical scale up/down.
    • Online database software upgrades and configuration changes.
    • Online OS patching.
    • Point-in-time recovery and certificate/KMS key rotation.
    • Performance monitoring and tuning via the Performance Advisor.
  9. Overview of YugabyteDB

    master
    YugabyteDB is a PostgreSQL-compatible, high-performance, cloud-native, distributed SQL database. It is designed for cloud-native OLTP applications that require transactional consistency, scalability, high fault tolerance, or global distribution. It combines relational database benefits with NoSQL scalability.
  10. Overview of Machinarium

    master

    Machinarium is a library for creating fast, networked, and event-driven asynchronous applications using a synchronous/procedural programming style. It replaces traditional callback-based approaches with efficient cooperative multi-tasking primitives (coroutines) scheduled via epoll(7) event-loop logic.

    Key capabilities include:

    • High Concurrency: Each Machinarium thread can handle thousands of coroutines, each with its own stack context.
    • Messaging & Channels: Provides Inter-Process Communication (IPC) between threads and coroutines, reducing the need for manual access synchronization.
    • High-Performance Networking: Uses a buffered IO API with readahead support to minimize system calls and epoll(7) overhead.
    • SSL/TLS Support: Provides a TLS API that can automatically upgrade existing IO contexts.
    • Non-blocking DNS: Uses a dedicated thread-pool for DNS resolution (e.g., getaddrinfo()) to prevent blocking the main coroutine execution.
    • Timeouts and Cancellation: All blocking API methods support timeout flags and allow one coroutine to Cancel ongoing blocking calls in another coroutine.
  11. Overview of DocumentDB RUM access method

    master

    The documentdb_rum module is a fork of the standard RUM access method designed to support document-centric scenarios.

    Key characteristics:

    • Compatibility: It maintains the same storage layout and disk content as the standard RUM index, making it fully backwards compatible.
    • Implementation: It is based on the GIN access method code and is designed such that changes are restricted to the query path, volatile path, or ways that remain compatible with indexes built with the default RUM repository.