V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
zealinux
V2EX  ›  程序员

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

  •  
  •   zealinux · Mar 1, 2021 · 2149 views
    This topic created in 1895 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
        1
    F281M6Dh8DXpD1g2  
       Mar 1, 2021
    你要的这个本来就足够复杂了,随便写写肯定 bug 满天飞
    py88pQ2hZ7PJw0v4
        2
    py88pQ2hZ7PJw0v4  
       Mar 1, 2021
    zealinux
        3
    zealinux  
    OP
       Mar 1, 2021
    @DollarKiller 关键不在复制,而是现在已经创建了一个副本。
    关键点应该中间服务包装 mysql 协议,鉴权,解析 sql 和分发流量
    py88pQ2hZ7PJw0v4
        4
    py88pQ2hZ7PJw0v4  
       Mar 1, 2021
    @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
        5
    bthulu  
       Mar 1, 2021
    mysql 客户端我记得原生支持读写分离的啊, 什么服务都不需要用
    bthulu
        6
    bthulu  
       Mar 1, 2021
    jdbc 里直接在 url 里设好就行了, jdbc:mysql:replication://master:3306,slave1:3306,slave2:3306/test
    当事务为 readonly 的时候, jdbc 驱动会自动去 slave 读数据.
    dfzj
        7
    dfzj  
       Mar 1, 2021
    shardingsphere
    SmiteChow
        8
    SmiteChow  
       Mar 2, 2021
    A 自己肯定知道操作是读 /写,不需要代理。
    xiaoyanbot
        9
    xiaoyanbot  
       Nov 5, 2021
    有意思, 值得关注
    xiaoyanbot
        10
    xiaoyanbot  
       Nov 5, 2021
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1607 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 16:39 · PVG 00:39 · LAX 09:39 · JFK 12:39
    ♥ Do have faith in what you're doing.