Taobao presentation

49
淘寶技術這十年 心得分享

Transcript of Taobao presentation

Page 1: Taobao presentation

淘寶技術這十年

心得分享

Page 2: Taobao presentation

What is 淘寶 ?

Page 3: Taobao presentation
Page 4: Taobao presentation

雙十一 (光棍節)

Page 5: Taobao presentation

營業額

2009 5000萬

2010 9.36億

2011 52億

2012 191億

2013 350億

網站交易數據

2012訂單高峰 1.3萬筆/秒全天訪問 UV 2.12億

2013 總成交筆數:1.71億筆

全天訪問 UV:4.02億

Page 6: Taobao presentation

架構演進

Page 7: Taobao presentation

2003/05 ~ 2004/01淘寶 v1.0

Page 8: Taobao presentation
Page 9: Taobao presentation

Application

Apache

mod_php4

pear_DB

MySQLMaster

MySQLSlave2

MySQLSlave1

READREAD / WRITE

READ

ReplicationReplication

Page 10: Taobao presentation
Page 11: Taobao presentation
Page 12: Taobao presentation

Issue

Page 13: Taobao presentation

Table

T1 T3 T5T4T2

Table-Level Locking

Page 14: Taobao presentation

MasterSlave

Primary-Key Conflict

T1

T2

Replication

Replication

Page 15: Taobao presentation

2004 /01 ~ 2004/05淘寶 v1.1

Page 16: Taobao presentation

Application

Apache

mod_php4

pear_DB

OracleREAD / WRITE

SQL Relay

Page 17: Taobao presentation

Connection Pool

DB

Application

C1 C2 C3

T1 T2 T3

Page 18: Taobao presentation

Oracle Real Application Clusters (RAC)

Page 19: Taobao presentation

Application

File System

Storage

Network

Network-Attached Storage(NAS)

Page 20: Taobao presentation

Issue

Page 21: Taobao presentation

T1 T3 T5T4T2

Connection Deadlock

Connection Pool

Page 22: Taobao presentation

2004/02 ~ 2005/03淘寶 v2.0

Page 23: Taobao presentation

Application

JBOSS

淘寶MVC

EJB

OracleREAD / WRITE

OR-Mapping

iSearch

Node 1 Node n

Dump

Search

Page 24: Taobao presentation

View

Controller

Model

Manipulate

User Action

Notify

Update

Model-View-Controller

Page 25: Taobao presentation

Java EE Application Server

Web Container

ServletJSP Page

EJB Container

EJB Bean EJB Bean

Client

Page 26: Taobao presentation

Application

DBTable A

Table B

Table C

Object A

Object B

Object C

Object-Relational Mapping

Page 27: Taobao presentation

Enterprise Java Bean

Page 28: Taobao presentation

Storage

Application

File System

FC/Gbe

Storage Area Network(SAN)

Page 29: Taobao presentation

2004/10 ~ 2007/01淘寶 v2.1

Page 30: Taobao presentation

Application

JBOSS

淘寶MVC

Spring

OracleREAD / WRITE

OR-Mapping

iSearch

Node 1 Node n

Dump

Search

Oracle

Oracle Oracle

Cache

Page 31: Taobao presentation

Item A Item B UserA

Application

Database Sharding

UserB

Page 32: Taobao presentation

DB

Application Cache

Client

Update

Get

Update

Get / Update

Database Cache

Page 33: Taobao presentation

2006/10 ~ 2007/12淘寶 v2.2

Page 34: Taobao presentation

Application

JBOSS

淘寶MVC

Spring

Oracle

READ / WRITE

OR-Mapping

iSearch

Node 1 Node n

DumpSearch

Oracle

Oracle Oracle

TFS(分散式儲存)

Node 1 Node nTair

(Cache)

Page 35: Taobao presentation

淘寶 Tair

Page 36: Taobao presentation

淘寶 TFS

Page 37: Taobao presentation

2008/01 ~ present淘寶 v3.0

Page 38: Taobao presentation

業務系統

TM IM Detail SS

核心業務服務

TC IC SC

基礎業務服務

UIC Forest

HSF

HSF

Notify

DB / TFS / NAS

Page 39: Taobao presentation

Application Layer

TBSession WebX Lvs Tengine

CDN

Service Layer

TDDL TFS Tair Search

HSF Notify Configuration

Page 40: Taobao presentation

Content Delivery Network (CDN)Traditional Distribution

Page 41: Taobao presentation

Service Provider

Config ServerClient

Service Provider

Register

Invoke

Register

Request

High-Speed Service Framework (HSF)

Page 42: Taobao presentation

Notify Server

Config Server

Notify Client

RegisterRegister

淘寶 Notify

DB

Produce / Consume

Page 43: Taobao presentation

心得感想

Page 44: Taobao presentation

Big Data !!

Page 45: Taobao presentation

羅馬不是一天造成的

Page 46: Taobao presentation

Good Enough

Page 47: Taobao presentation

參考資料

Page 48: Taobao presentation

LAMP - http://en.wikipedia.org/wiki/LAMPPHPAuction - http://www.enuuk.com/homeSQL Relay - http://sqlrelay.sourceforge.net/Oracle RAC - http://en.wikipedia.org/wiki/Oracle_RACEJB - http://en.wikipedia.org/wiki/Enterprise_JavaBeans淘寶MVC - http://www.openwebx.org/JBoss AP7 - http://www.jboss.org/jbossasNAS - http://en.wikipedia.org/wiki/Network-attached_storageSAN - http://en.wikipedia.org/wiki/Storage_area_networkDB Sharding - http://en.wikipedia.org/wiki/Shard_(database_architecture)DB Cache - http://en.wikipedia.org/wiki/Database_caching淘寶HSF - http://ppt.cc/qYzHCDN - http://en.wikipedia.org/wiki/Content_delivery_network淘寶 Tair - http://code.taobao.org/p/tair/wiki/index/

Page 49: Taobao presentation

Q & A