Skip to content

Instantly share code, notes, and snippets.

View ideawu's full-sized avatar
🎯

吴祖洋 ideawu

🎯
View GitHub Profile
@ideawu
ideawu / 多写入点数据同步.md
Last active April 23, 2021 02:43
多写入点数据同步
  • 多个节点组成一个 raft 组
  • 某个组可以作为另一个组的 slave, 从另一组同步 binlog
  • leader 负责从另一个组同步 binlog, followers 从 leader 处同步, 不走 raft
  • 两组 binlog 如何 merge?
@ideawu
ideawu / 数据库最常用的特性.md
Last active May 21, 2021 04:12
数据库最常用的特性

根据我的从业经验, 用户对一个(分布式)数据库系统, 最看重这些特性:

  1. 多副本, 数据安全性
    • 能提供强一致性更好, 但基于性能考虑, 最终一致性(异步复制)有广泛的用户需求
  2. 节点容灾, 部分服务器故障, 不影响整体系统的运行
    • 方案选择, 倾向于增加无状态 proxy 层
  3. "伪装"成一个单机数据库实例, 底层细节对用户隐藏
    • 平滑扩容, 加机器不影响业务, 不需要业务在代码和架构上做改变
  4. 数据全球同步, 最终一致
  • 一个大区的日志序列是顺序 apply, 但多个大区的日志序列是乱序 apply
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active July 17, 2024 14:20
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@jboner
jboner / latency.txt
Last active July 22, 2024 14:44
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD