Description
Description:
We’d like to request support for multiple database connections across both the ORM
and SQL
modules in Yokai
. This feature is crucial for complex projects that rely on multiple database instances or require specific query routing to different connections. Built-in support for dbresolver
and sharding
in both modules would elevate Yokai
, enabling it to efficiently handle high-load distributed systems and complex data architectures.
Requested Features:
- Multiple Connections Support for ORM and SQL Modules:
-
Enable configuration and usage of multiple database connections in both
ORM
andSQL
modules. -
Allow seamless switching between connections within a single application context, so specific models or queries can utilize different databases as needed.
- dbresolver Integration in Both Modules:
- Implement built-in
dbresolver
capabilities to manage automatic read-write splitting and load balancing among replicas. - Ensure compatibility with both
ORM
andSQL
modules to cover various use cases.
- Sharding Support:
- Add sharding capabilities, allowing data to be distributed across multiple databases with both
ORM
andSQL
modules. - Provide flexible sharding logic, customizable for different project needs.
Why This is Needed:
Many complex projects, particularly those that are data-intensive, require multiple database connections and dynamic query routing. Built-in dbresolver
and sharding
functionality would make Yokai’s ORM
and SQL
modules more powerful, ensuring better scalability, reduced latency, and improved load handling.
Suggested Implementation:
Consider implementing these features as part of the core ORM
and SQL
modules or as an optional extension that seamlessly integrates into Yokai’s ecosystem.