Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Destination) - Couchbase connector 🎉 #47991

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

teetangh
Copy link

What

Implementation of a Couchbase destination connector that enables Airbyte to write data to Couchbase databases. This connector:

  • Supports all Airbyte sync modes (append, append-dedup, overwrite)
  • Handles schema validation and data type conversions
  • Implements efficient batch writing with retry mechanisms
  • Provides robust error handling and reporting

How

The implementation achieves its goals through several key mechanisms:

  1. Connection Management:

    • Uses PasswordAuthenticator for secure connections
    • Implements connection testing with temporary collection creation
    • Configures appropriate timeouts for operations
  2. Data Handling:

    • Implements batch processing with configurable batch sizes (max 1000)
    • Generates unique document IDs based on sync mode and primary keys
    • Validates records against JSON schema before writing
    • Handles null values intelligently based on schema requirements
  3. Sync Modes:

    • Append: Generates UUID-based document IDs
    • Append-dedup: Uses primary key fields for document IDs
    • Overwrite: Clears existing collection data before sync
  4. Error Handling:

    • Implements exponential backoff retry mechanism
    • Handles document conflicts based on sync mode
    • Provides detailed error reporting via AirbyteTraceMessages

Review guide

  1. destination.py:
    • check(): Connection testing and validation
    • write(): Main data writing implementation
    • _prepare_record(): Record validation and document preparation
    • _flush_buffer(): Batch writing with retry logic
    • _setup_collection(): Collection management
    • Helper methods for ID generation, null handling, etc.

User Impact

Users gain the ability to:

  • Write Airbyte data to Couchbase databases with configurable sync modes
  • Validate data against schemas before writing
  • Configure batch sizes for optimal performance
  • Get detailed error reporting for troubleshooting

Side effects to consider:

  • Overwrite mode clears existing collection data
  • Primary key conflicts in append-dedup mode skip new records
  • Schema validation may reject invalid records
  • Performance depends on batch size configuration

Can this PR be safely reverted and rolled back?

  • YES 💚

The implementation is self-contained within the destination-couchbase connector and doesn't modify any shared infrastructure. Rolling back would only affect this specific connector's functionality.

Copy link

vercel bot commented Oct 30, 2024

@teetangh is attempting to deploy a commit to the Airbyte Growth Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Oct 30, 2024

CLA assistant check
All committers have signed the CLA.

- Allow Couchbase to be hosted anywhere
- Update base image to version 2.0.0
- Set release date to "2024-10-30"
- Add CDK tag to metadata

feat: Update destination.py tests

- Import necessary modules
- Add test cases for different Airbyte messages and sync modes
@teetangh teetangh temporarily deployed to community-ci-auto October 30, 2024 11:11 — with GitHub Actions Inactive
@teetangh teetangh temporarily deployed to community-ci-auto October 30, 2024 11:11 — with GitHub Actions Inactive
@teetangh teetangh changed the title (Destination) - Couchbase connector (Destination) - Couchbase connector 🎉 Oct 30, 2024
@teetangh teetangh marked this pull request as ready for review October 30, 2024 11:31
@teetangh teetangh requested a review from a team as a code owner February 19, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation community connectors/destination/couchbase
Projects
Development

Successfully merging this pull request may close these issues.

5 participants