feat: Add OceanBase as Primary Database Support #12827
Closed
+570
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
This PR adds support for OceanBase as the primary database in RAGFlow, allowing users to leverage OceanBase's high availability and scalability features.
Background:
RAGFlow currently supports MySQL and PostgreSQL as primary databases
OceanBase is a distributed relational database with MySQL compatibility mode
This feature is part of the RAGFlow + OceanBase Hackathon initiative
Key Changes:
Created RetryingPooledOceanBaseDatabase class inheriting from Peewee's MySQL database class
Added OceanBase to PooledDatabase, DatabaseMigrator, TextFieldType, and DatabaseLock enums
Implemented OceanBaseDatabaseLock for distributed locking support
Updated configuration templates for OceanBase connection settings
Added CI tests for OceanBase database scenarios
Usage:
Users can switch to OceanBase by setting the environment variable:
DB_TYPE=oceanbase
Related Files:
api/db/db_models.py - Database model definitions and connection classes
docker/.env - Environment variable configuration
docker/service_conf.yaml.template - Service configuration template
Technical Specification:
See docs/oceanbase-primary-db-technical-spec.md for detailed implementation plan.
Type of change