分为两种:垂直分区和水平分区。
从文档:
垂直分区
垂直分区可在多个数据库中放置不同种类的对象或不同的表:
Run Code Online (Sandbox Code Playgroud)engine1 = create_engine('postgres://db1') engine2 = create_engine('postgres://db2') Session = sessionmaker(twophase=True) # bind User operations to engine 1, Account operations to engine 2 Session.configure(binds={User:engine1, Account:engine2}) session = Session()水平分区
水平分区将单个表(或一组表)的行跨多个数据库进行分区。
请参阅中的“分片”示例
attribute_shard.py
只是问您是否需要有关这些的更多信息,最好提供有关您想做什么的更多信息。
| 归档时间: |
|
| 查看次数: |
4957 次 |
| 最近记录: |