The Rules of Scalable database

16
The Rules of Scalable Database 4 Web Site [email protected] Wednesday, October 31, 12

description

 

Transcript of The Rules of Scalable database

Page 1: The Rules of Scalable database

The Rules of Scalable Database

4 Web [email protected]

Wednesday, October 31, 12

Page 2: The Rules of Scalable database

No PL/SQL

• 剥离业务逻辑 ( B/S vs. C/S )

• SPOF

Wednesday, October 31, 12

Page 3: The Rules of Scalable database

SQL

• 更⼩小的执⾏行成本(Cost)

• 更少的执⾏行频率• 更稳定的执⾏行计划

Wednesday, October 31, 12

Page 4: The Rules of Scalable database

Benchmark

• 端到端的基准测试 (Benchmark)

• SQL Trace / Tkprof /10046... not enough

Wednesday, October 31, 12

Page 5: The Rules of Scalable database

DB 不是消息系统

• 消息队列持久化• 应⽤用场景

RDBMS vs NoSQL(MongoDB)

Wednesday, October 31, 12

Page 6: The Rules of Scalable database

存储合适的内容

• RDBMS 是 RDBMS

• 选择合适的字段、数据类型• 尽量避免操作 Blob 字段

Wednesday, October 31, 12

Page 7: The Rules of Scalable database

反范式设计

• 适当反范式严格遵守 3NF 是缘⽉⽊木求⻥鱼

• 是否有⾜足够的设计能⼒力,看有多⼤大的能⼒力做反范式设计

• 拥抱冗余,做好 Meta 数据管理

Wednesday, October 31, 12

Page 8: The Rules of Scalable database

分区

• 合理利⽤用分区(Partition)

分区解决的问题全局索引与可维护性

• Partition 与性能

Wednesday, October 31, 12

Page 9: The Rules of Scalable database

Sharding

• ⽔水平 vs. 垂直分⽚片

• 分布式事务: No Oracle XA

• Oracle 0; MySQL +1; PostgreSQL +2

Wednesday, October 31, 12

Page 10: The Rules of Scalable database

新特性

• 作为伪技术的那些特性(Cursor_Sharing)

• 试验性质的新特性• 杀⼿手级特性

Wednesday, October 31, 12

Page 11: The Rules of Scalable database

IOPS

• Tape is Dead

• Disk is Tape

• Flash is Disk

固态盘(SSD)与 PCI-E Flash,与 Flash Storage 以及使⽤用 Flash 作为 Cache 的各种可能

• RAM Locality is King

Wednesday, October 31, 12

Page 12: The Rules of Scalable database

MAA

• Maximum Availability Architecture

• Data Guard 最佳实践

Wednesday, October 31, 12

Page 13: The Rules of Scalable database

Scalable People

• 业务能⼒力扩展• 技术能⼒力扩展

Wednesday, October 31, 12

Page 14: The Rules of Scalable database

案例分析:12306

Wednesday, October 31, 12

Page 15: The Rules of Scalable database

推荐⼏几本书

Wednesday, October 31, 12

Page 16: The Rules of Scalable database

Q/A

Wednesday, October 31, 12