• 请不要在回答技术问题时复制粘贴 AI 生成的内容
zealinux
V2EX  ›  程序员

有没有简单的只支持读写分离的 proxy 服务

  •  
  •   zealinux · Mar 1, 2021 · 2534 views
    This topic created in 2077 days ago, the information mentioned may be changed or developed.

    用了几个高 star 的项目,立马发现 bug 出来。不能在生产环境用。

    不知道有没有简单的只支持读写分离的项目,几个项目感觉是 KPI 出来的,极其复杂。 功能很多,bug 也很多。

    我的需求:

    A => RW-proxy-server => 写:主库 || 读:slave0,slave1
    

    不需要其他什么乱七八糟的分表功能。

    隐约觉得应该有这样专注的项目,可能是用 golang 写的。 求推荐

    10 replies  •  2021-11-05 13:51:16 +08:00
    F281M6Dh8DXpD1g2
    F281M6Dh8DXpD1g2
    Mar 1, 2021
    1
    你要的这个本来就足够复杂了,随便写写肯定 bug 满天飞
    py88pQ2hZ7PJw0v4
    py88pQ2hZ7PJw0v4
    Mar 1, 2021
    2
    zealinux
    zealinux
    OP
    Mar 1, 2021
    3
    @DollarKiller 关键不在复制,而是现在已经创建了一个副本。
    关键点应该中间服务包装 mysql 协议,鉴权,解析 sql 和分发流量
    py88pQ2hZ7PJw0v4
    py88pQ2hZ7PJw0v4
    Mar 1, 2021
    4
    @zealinux 文档看仔细点 Server package supplies a framework to implement a simple MySQL server which can handle the packets from the MySQL client. You can use it to build your own MySQL proxy. The server connection is compatible with MySQL 5.5, 5.6, 5.7, and 8.0 versions, so that most MySQL clients should be able to connect to the Server without modifications.
    bthulu
    bthulu
    Mar 1, 2021
    5
    mysql 客户端我记得原生支持读写分离的啊, 什么服务都不需要用
    bthulu
    bthulu
    Mar 1, 2021
    6
    jdbc 里直接在 url 里设好就行了, jdbc:mysql:replication://master:3306,slave1:3306,slave2:3306/test
    当事务为 readonly 的时候, jdbc 驱动会自动去 slave 读数据.
    dfzj
    dfzj
    Mar 1, 2021
    7
    shardingsphere
    SmiteChow
    SmiteChow
    Mar 2, 2021
    8
    A 自己肯定知道操作是读 /写,不需要代理。
    xiaoyanbot
    xiaoyanbot
    Nov 5, 2021
    9
    有意思, 值得关注
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1724 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 12:40 · PVG 20:40 · LAX 04:40 · JFK 07:40
    ♥ Do have faith in what you're doing.