Meituan-Dianping / Meituan-Dianping/DBProxy

是否可以增加分表规则

Open
#130 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
2.3k
Forks
554
PR merge metrics
No merged PRs in 30d

Description

**目前DBProxy线上使用的版本支持分表功能,分表策略目前为:hash。

原使用Atlas
.当通过Atlas执行(SELECT、DELETE、UPDATE、INSERT、REPLACE)操作时,Atlas会根据分表结果(id%100=k),定位到相应的子表(stu_k)。例如,执行select * from stu where id=110;,Atlas会自动从stu_10这张子表返回查询结果。但如果执行SQL语句(select * from stu;)时不带上id,则会提示执行stu 表不存在。
==============**=======
是否可以增加 Atlas 一样的分表规则 以方便切换 。。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not identify files, entry points, or tests for the sharding implementation. Start by locating DBProxy's existing hash-based table-routing logic and compare its behavior with the Atlas examples in the report. Done would require a defined compatible rule and verified routing for the listed SQL operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.