# googleapis/python-bigtable architecture

> Architecture diagram of the GitHub repository googleapis/python-bigtable, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/googleapis/python-bigtable
- Repository: https://github.com/googleapis/python-bigtable

## Overview

##### Main Components

a. Client Layer
- Classic Client (v2 Client)
- New Async Data Client
- Admin Clients (Instance Admin and Table Admin)

b. Transport Layer
- gRPC
- REST
- Async/Sync implementations

c. Core Functionality Groups
- Data Operations
- Admin Operations
- Authentication/Authorization

**[Client Applications]**
- ↓
**[Python Bigtable Client Library]**
- Data Client Layer
- Async Client (BigtableDataClientAsync)
- Sync Client

- Admin Client Layer
- Instance Admin
- Table Admin

- Transport Layer
- gRPC
- REST

- Core Components
- Row Operations
- Mutations
- Filters
- Query Execution

- ↓
**[Google Cloud Bigtable Service]**

##### Important Relationships to Highlight

- How the async and sync clients share common components
- Relationship between data operations and transport layer
- Demonstrate how admin operations interact with the service
- Authentication flow across all components

##### Implementation Details

Technical details such as:
- Supported Python versions (3.7+)
- Transport protocols (gRPC/REST)
- Key dependencies
- Authentication mechanisms

##### Notes

Annotations explaining:
- The distinction between classic and new async clients
- Performance considerations for async operations
- Admin operation limitations
- Authentication requirements

This system design should help developers understand both the overall architecture and the specific implementation details of the Google Cloud Bigtable Python client library.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Client Interface]:::client
        L2[Data Operations]:::data
        L3[Admin Operations]:::admin
        L4[Transport Layer]:::transport
        L5[Core Component]:::core
        L6[External Service]:::external
    end

    Client[Client Applications]:::external

    subgraph "Python Bigtable Client Library"
        subgraph "Client Layer"
            Classic["Classic Client (v2)"]:::client
            AsyncData["Async Data Client"]:::client
            SyncData["Sync Data Client"]:::client
            InstAdmin["Instance Admin Client"]:::admin
            TableAdmin["Table Admin Client"]:::admin
        end

        subgraph "Core Components"
            RowOps["Row Operations"]:::core
            Mutations["Mutations"]:::data
            Filters["Filters"]:::core
            QueryExec["Query Execution"]:::core
            CoreTypes["Core Types"]:::core
            MutBatch["Mutations Batcher"]:::data
        end

        subgraph "Transport Layer"
            gRPC["gRPC Transport"]:::transport
            REST["REST Transport"]:::transport
        end
    end

    Service["Google Cloud Bigtable Service"]:::external

    %% Relationships
    Client --> Classic
    Client --> AsyncData
    Client --> SyncData
    Client --> InstAdmin
    Client --> TableAdmin

    Classic --> RowOps
    Classic --> Mutations
    AsyncData --> RowOps
    AsyncData --> Mutations
    SyncData --> RowOps
    SyncData --> Mutations

    RowOps --> Filters
    RowOps --> QueryExec
    Mutations --> MutBatch
    
    InstAdmin --> gRPC
    TableAdmin --> gRPC
    RowOps --> gRPC
    MutBatch --> gRPC
    
    InstAdmin --> REST
    TableAdmin --> REST
    RowOps --> REST
    MutBatch --> REST

    gRPC --> Service
    REST --> Service

    %% Click Events
    click Classic "https://github.com/googleapis/python-bigtable/blob/main/google/cloud/bigtable/client.py"
    click AsyncData "https://github.com/googleapis/python-bigtable/blob/main/google/cloud/bigtable/data/_async/client.py"
    click SyncData "https://github.com/googleapis/python-bigtable/blob/main/google/cloud/bigtable/data/_sync_autogen/client.py"
    click InstAdmin "https://github.com/googleapis/python-bigtable/tree/main/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/"
    click TableAdmin "https://github.com/googleapis/python-bigtable/tree/main/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/"
    click gRPC "https://github.com/googleapis/python-bigtable/tree/main/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/"
    click REST "https://github.com/googleapis/python-bigtable/tree/main/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/"
    click RowOps "https://github.com/googleapis/python-bigtable/blob/main/google/cloud/bigtable/data/row.py"
    click Mutations "https://github.com/googleapis/python-bigtable/blob/main/google/cloud/bigtable/data/mutations.py"
    click Filters "https://github.com/googleapis/python-bigtable/blob/main/google/cloud/bigtable/data/row_filters.py"
    click QueryExec "https://github.com/googleapis/python-bigtable/tree/main/google/cloud/bigtable/data/execute_query/"
    click MutBatch "https://github.com/googleapis/python-bigtable/blob/main/google/cloud/bigtable/data/_async/mutations_batcher.py"
    click CoreTypes "https://github.com/googleapis/python-bigtable/tree/main/google/cloud/bigtable_v2/types/"

    %% Styles
    classDef client fill:#3498db,stroke:#2980b9,color:white
    classDef data fill:#2ecc71,stroke:#27ae60,color:white
    classDef admin fill:#e67e22,stroke:#d35400,color:white
    classDef transport fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef core fill:#9b59b6,stroke:#8e44ad,color:white
    classDef external fill:#34495e,stroke:#2c3e50,color:white
```
