V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
dancercl
V2EX  ›  MySQL

如果要实现zero-downtime deployment,那DB的升级一般怎么做呢?

  •  
  •   dancercl · Jul 11, 2013 · 4254 views
    This topic created in 4685 days ago, the information mentioned may be changed or developed.
    最近想尝试用golang建个API server,无意发现
    goagain(https://github.com/rcrowley/goagain)可以实现zero-downtime deployment,有点想用起来,但由于旧的代码和新的代码可能同时访问DB,所以DB的升级问题不好解决(目前用的postgresql)。

    我感觉不停机升级在python和ruby界好像有不少案例了(或者是错觉?),但google出来的DB解决方案都比较复杂并容易出错。

    此外我尝试了一下mongodb,由于是schema-less所以这个问题可以完美的绕开,但感觉只为了这个目的而换DB太小题大作了。

    各位有什么好的想法吗?
    2 replies    1970-01-01 08:00:00 +08:00
    julyclyde
        1
    julyclyde  
       Jul 13, 2013
    pt-online-schema-change
    或者是应用层解决
    Livid
        2
    Livid  
    MOD
    PRO
       Jul 13, 2013
    不要一口气运行很多 alter table,这样很容易出事,而且出事之后的状况会很复杂。

    一次一条,逐步上线小修改,会比较安全。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3163 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 51ms · UTC 03:04 · PVG 11:04 · LAX 20:04 · JFK 23:04
    ♥ Do have faith in what you're doing.