SlideShare a Scribd company logo
1 of 116
Download to read offline
Enterprise Architecture Case in PHP
2015-10-09
Ant
yftzeng@gmail.com
2015
2/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
2015
3/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
4/116
2015
學架構的優點是,會變帥;
   但缺點是,帥的不明顯。
5/116
2015
➊ 架構先決
無視人員、流程只講技術,是耍白痴
架構會影響公司文化、商業擴展;思維更要超越程式碼層次
6/116
2015
➋ 沒有完美的架構,只有最適的架構
無視場景只講架構,是耍流氓
若無法舉出架構的缺陷,代表你還無法掌握
盲目套用別人的架構,並不會讓你變得跟他一樣好
7/116
2015
High throughput Low latency
8/116
2015
千萬人同時在線
電子商務、線上媒體
低延遲回應
廣告平台 (30ms) 、高頻交易 (0.5~3ms)
9/116
2015
➌ 架構是演進的,預想但不過早調優
無視未來只求現有,是耍自閉
兵馬未動,糧草先行,預想下一步,下下一步,甚至下下下一步 ...
10/116
2015
Monolith
Microservices
SOA
Nanoservices
Picoservices ?
11/116
2015
Monolith → Microservices
Load balancing
Monolith
Cache Database
Network
12/116
2015
Monolith → Microservices
Load balancing
Monolith
Cache Database
Network
In-process
communication
A
C
B
D
13/116
2015
Monolith → Microservices
Load balancing
Cache Database
Network
In-process
communication
A
C
B
D
14/116
2015
Monolith → Microservices
Death Star Diagram
15/116
2015
Monolith → Microservices
Death Star Diagram (Gilt)
Ref: http://www.slideshare.net/goldbergjonathan/gilt-frommonolithrubyapptomicroservicescalaservicearchitecture140115150436phpapp01 (s45)
16/116
2015
Monolith → Microservices
Death Star Diagram (Twitter)
Ref: https://twitter.com/adrianco/status/441883572618948608
17/116
2015
Monolith → Microservices
Death Star Diagram (Netflix)
Ref: http://www.slideshare.net/BruceWong3/the-case-for-chaos (s12)
18/116
2015
In-process communication
Fast
Network (HTTP)
Slow and unreliable
19/116
2015
More worse,
overlay networks is slow ...
20/116
2015Ref: http://www.generictestdomain.net/docker/weave/networking/stupidity/2015/04/05/weave-is-kinda-slow/
21/116
2015Ref: https://arjanschaaf.github.io/is-the-network-the-limit/ (2015-06-29)
22/116
2015
2015
23/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
24/116
2015
Enterprise Architecture Case in PHP
https://www.muzik-online.com/
https://muzikair.com/
25/116
2015
We PHP❤
26/116
2015
ObjectGo
✖
✖
✖
✖
✖
Research Development
27/116
2015
對技術研究高度投入,專注節省工程師開發時間
投入時間分析研究 MySQL / PostgreSQL / PHP / Cassandra / Redis ... 等源碼
https://www.muzik-online.com/
https://muzikair.com/
28/116
2015
Multi Cloud
Private Azure LinodeAWS SoftLayerIDC
Configuration Management
DevOps
29/116
2015
追求 Cloud as a Cloud
Leverage w/o vendor lock-in
Build cloud on top of cloud
https://www.muzik-online.com/
https://muzikair.com/
30/116
2015
Multi Cloud
Private Azure LinodeAWS SoftLayerIDC
Configuration Management
DevOps
Cloud as a Cloud
2015
31/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
32/116
2015
乾坤之初,混沌玄黃
上古卷軸,大型冒險
33/116
2015
History > MUZIK Zero
Monolith
Database Filebed
2015
34/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
35/116
2015
巴赫 (Bach)
古典樂之父
36/116
2015
架構之始,動而至靜
披荊斬棘,開國立基
37/116
2015
History > MUZIK 1.0 (Bach)
Monolith Monolith
Database Filebed
38/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
Database Filebed
39/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
R1 R2
Database Filebed
40/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
PHPSESSID
R1 R2
R1
SESSION
Database Filebed
41/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
PHPSESSID PHPSESSID
R1 R2
R1 R2
SESSION
Database Filebed
42/116
2015
History > MUZIK 1.0 (Bach)
"Sticky" balancing / cookies
43/116
2015
History > MUZIK 1.0 (Bach)
Load balancing (sticky)
Monolith Monolith
PHPSESSID PHPSESSID
R1 R2
R2R1
SESSION
Database Filebed
44/116
2015
History > MUZIK 1.0 (Bach)
History > MUZIK 1.0 (Bach)
✔ Cons
✔ Load balancing do more works (lower performance)
✔ Unbalanced loads
✔ Supporting
✔ Some old hardware / software do not support 'sticky'
✔ Amazon ELB support sticky sessions on April 2010
✔ Hard to control and scale-out (Non-SDN, No APIs)
✔ 缺點
✔ 負載平衡器多了一些工作 ( 效能耗損 )
✔ 負載不平衡 ( 重度用戶會偏重使用某些機器 )
✔ 支援性
✔ 有些舊的硬體 / 軟體不支援 'sticky'
✔ 2010 年 4 月 Amazon ELB 才支援 sticky sessions
✔ 難以控制或橫向擴展 ( 硬體不支援 SDN ,沒有 API)
45/116
2015
History > MUZIK 1.0 (Bach)
Application server session replication
(Tomcat / JBoss / WAS)
46/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
PHPSESSID PHPSESSID
R1 R2
R2R1
SESSION SESSION
Replication
Database Filebed
47/116
2015
History > MUZIK 1.0 (Bach)
History > MUZIK 1.0 (Bach)
✔ Cons
✔ More application servers, more performance lost
✔ Broadcast storm
✔ Session serialization / unserialization (lower performance)
✔ Supporting
✔ Some application server do not supporting
✔ 缺點
✔ 應用伺服器愈多,同步效能愈差
✔ 廣播風暴
✔ Session 需要序列化 / 反序列化,影響效能
✔ 支援性
✔ 不是所有應用伺服器都支援 Session 複製
48/116
2015
History > MUZIK 1.0 (Bach)
Save sessions in database
(shared-nothing architecture)
49/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
R1 R2
Database Filebed
SESSION
R1 R2
50/116
2015
History > MUZIK 1.0 (Bach)
History > MUZIK 1.0 (Bach)
✔ Cons
✔ Need to modify application code (easy)
✔ Database do more works (lower performance)
✔ Database is more harder scale-out than application server
✔ 缺點
✔ 需要修改應用程式 ( 容易 )
✔ 資料庫多了一些工作 ( 效能耗損 )
✔ 資料庫相較應用伺服器更難以橫向擴展
51/116
2015
History > MUZIK 1.0 (Bach)
Save sessions in shared disks
(shared-nothing architecture)
52/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
R1 R2
R1 R2
Database Filebed
SESSION
53/116
2015
History > MUZIK 1.0 (Bach)
History > MUZIK 1.0 (Bach)
✔ Cons
✔ Need to modify application code (easy)
✔ Shared disk do more works (lower performance)
✔ Shared disk is hard to scale-out
✔ Session serialization / unserialization (lower performance)
✔ 缺點
✔ 需要修改應用程式 ( 容易 )
✔ 共享儲存庫多了一些工作 ( 效能耗損 )
✔ 共享儲存庫較難橫向擴展
✔ Session 需要序列化 / 反序列化,影響效能
54/116
2015
History > MUZIK 1.0 (Bach)
Save sessions in shared cache
(Memcached / Redis / Aerospike)
(shared-nothing architecture)
55/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
R1 R2
Database Filebed Cache
R1 R2
SESSION
56/116
2015
History > MUZIK 1.0 (Bach)
History > MUZIK 1.0 (Bach)
✔ Cons
✔ Need to modify application code (easy)
✔ Memcached need serialization / unserialization (lower performance)
✔ Redis does not
✔ Memcached do not support persistent store (thundering herd)
✔ Redis / Aerospike does
✔ Cache server do more works (lower performance)
✔ Cache server is hard to scale-out
✔ Aerospike is more easy
✔ 缺點
✔ 需要修改應用程式 ( 容易 )
✔ Memcahced 需要序列化 / 反序列化 ( 稍影響效能 )
✔ Redis 不需要
✔ Memcached 不支援永久儲存 ( 雪崩效應 )
✔ Redis / Aerospike 支援
✔ 快取伺服器多了一些工作 ( 效能耗損 )
✔ 快取伺服器較難以擴展
✔ Aerospike 相對簡單
57/116
2015
History > MUZIK 1.0 (Bach)
History > MUZIK 1.0 (Bach)
✔ Cons
✔ Cache servers need to be monitoring (become more complex)
✔ Cache servers need large memory (more expensive)
✔ Cache servers itself may bring thundering herd problem (even Redis)
✔ Cache server reduce number of database
✔ If without cache server, database will need more power to handle
✔ So if cache server crash, all traffic will transfer to database, and
resulting database crash too.
✔ Finally, database is depend on cache server.
✔ 缺點
✔ 快取伺服器需要集群與監控 ( 架構變複雜 )
✔ 快取伺服器需要大量記憶體 ( 費用較昂貴 )
✔ 快取伺服器本身很可能是雪崩效應的元兇 ( 即使是 Redis)
✔ 快取存在的意義,通常為了節省資料庫效能 / 減少資料庫連線數量。
✔ 若沒有快取,資料庫很可能需要多 10 倍或更多的數量。
✔ 一旦快取伺服器崩溾,流量若全轉向至資料庫,也會造成資料庫崩溾。
✔ 資料庫集群的崩溾,除了自身外,也多依賴了快取伺服器。
Web
App
Cache
Database
58/116
2015
History > MUZIK 1.0 (Bach)
Save sessions in client-side
(shared-nothing architecture)
59/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
R1 R2
R1 R2
Database Filebed
SESSION
SESSION SESSION
60/116
2015
History > MUZIK 1.0 (Bach)
History > MUZIK 1.0 (Bach)
✔ Pros
✔ Do not depend on Load balancing
✔ Do not depend on Application server
✔ Do not depend on Database
✔ Do not depend on Shared disk
✔ Do not depend on Cache server
✔ Shared-nothing architecture
✔ 優點
✔ 不依賴負載平衡器
✔ 不依賴應用伺服器
✔ 不依賴資料庫
✔ 不依賴共享儲存庫
✔ 不依賴快取伺服器
✔ Shared-nothing architecture
61/116
2015
History > MUZIK 1.0 (Bach)
History > MUZIK 1.0 (Bach)
✔ Cons
✔ Session size limited
✔ Session need encode / decode (lower performance)
✔ Less secure (depends on how to implement)
✔ More package size (few bytes more)
✔ 缺點
✔ Session 大小有限制
✔ Session 需要編碼 / 反編碼 ( 效能耗損 )
✔ 安全性稍低 ( 視如何實作 )
✔ 耗費更多網路頻寬 ( 多了幾 bytes)
62/116
2015
History > MUZIK 1.0 (Bach)
Load balancing
Monolith Monolith
R1 R2
R1 R2
Database Filebed
SESSION
SESSION SESSION
Session Manager Session Manager
63/116
2015
Migrations
遷移
✔ Vanilla PHP → Phalcon/MVC
✔ MVC is HOT, and we need it by this time
✔ Standard design pattern
✔ Full stack for Web
✔ High performance (C extension)
✔ Well document material
✔ Commit regularly
✔ Apache prefork → Nginx / PHP-FPM
✔ Vanilla PHP → Phalcon/MVC
✔ MVC 很熱門,而且當下時間點很適合我們
✔ 標準的設計模式
✔ 網頁全端開發
✔ 高效能 ( 基於 C 擴展 )
✔ 完整的文件
✔ 官方更新頻繁
✔ Apache prefork → Nginx / PHP-FPM
64/116
2015
Migrations
遷移
✔ Database schema re-design
✔ The metadata for classical music is much more complex than others
✔ Composer / Period
✔ Album / Genre / Work / Movement / Track
✔ Performer / Instrument
✔ etc.
✔ 資料庫結構重新設計
✔ 古典樂的後設資料非常複雜,比流行音樂複雜 N 倍
✔ 作曲家 / 時期
✔ 專輯 / 曲種 / 作品 / 樂章 / 音檔
✔ 演奏家 / 樂器
✔ 其它
65/116
2015
Why we still use MySQL
為什麼繼續使用 MySQL
✔ Easy / Mature than NoSQL / NewSQL
✔ Our team are familiar with MySQL
✔ Connection pool
✔ Almost everyone told me connection pool is good
✔ But can you tell me what is the drawbacks ?
✔ Hello guys, PHP support connection pool
✔ 目前業務場景下, RDBMS 相較於 NoSQL / NewSQL 更容易且成熟
✔ 團隊全員熟悉 MySQL
✔ Connection pool
✔ 幾乎每個人都會告訴我 connection pool 很好
✔ 但可以告訴我坑在哪嗎?
✔ 嗨!開發者們 , PHP 其實支援 connection pool
66/116
2015
Why we still use MySQL
為什麼繼續使用 MySQL
✔ Connection pool
✔ Not all application support connection pool
✔ Connection pool can not know much about servers status / loading
✔ Connection pool need to do resource cleanup when failed
✔ If your application is complexity, you need to do yourself
✔ Connection pool keep connection
✔ Occupied server connection / thread cache
✔ Connection pool
✔ 不是所有應用程式都支援 connection pool
✔ Connection pool 無法得知伺服器的狀態及承載
✔ Connection pool 遭遇錯誤時,必須執行完整的資源清理
✔ 如果你的應用很複雜,有自己的資源配置,那麼你必須自己清理回收
✔ Connection pool 會保持連線
✔ 佔用伺服器連線數及線程快取
67/116
2015
Why we still use MySQL
為什麼繼續使用 MySQL
✔ Connection pool
✔ An architecture problems
✔ If your database can keep 500 connections the most
✔ Each of application server's connection pool is 100
✔ In some cases, if you add the 6th
application server, it almost cannot
create any connection
✔ The 'connection pool' variable is a cross-architecture problem
✔ As mentioned above, connection pool usually cannot be adjusted
depends on database status
✔ If your have DBA and Backend team, the problem arise
✔ Connection pool
✔ 一個架構問題
✔ 如果你的資料庫最多能保持 500 連線數
✔ 每個應用伺服器的 connection pool 為 100
✔ 某些情況下,當你增加第六台應用伺服器時,該伺服器幾乎無法建立任何連線
✔ 'connection pool' 變數成為跨架構的全域變數
✔ 如前所述,通常 connection pool 無法得知伺服器狀態,所以無法自調適
✔ 如果成員又區分為 DBA 及後端兩組人馬時,這個問題會更嚴重
68/116
2015
Why we still use MySQL
為什麼繼續使用 MySQL
✔ MySQL
✔ MySQL is threaded-base model
✔ Support mass concurrency without connection pool
✔ Fit short database connection
✔ MySQL 5.7 connection overhead reduction
✔ 5.6: 62.5%
✔ 5.5: 40%
✔ MySQL
✔ MySQL 是線程模式
✔ 不需 Connection pool 就可以支持高併發
✔ 支持短連接使用資料庫
✔ MySQL 5.7 建立連線的開銷更少
✔ 是 5.6 版的 62.5%
✔ 是 5.5 版的 40%
2015
69/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
70/116
2015
海頓 (Haydn)
交響曲之父
71/116
2015
百納海川,方成其大
搜尋框架,各司其職
72/116
2015
History > MUZIK 2.0 (Haydn)
Load balancing
Monolith Monolith
Database Filebed Search
73/116
2015
New features
遷移
✔ ElasticSearch
✔ Solr is mature, but ElasticSearch is easy
✔ ElasticSearch is nature clustering / sharding
✔ Eventually Consistent
✔ For future purposes
✔ Monitoring
✔ ElasticSearch
✔ Solr 更成熟,但 ElasticSearch 比較容易上手
✔ ElasticSearch 天生支援 clustering / sharding
✔ Eventually Consistent ( 最終一致性 )
✔ 為了往後的架構設計
✔ Monitoring ( 監控 )
2015
74/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
75/116
2015
莫札特 (Mozart)
音樂神童
76/116
2015
不朽傑作,分而治之
英年早逝,順應變遷
77/116
2015
History > MUZIK 3.0 (Mozart)
Load balancing
Component Product
SMAAA
……. ...
Air
One …...
Study
Database Filebed Search
78/116
2015
History > MUZIK 3.0 (Mozart)
Load balancing
API Gateway
API Gateway
Air
…...One
Study
Database Filebed Search
SMAAA
...…….
79/116
2015
History > MUZIK 3.0 (Mozart)
Load balancing
API Gateway
API Gateway
Monitor
Air
…...
Database Filebed Search
One
StudySMAAA
...…….
80/116
2015
Migrations
遷移
✔ Phalcon → Phalcon Micro
✔ Microservices
✔ API Gateway (Q4 2014)
✔ With MUZIK micro framework
✔ Fast
✔ Components
✔ Secure
✔ Shared-nothing architecture
✔ Phalcon → Phalcon Micro
✔ Microservices
✔ API Gateway (Q4 2014)
✔ 融合 MUZIK 自主開發的微框架
✔ 快
✔ 元件化
✔ 安全
✔ Shared-nothing architecture
81/116
2015
Migrations
Ref: https://www.nginx.com/blog/building-microservices-using-an-api-gateway/
2015-06-15
82/116
2015
Migrations
Ref: https://www.nginx.com/blog/building-microservices-using-an-api-gateway/
83/116
2015
Migrations
遷移
✔ Phalcon → Phalcon Micro
✔ Microservices
✔ API Gateway (Q4 2014)
✔ Cons
✔ Not 100% microservices
✔ Carefully use it if will migrate to microservices in the future
✔ Merge or separate microservices those face client directly
✔ Phalcon → Phalcon Micro
✔ Microservices
✔ API Gateway (Q4 2014)
✔ 缺點
✔ 並不是 100% microservices
✔ 需特別注意未來架構演化的限制
✔ 如未來需要合併或拆分那些直接面對客戶端的 microservices
84/116
2015
Migrations
遷移
✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster
✔ Master-Master
✔ Requirements
✔ Geo-replication
✔ Automatic node joining
✔ Scalability
✔ Easy
✔ Maintenance
✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster
✔ Master-Master
✔ 需求
✔ Geo-replication ( 地域複製 )
✔ 自動增減節點
✔ 擴展性
✔ 易用性
✔ 維護性
85/116
2015
Migrations
遷移
✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster
✔ Master-Master
✔ Pros
✔ Read scalability
✔ Write scalability (?)
✔ etc.
✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster
✔ Master-Master
✔ 優點
✔ Read scalability ( 讀擴展性 )
✔ Write scalability ( 寫擴展性? )
✔ 其它
86/116
2015
Migrations
遷移
✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster
✔ Master-Master
✔ Cons
✔ Split brain
✔ Commit latency
✔ Hot-spot
✔ Deadlock on commit
✔ More nodes increase the transaction rollback rate
✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster
✔ Master-Master
✔ 缺點
✔ Split brain ( 腦裂 )
✔ Commit latency ( 提交延遲 )
✔ Hot-spot ( 熱點 )
✔ Deadlock on commit ( 提交死鎖 )
✔ 當節點愈多,交易回滾機率愈高
87/116
2015
History > MUZIK 3.0 (Mozart)
Database
#1
Database
#2
Database
#3
...
Applications
RW RW RW RW
Master-Master
88/116
2015
History > MUZIK 3.0 (Mozart)
Database
#1
Database
#2
Database
#3
...
Applications
RW RW RW RW
UPDATE t
SET …
WHERE id = 1
T1
Master-Master
UPDATE t
SET …
WHERE id = 1
T2
89/116
2015
History > MUZIK 3.0 (Mozart)
Database
#1
Database
#2
Database
#3
...
Applications
RW RW RW RW
UPDATE t
SET …
WHERE id = 1
T1
Master-Master
UPDATE t
SET …
WHERE id = 1
T2
100 → 200 100 → 200
90/116
2015
History > MUZIK 3.0 (Mozart)
Database
#1
Database
#2
Database
#3
...
Applications
RW RW RW RW
UPDATE t
SET …
WHERE id = 1
T1
Master-Master
UPDATE t
SET …
WHERE id = 1
T2
100 → 200 100 → 200
Deadlock / Rollback
91/116
2015
History > MUZIK 3.0 (Mozart)
Database
#1
Database
#2
Database
#3
...
Applications
Master-Master
Load balancing
W R
RR
92/116
2015
History > MUZIK 3.0 (Mozart)
Database
#1
Database
#2
Database
#3
...
Applications
UPDATE t
SET …
WHERE id = 1
T1
Master-Master
SELECT ...
T2
W R
RR
T3
SELECT ...
T4
SELECT ...
T5
Load balancing
93/116
2015
History > MUZIK 3.0 (Mozart)
Database
#1
Database
#2
Database
#3
...
Applications
UPDATE t
SET …
WHERE id = 1
T1
Master-Master
SELECT ...
T2
W R
RR
T3
SELECT ...
T4
SELECT ...
T5
Load balancingLoad balancing
HA
Monitor
94/116
2015
History > MUZIK 3.0 (Mozart)
Percona XtraDB Cluster: Multi-node writing and Unexpected deadlocks
2012-08-17
https://www.percona.com/blog/2012/08/17/percona-xtradb-cluster-multi-node-writing-and-unexpected-deadlocks/
Avoiding Deadlocks in Galera - Set up HAProxy for single-node writes
and multi-node reads
2013-09-17
http://www.severalnines.com/blog/avoiding-deadlocks-galera-set-haproxy-single-node-writes-and-multi-node-reads
Optimizing Percona XtraDB Cluster for write hotspots
2015-06-03
https://www.percona.com/blog/2015/06/03/optimizing-percona-xtradb-cluster-write-hotspots/
95/116
2015
History > MUZIK 3.0 (Mozart)
Database
#1
Database
#2
Database
#3
...
Applications
UPDATE t
SET …
WHERE id = 1
T1
Master-Master
SELECT ...
T2
W R
RR
T3
SELECT ...
T4
SELECT ...
T5
Load balancingLoad balancing
HA
Monitor
Hot-Spot
1
Complexity
2
96/116
2015
History > MUZIK 3.0 (Mozart)
Database
#1
Database
#2
Database
#3
...
Applications
RW RW RW RW
Master-Master
Smart Client
2015
97/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
98/116
2015
貝多芬 (Beethoven)
音樂神童
99/116
2015
承襲精髓,造就極限
如飢似渴,深蹲練功
100/116
2015
History > MUZIK 4.0 (Beethoven, +ing)
Geo DNS
Bare Metal
Azure
AWS
101/116
2015
Why not use Docker ?
為何不使用 Docker ?
✔ Docker is not yet widely in production
✔ http://sirupsen.com/production-docker/
✔ http://www.theplatform.net/2015/09/29/why-containers-at-scale-is-hard/
✔ Docker is not stable in our test environment
✔ We use Docker lots in our develop environment
✔ Performance loss on single machine in our testing
✔ Single Docker lost 8%
✔ Two Dockers lost 31%
✔ Four Dockers lost 51%
✔ Docker 為什麼還未在生產環境上普及
✔ http://sirupsen.com/production-docker/
✔ http://www.theplatform.net/2015/09/29/why-containers-at-scale-is-hard/
✔ Docker 在我們的測試環境中並不穩定,偶會無預警當機
✔ 我們仍然在我們的開發環境中大量使用
✔ 效能損失 ( 單機 / 我們的場景測試環境 )
✔ 單台 Docker 在單機時,損失 8 %
✔ 雙台 Docker 在單機時,共損失 31%
✔ 四台 Docker 在單機時,共損失 51%
2015
102/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
103/116
2015
History > MUZIK Next (maybe...)
Load balancing
Database
API Gateway
Content
MonitorFilebed Search Cache
AAA
Stream
Air
One …...
Study CDN
API Gateway
SM
104/116
2015
History > MUZIK Next (maybe...)
History > MUZIK Next (maybe...)
✔ CDN
✔ We are building our own CDN
✔ Hybrid MUZIK CDN with third-party services
✔ CDN
✔ 我們一直研究並嘗試自主研發 CDN
✔ 混用自主研發 CDN 及第三方的服務
105/116
2015
History > MUZIK Next (maybe...)
Load balancing
Database
API Gateway
Content
MonitorFilebed Search Cache Bigdata
AAA
Stream
Air
One …...
Study CDN
API Gateway
SM
106/116
2015
History > MUZIK Next (maybe...)
History > MUZIK Next (maybe...)
✔ BigData
✔ We are building our own BigData
✔ Hybrid MUZIK BigData with third-party services
✔ BigData
✔ 我們一直研究並嘗試自主研發 BigData
✔ 混用自主研發 BigData 及第三方的服務
107/116
2015
History > MUZIK Next (maybe...)
History > MUZIK Next (maybe...)
✔ BigData
✔ Questions
✔ Spark is faster than Hadoop ? What is the trade-off ?
✔ What is the limit of Spark ?
✔ The difference between Spark streaming and Storm streaming ?
✔ What is the limit of Amazon Redshift ?
✔ BigData
✔ 問題
✔ Spark 確定比 Hadoop 快嗎 ? 請問若有的話,是拿什麼條件交換 ?
✔ Spark 的限制是什麼 ?
✔ Spark streaming 與 Storm streaming 本質上的差異 ?
✔ Amazon Redshift 的限制是什麼 ?
2015
108/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
109/116
2015
PHP 7 ?
PHP 7 ?
✔ PHP 7 ? HHVM ?
✔ Hybrid PHP 7 / HHVM, but most PHP 7
✔ Migrating from PHP 5.6.x to PHP 7.0.x
✔ http://php.net/manual/en/migration70.php
✔ PHP 7 Compatibility Checker
✔ https://github.com/sstalle/php7cc
✔ Architecture painless (but code?)
✔ PHP 7 ? HHVM ?
✔ 混用 PHP 7 與 HHVM ,但大多都是 PHP 7
✔ Migrating from PHP 5.6.x to PHP 7.0.x
✔ http://php.net/manual/en/migration70.php
✔ PHP 7 Compatibility Checker
✔ https://github.com/sstalle/php7cc
✔ 架構無痛 ( 但程式碼? )
110/116
2015
PHP 7 ?
2015
111/116
Agenda
✔ Prologue
✔ History of MUZIK architecture
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 architecture design rules
議程
✔ 楔子
✔ MUZIK 架構演化史
✔ MUZIK Zero
✔ MUZIK 1.0 (Bach)
✔ MUZIK 2.0 (Haydn)
✔ MUZIK 3.0 (Mozart)
✔ MUZIK 4.0 (Beethoven)
✔ MUZIK Next
✔ PHP 7 ?
✔ 15 條架構設計心法
112/116
2015
15 architecture design rules
01. 冪等操作設計
Idempotent
02. 分層低耦設計
Decoupling
03. 服務節流設計
Throttling
04. 熱點緩衝設計
Leveraging
05. 服務同質檢測
Immutablility
06. 服務降級設計
Degrade
07. 拓撲調優設計
Topology
08. 日誌追蹤設計
Tracing
09. 監控警報設計
Monitoring
10. 自動修復設計
Self-healthy
11. 異常預測設計
Anomaly detection
12. 持續灰度發布
Continuous deployment
13. 自動擴展設計
Auto-scaling
14. 異地多活設計
Multi regional resiliency
15. 混沌破壞設計
Chaos tolerance
2015
113/116
Feedback 勘誤回報
yftzeng@gmail.com
2015
114/116
End 結語
➀ 架構先決。
➁ 沒有完美的架構,只有最適的架構。
➂ 架構是演進的,預想但不過早調優。
115/116
2015
每一個華麗架構背後,
   都有一堆齷齪的實現。
朕知道
了
116/116
2015
We PHP❤
Shared-nothing architecture
Monolith → Microservice
Phalcon → Phalcon Micro
Caching !?
Connection pool !?
Extension (Zephir) / HHVM / PHP 7 !?

More Related Content

What's hot

Scaling Automated Tests: Choosing an Appropriate Subset
Scaling Automated Tests: Choosing an Appropriate SubsetScaling Automated Tests: Choosing an Appropriate Subset
Scaling Automated Tests: Choosing an Appropriate SubsetTechWell
 
Janus conf19: TUTORIAL: KITE with network-instrumentation
Janus conf19: TUTORIAL: KITE with network-instrumentationJanus conf19: TUTORIAL: KITE with network-instrumentation
Janus conf19: TUTORIAL: KITE with network-instrumentationAlexandre Gouaillard
 
DevOOPS: Attacks and Defenses for DevOps Toolchains
DevOOPS: Attacks and Defenses for DevOps ToolchainsDevOOPS: Attacks and Defenses for DevOps Toolchains
DevOOPS: Attacks and Defenses for DevOps ToolchainsChris Gates
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
 
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...NodejsFoundation
 
[JOI] TOTVS Developers Joinville - Java #1
[JOI] TOTVS Developers Joinville - Java #1[JOI] TOTVS Developers Joinville - Java #1
[JOI] TOTVS Developers Joinville - Java #1Rubens Dos Santos Filho
 
Jenkins entwined with deployment and pragmatism
Jenkins entwined with deployment and pragmatismJenkins entwined with deployment and pragmatism
Jenkins entwined with deployment and pragmatismEric Ritchie
 
DEVNET-1148 Leveraging Cisco OpenStack Private Cloud for Developers
DEVNET-1148	Leveraging Cisco OpenStack Private Cloud for DevelopersDEVNET-1148	Leveraging Cisco OpenStack Private Cloud for Developers
DEVNET-1148 Leveraging Cisco OpenStack Private Cloud for DevelopersCisco DevNet
 
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaSOverpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaSJ On The Beach
 
Swimming upstream
Swimming upstreamSwimming upstream
Swimming upstreamDave Neary
 
2016 Q1 - WebRTC testing State of The Art
2016 Q1 - WebRTC testing State of The Art2016 Q1 - WebRTC testing State of The Art
2016 Q1 - WebRTC testing State of The ArtAlexandre Gouaillard
 
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)William Yeh
 
2009-12-04 New York City System z Executive Council
2009-12-04 New York City System z Executive Council2009-12-04 New York City System z Executive Council
2009-12-04 New York City System z Executive CouncilShawn Wells
 
360° Kubernetes Security: From Source Code to K8s Configuration Security
360° Kubernetes Security: From Source Code to K8s Configuration Security360° Kubernetes Security: From Source Code to K8s Configuration Security
360° Kubernetes Security: From Source Code to K8s Configuration SecurityDevOps.com
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaDana Luther
 
Hyperledger weatherreport20190219 公開版
Hyperledger weatherreport20190219 公開版Hyperledger weatherreport20190219 公開版
Hyperledger weatherreport20190219 公開版Hyperleger Tokyo Meetup
 
Workflow, container, and beyond
Workflow, container, and beyondWorkflow, container, and beyond
Workflow, container, and beyondKohsuke Kawaguchi
 
Production ready kubernetes
Production ready kubernetesProduction ready kubernetes
Production ready kubernetesArnaud MAZIN
 
DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015Chris Gates
 
twMVC#44 如何測試與保護你的 web application with playwright
twMVC#44 如何測試與保護你的 web application with playwrighttwMVC#44 如何測試與保護你的 web application with playwright
twMVC#44 如何測試與保護你的 web application with playwrighttwMVC
 

What's hot (20)

Scaling Automated Tests: Choosing an Appropriate Subset
Scaling Automated Tests: Choosing an Appropriate SubsetScaling Automated Tests: Choosing an Appropriate Subset
Scaling Automated Tests: Choosing an Appropriate Subset
 
Janus conf19: TUTORIAL: KITE with network-instrumentation
Janus conf19: TUTORIAL: KITE with network-instrumentationJanus conf19: TUTORIAL: KITE with network-instrumentation
Janus conf19: TUTORIAL: KITE with network-instrumentation
 
DevOOPS: Attacks and Defenses for DevOps Toolchains
DevOOPS: Attacks and Defenses for DevOps ToolchainsDevOOPS: Attacks and Defenses for DevOps Toolchains
DevOOPS: Attacks and Defenses for DevOps Toolchains
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
Are your v8 garbage collection logs speaking to you?Joyee Cheung -Alibaba Clo...
 
[JOI] TOTVS Developers Joinville - Java #1
[JOI] TOTVS Developers Joinville - Java #1[JOI] TOTVS Developers Joinville - Java #1
[JOI] TOTVS Developers Joinville - Java #1
 
Jenkins entwined with deployment and pragmatism
Jenkins entwined with deployment and pragmatismJenkins entwined with deployment and pragmatism
Jenkins entwined with deployment and pragmatism
 
DEVNET-1148 Leveraging Cisco OpenStack Private Cloud for Developers
DEVNET-1148	Leveraging Cisco OpenStack Private Cloud for DevelopersDEVNET-1148	Leveraging Cisco OpenStack Private Cloud for Developers
DEVNET-1148 Leveraging Cisco OpenStack Private Cloud for Developers
 
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaSOverpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
 
Swimming upstream
Swimming upstreamSwimming upstream
Swimming upstream
 
2016 Q1 - WebRTC testing State of The Art
2016 Q1 - WebRTC testing State of The Art2016 Q1 - WebRTC testing State of The Art
2016 Q1 - WebRTC testing State of The Art
 
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
從系統思考看 DevOps:以 microservices 為例 (DevOps: a system dynamics perspective)
 
2009-12-04 New York City System z Executive Council
2009-12-04 New York City System z Executive Council2009-12-04 New York City System z Executive Council
2009-12-04 New York City System z Executive Council
 
360° Kubernetes Security: From Source Code to K8s Configuration Security
360° Kubernetes Security: From Source Code to K8s Configuration Security360° Kubernetes Security: From Source Code to K8s Configuration Security
360° Kubernetes Security: From Source Code to K8s Configuration Security
 
Converting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - CascadiaConverting Your Dev Environment to a Docker Stack - Cascadia
Converting Your Dev Environment to a Docker Stack - Cascadia
 
Hyperledger weatherreport20190219 公開版
Hyperledger weatherreport20190219 公開版Hyperledger weatherreport20190219 公開版
Hyperledger weatherreport20190219 公開版
 
Workflow, container, and beyond
Workflow, container, and beyondWorkflow, container, and beyond
Workflow, container, and beyond
 
Production ready kubernetes
Production ready kubernetesProduction ready kubernetes
Production ready kubernetes
 
DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015DevOops & How I hacked you DevopsDays DC June 2015
DevOops & How I hacked you DevopsDays DC June 2015
 
twMVC#44 如何測試與保護你的 web application with playwright
twMVC#44 如何測試與保護你的 web application with playwrighttwMVC#44 如何測試與保護你的 web application with playwright
twMVC#44 如何測試與保護你的 web application with playwright
 

Viewers also liked

談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議Yi-Feng Tzeng
 
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]Yi-Feng Tzeng
 
軟體接案自由職業者 (Freelancer) 意想不到的風險
軟體接案自由職業者 (Freelancer) 意想不到的風險軟體接案自由職業者 (Freelancer) 意想不到的風險
軟體接案自由職業者 (Freelancer) 意想不到的風險Yi-Feng Tzeng
 
資料庫索引數據結構及主鍵設計(b+tree)(part 1)
資料庫索引數據結構及主鍵設計(b+tree)(part 1)資料庫索引數據結構及主鍵設計(b+tree)(part 1)
資料庫索引數據結構及主鍵設計(b+tree)(part 1)Yi-Feng Tzeng
 
淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQL淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQLYi-Feng Tzeng
 
善用 MySQL 及 PostgreSQL - RDBMS 的逆襲 - part1
善用 MySQL 及 PostgreSQL - RDBMS 的逆襲 - part1善用 MySQL 及 PostgreSQL - RDBMS 的逆襲 - part1
善用 MySQL 及 PostgreSQL - RDBMS 的逆襲 - part1Yi-Feng Tzeng
 
Redis, another step on the road
Redis, another step on the roadRedis, another step on the road
Redis, another step on the roadYi-Feng Tzeng
 
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)Yi-Feng Tzeng
 
The Future of Classical Music
The Future of Classical MusicThe Future of Classical Music
The Future of Classical MusicYi-Feng Tzeng
 
The Case for Chaos
The Case for ChaosThe Case for Chaos
The Case for ChaosBruce Wong
 
20130112 web conf-面向網站經營者及網站用戶的個資法衝擊
20130112 web conf-面向網站經營者及網站用戶的個資法衝擊20130112 web conf-面向網站經營者及網站用戶的個資法衝擊
20130112 web conf-面向網站經營者及網站用戶的個資法衝擊Yi-Feng Tzeng
 
[BizLePro] 主題講座 #5:台灣C2C第三方支付服務之發展_20130513_gillight
[BizLePro] 主題講座 #5:台灣C2C第三方支付服務之發展_20130513_gillight[BizLePro] 主題講座 #5:台灣C2C第三方支付服務之發展_20130513_gillight
[BizLePro] 主題講座 #5:台灣C2C第三方支付服務之發展_20130513_gillightYi-Feng Tzeng
 
[BizLePro] 主題講座 #4:給資訊人的智財導論_20130429_richard
[BizLePro] 主題講座 #4:給資訊人的智財導論_20130429_richard[BizLePro] 主題講座 #4:給資訊人的智財導論_20130429_richard
[BizLePro] 主題講座 #4:給資訊人的智財導論_20130429_richardYi-Feng Tzeng
 
[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解
[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解
[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解Yi-Feng Tzeng
 
2013-04-13_JSTW-security-for-frontend-engineer (前傳)
2013-04-13_JSTW-security-for-frontend-engineer (前傳)2013-04-13_JSTW-security-for-frontend-engineer (前傳)
2013-04-13_JSTW-security-for-frontend-engineer (前傳)Yi-Feng Tzeng
 
2014-04-24 社群經營的法律議題-ant
2014-04-24 社群經營的法律議題-ant2014-04-24 社群經營的法律議題-ant
2014-04-24 社群經營的法律議題-antYi-Feng Tzeng
 
Goto Berlin - Migrating to Microservices (Fast Delivery)
Goto Berlin - Migrating to Microservices (Fast Delivery)Goto Berlin - Migrating to Microservices (Fast Delivery)
Goto Berlin - Migrating to Microservices (Fast Delivery)Adrian Cockcroft
 
[CBLP] 個資法雙連發-怪怪的個資法-ox-20130225
[CBLP] 個資法雙連發-怪怪的個資法-ox-20130225[CBLP] 個資法雙連發-怪怪的個資法-ox-20130225
[CBLP] 個資法雙連發-怪怪的個資法-ox-20130225Yi-Feng Tzeng
 
2014 03-14 PunApp-InstAll15-山寨的界限
2014 03-14 PunApp-InstAll15-山寨的界限2014 03-14 PunApp-InstAll15-山寨的界限
2014 03-14 PunApp-InstAll15-山寨的界限Yi-Feng Tzeng
 
2013-05-18_JSDC.TW-security-for-frontend-engineer-final (後傳)
2013-05-18_JSDC.TW-security-for-frontend-engineer-final (後傳)2013-05-18_JSDC.TW-security-for-frontend-engineer-final (後傳)
2013-05-18_JSDC.TW-security-for-frontend-engineer-final (後傳)Yi-Feng Tzeng
 

Viewers also liked (20)

談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
談 Uber 從 PostgreSQL 轉用 MySQL 的技術爭議
 
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
 
軟體接案自由職業者 (Freelancer) 意想不到的風險
軟體接案自由職業者 (Freelancer) 意想不到的風險軟體接案自由職業者 (Freelancer) 意想不到的風險
軟體接案自由職業者 (Freelancer) 意想不到的風險
 
資料庫索引數據結構及主鍵設計(b+tree)(part 1)
資料庫索引數據結構及主鍵設計(b+tree)(part 1)資料庫索引數據結構及主鍵設計(b+tree)(part 1)
資料庫索引數據結構及主鍵設計(b+tree)(part 1)
 
淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQL淺入淺出 MySQL & PostgreSQL
淺入淺出 MySQL & PostgreSQL
 
善用 MySQL 及 PostgreSQL - RDBMS 的逆襲 - part1
善用 MySQL 及 PostgreSQL - RDBMS 的逆襲 - part1善用 MySQL 及 PostgreSQL - RDBMS 的逆襲 - part1
善用 MySQL 及 PostgreSQL - RDBMS 的逆襲 - part1
 
Redis, another step on the road
Redis, another step on the roadRedis, another step on the road
Redis, another step on the road
 
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
2014-10-25 App 及 Maker 開發者防身術 (MOPCON 2014)
 
The Future of Classical Music
The Future of Classical MusicThe Future of Classical Music
The Future of Classical Music
 
The Case for Chaos
The Case for ChaosThe Case for Chaos
The Case for Chaos
 
20130112 web conf-面向網站經營者及網站用戶的個資法衝擊
20130112 web conf-面向網站經營者及網站用戶的個資法衝擊20130112 web conf-面向網站經營者及網站用戶的個資法衝擊
20130112 web conf-面向網站經營者及網站用戶的個資法衝擊
 
[BizLePro] 主題講座 #5:台灣C2C第三方支付服務之發展_20130513_gillight
[BizLePro] 主題講座 #5:台灣C2C第三方支付服務之發展_20130513_gillight[BizLePro] 主題講座 #5:台灣C2C第三方支付服務之發展_20130513_gillight
[BizLePro] 主題講座 #5:台灣C2C第三方支付服務之發展_20130513_gillight
 
[BizLePro] 主題講座 #4:給資訊人的智財導論_20130429_richard
[BizLePro] 主題講座 #4:給資訊人的智財導論_20130429_richard[BizLePro] 主題講座 #4:給資訊人的智財導論_20130429_richard
[BizLePro] 主題講座 #4:給資訊人的智財導論_20130429_richard
 
[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解
[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解
[BizLePro] 主題講座 #7:商業利用怎麼行? - 從開源授權十個常見 FAQ 來了解
 
2013-04-13_JSTW-security-for-frontend-engineer (前傳)
2013-04-13_JSTW-security-for-frontend-engineer (前傳)2013-04-13_JSTW-security-for-frontend-engineer (前傳)
2013-04-13_JSTW-security-for-frontend-engineer (前傳)
 
2014-04-24 社群經營的法律議題-ant
2014-04-24 社群經營的法律議題-ant2014-04-24 社群經營的法律議題-ant
2014-04-24 社群經營的法律議題-ant
 
Goto Berlin - Migrating to Microservices (Fast Delivery)
Goto Berlin - Migrating to Microservices (Fast Delivery)Goto Berlin - Migrating to Microservices (Fast Delivery)
Goto Berlin - Migrating to Microservices (Fast Delivery)
 
[CBLP] 個資法雙連發-怪怪的個資法-ox-20130225
[CBLP] 個資法雙連發-怪怪的個資法-ox-20130225[CBLP] 個資法雙連發-怪怪的個資法-ox-20130225
[CBLP] 個資法雙連發-怪怪的個資法-ox-20130225
 
2014 03-14 PunApp-InstAll15-山寨的界限
2014 03-14 PunApp-InstAll15-山寨的界限2014 03-14 PunApp-InstAll15-山寨的界限
2014 03-14 PunApp-InstAll15-山寨的界限
 
2013-05-18_JSDC.TW-security-for-frontend-engineer-final (後傳)
2013-05-18_JSDC.TW-security-for-frontend-engineer-final (後傳)2013-05-18_JSDC.TW-security-for-frontend-engineer-final (後傳)
2013-05-18_JSDC.TW-security-for-frontend-engineer-final (後傳)
 

Similar to Enterprise Architecture Case in PHP (MUZIK Online)

Storage Benchmarks - Voodoo oder Wissenschaft? – data://disrupted® 2020
Storage Benchmarks - Voodoo oder Wissenschaft? – data://disrupted® 2020Storage Benchmarks - Voodoo oder Wissenschaft? – data://disrupted® 2020
Storage Benchmarks - Voodoo oder Wissenschaft? – data://disrupted® 2020data://disrupted®
 
MySQL Enterprise Edition Portfolio
MySQL Enterprise Edition PortfolioMySQL Enterprise Edition Portfolio
MySQL Enterprise Edition PortfolioMySQL Brasil
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyMediafly
 
Managing Storage in Virtualized Environments: Fighting Bottlenecks Hotspots a...
Managing Storage in Virtualized Environments: Fighting Bottlenecks Hotspots a...Managing Storage in Virtualized Environments: Fighting Bottlenecks Hotspots a...
Managing Storage in Virtualized Environments: Fighting Bottlenecks Hotspots a...SolarWinds
 
HBaseConAsia2019 Keynote
HBaseConAsia2019 KeynoteHBaseConAsia2019 Keynote
HBaseConAsia2019 KeynoteMichael Stack
 
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)Igalia
 
HTTP cache @ PUG Rome 03-29-2011
HTTP cache @ PUG Rome 03-29-2011HTTP cache @ PUG Rome 03-29-2011
HTTP cache @ PUG Rome 03-29-2011Alessandro Nadalin
 
SQL Server & la virtualisation : « 45 minutes inside » !
SQL Server & la virtualisation :  « 45 minutes inside » !SQL Server & la virtualisation :  « 45 minutes inside » !
SQL Server & la virtualisation : « 45 minutes inside » !Microsoft Décideurs IT
 
SQL Server & la virtualisation : « 45 minutes inside » !
SQL Server & la virtualisation :  « 45 minutes inside » !SQL Server & la virtualisation :  « 45 minutes inside » !
SQL Server & la virtualisation : « 45 minutes inside » !Microsoft Technet France
 
Maven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
Maven 3: New Features - OPITZ CONSULTING - Stefan ScheidtMaven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
Maven 3: New Features - OPITZ CONSULTING - Stefan ScheidtOPITZ CONSULTING Deutschland
 
MySQL Tech Tour 2015 - 5.7 InnoDB
MySQL Tech Tour 2015 - 5.7 InnoDBMySQL Tech Tour 2015 - 5.7 InnoDB
MySQL Tech Tour 2015 - 5.7 InnoDBMark Swarbrick
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesRobert Lemke
 
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...ESUG
 
ApacheCon 2021: Apache NiFi 101- introduction and best practices
ApacheCon 2021:   Apache NiFi 101- introduction and best practicesApacheCon 2021:   Apache NiFi 101- introduction and best practices
ApacheCon 2021: Apache NiFi 101- introduction and best practicesTimothy Spann
 
DevOps and Magento
DevOps and MagentoDevOps and Magento
DevOps and MagentoAarno Aukia
 
Webinar: Untethering Compute from Storage
Webinar: Untethering Compute from StorageWebinar: Untethering Compute from Storage
Webinar: Untethering Compute from StorageAvere Systems
 
IBM SAN Volume Controller Performance Analysis
IBM SAN Volume Controller Performance AnalysisIBM SAN Volume Controller Performance Analysis
IBM SAN Volume Controller Performance Analysisbrettallison
 

Similar to Enterprise Architecture Case in PHP (MUZIK Online) (20)

Storage Benchmarks - Voodoo oder Wissenschaft? – data://disrupted® 2020
Storage Benchmarks - Voodoo oder Wissenschaft? – data://disrupted® 2020Storage Benchmarks - Voodoo oder Wissenschaft? – data://disrupted® 2020
Storage Benchmarks - Voodoo oder Wissenschaft? – data://disrupted® 2020
 
MySQL Enterprise Edition Portfolio
MySQL Enterprise Edition PortfolioMySQL Enterprise Edition Portfolio
MySQL Enterprise Edition Portfolio
 
Chicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - MediaflyChicago Docker Meetup Presentation - Mediafly
Chicago Docker Meetup Presentation - Mediafly
 
Huawei Solutions for SAP HANA Overview
Huawei Solutions for SAP HANA OverviewHuawei Solutions for SAP HANA Overview
Huawei Solutions for SAP HANA Overview
 
Managing Storage in Virtualized Environments: Fighting Bottlenecks Hotspots a...
Managing Storage in Virtualized Environments: Fighting Bottlenecks Hotspots a...Managing Storage in Virtualized Environments: Fighting Bottlenecks Hotspots a...
Managing Storage in Virtualized Environments: Fighting Bottlenecks Hotspots a...
 
HBaseConAsia2019 Keynote
HBaseConAsia2019 KeynoteHBaseConAsia2019 Keynote
HBaseConAsia2019 Keynote
 
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
Igalia Focus and Goals 2020 (2019 WebKit Contributors Meeting)
 
SQL Server On SANs
SQL Server On SANsSQL Server On SANs
SQL Server On SANs
 
HTTP cache @ PUG Rome 03-29-2011
HTTP cache @ PUG Rome 03-29-2011HTTP cache @ PUG Rome 03-29-2011
HTTP cache @ PUG Rome 03-29-2011
 
SQL Server & la virtualisation : « 45 minutes inside » !
SQL Server & la virtualisation :  « 45 minutes inside » !SQL Server & la virtualisation :  « 45 minutes inside » !
SQL Server & la virtualisation : « 45 minutes inside » !
 
SQL Server & la virtualisation : « 45 minutes inside » !
SQL Server & la virtualisation :  « 45 minutes inside » !SQL Server & la virtualisation :  « 45 minutes inside » !
SQL Server & la virtualisation : « 45 minutes inside » !
 
Maven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
Maven 3: New Features - OPITZ CONSULTING - Stefan ScheidtMaven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
Maven 3: New Features - OPITZ CONSULTING - Stefan Scheidt
 
MySQL Tech Tour 2015 - 5.7 InnoDB
MySQL Tech Tour 2015 - 5.7 InnoDBMySQL Tech Tour 2015 - 5.7 InnoDB
MySQL Tech Tour 2015 - 5.7 InnoDB
 
Scaleable PHP Applications in Kubernetes
Scaleable PHP Applications in KubernetesScaleable PHP Applications in Kubernetes
Scaleable PHP Applications in Kubernetes
 
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...
How to Build a High-Performance VM for Squeak/Smalltalk in Your Spare Time: A...
 
ApacheCon 2021: Apache NiFi 101- introduction and best practices
ApacheCon 2021:   Apache NiFi 101- introduction and best practicesApacheCon 2021:   Apache NiFi 101- introduction and best practices
ApacheCon 2021: Apache NiFi 101- introduction and best practices
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
DevOps and Magento
DevOps and MagentoDevOps and Magento
DevOps and Magento
 
Webinar: Untethering Compute from Storage
Webinar: Untethering Compute from StorageWebinar: Untethering Compute from Storage
Webinar: Untethering Compute from Storage
 
IBM SAN Volume Controller Performance Analysis
IBM SAN Volume Controller Performance AnalysisIBM SAN Volume Controller Performance Analysis
IBM SAN Volume Controller Performance Analysis
 

More from Yi-Feng Tzeng

重新想像:如何做技術選型決策 / Rethinking : Technical Decision
重新想像:如何做技術選型決策 / Rethinking : Technical Decision重新想像:如何做技術選型決策 / Rethinking : Technical Decision
重新想像:如何做技術選型決策 / Rethinking : Technical DecisionYi-Feng Tzeng
 
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊-加強版
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊-加強版擁抱開源:企業應如何善用開源技術,才能得其利而防其弊-加強版
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊-加強版Yi-Feng Tzeng
 
Testing in Production, Deploy on Fridays
Testing in Production, Deploy on FridaysTesting in Production, Deploy on Fridays
Testing in Production, Deploy on FridaysYi-Feng Tzeng
 
COSCUP 2020 Day 2 - Opening Keynote
COSCUP 2020 Day 2 - Opening KeynoteCOSCUP 2020 Day 2 - Opening Keynote
COSCUP 2020 Day 2 - Opening KeynoteYi-Feng Tzeng
 
COSCUP 2020 Day 1 - Opening Keynote
COSCUP 2020 Day 1 - Opening KeynoteCOSCUP 2020 Day 1 - Opening Keynote
COSCUP 2020 Day 1 - Opening KeynoteYi-Feng Tzeng
 
Severless PHP Case : Agile Dashboard via GitLab Board API
Severless PHP Case : Agile Dashboard via GitLab Board APISeverless PHP Case : Agile Dashboard via GitLab Board API
Severless PHP Case : Agile Dashboard via GitLab Board APIYi-Feng Tzeng
 
給資安工程師開源授權觀念
給資安工程師開源授權觀念給資安工程師開源授權觀念
給資安工程師開源授權觀念Yi-Feng Tzeng
 
Progressive Deployment & NoDeploy
Progressive Deployment & NoDeployProgressive Deployment & NoDeploy
Progressive Deployment & NoDeployYi-Feng Tzeng
 
Dev(Sec)Ops - Architecture for Security and Compliance
Dev(Sec)Ops - Architecture for Security and ComplianceDev(Sec)Ops - Architecture for Security and Compliance
Dev(Sec)Ops - Architecture for Security and ComplianceYi-Feng Tzeng
 
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊擁抱開源:企業應如何善用開源技術,才能得其利而防其弊
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊Yi-Feng Tzeng
 
淺談量子機器學習 - 當機器學習遇見量子計算
淺談量子機器學習 - 當機器學習遇見量子計算淺談量子機器學習 - 當機器學習遇見量子計算
淺談量子機器學習 - 當機器學習遇見量子計算Yi-Feng Tzeng
 
A Modern Web Architecture for (GDPR) Compliance
A Modern Web Architecture for (GDPR) ComplianceA Modern Web Architecture for (GDPR) Compliance
A Modern Web Architecture for (GDPR) ComplianceYi-Feng Tzeng
 
量子技術 (2018 03-31)
量子技術 (2018 03-31)量子技術 (2018 03-31)
量子技術 (2018 03-31)Yi-Feng Tzeng
 
邏輯優化的灰色面:針對網頁應用的時序攻擊 (2018臺灣資安大會: 軟體安全論壇)
邏輯優化的灰色面:針對網頁應用的時序攻擊 (2018臺灣資安大會: 軟體安全論壇)邏輯優化的灰色面:針對網頁應用的時序攻擊 (2018臺灣資安大會: 軟體安全論壇)
邏輯優化的灰色面:針對網頁應用的時序攻擊 (2018臺灣資安大會: 軟體安全論壇)Yi-Feng Tzeng
 
Modern Web Architecture Design Journey
Modern Web Architecture Design JourneyModern Web Architecture Design Journey
Modern Web Architecture Design JourneyYi-Feng Tzeng
 

More from Yi-Feng Tzeng (16)

重新想像:如何做技術選型決策 / Rethinking : Technical Decision
重新想像:如何做技術選型決策 / Rethinking : Technical Decision重新想像:如何做技術選型決策 / Rethinking : Technical Decision
重新想像:如何做技術選型決策 / Rethinking : Technical Decision
 
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊-加強版
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊-加強版擁抱開源:企業應如何善用開源技術,才能得其利而防其弊-加強版
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊-加強版
 
Testing in Production, Deploy on Fridays
Testing in Production, Deploy on FridaysTesting in Production, Deploy on Fridays
Testing in Production, Deploy on Fridays
 
COSCUP 2020 Day 2 - Opening Keynote
COSCUP 2020 Day 2 - Opening KeynoteCOSCUP 2020 Day 2 - Opening Keynote
COSCUP 2020 Day 2 - Opening Keynote
 
COSCUP 2020 Day 1 - Opening Keynote
COSCUP 2020 Day 1 - Opening KeynoteCOSCUP 2020 Day 1 - Opening Keynote
COSCUP 2020 Day 1 - Opening Keynote
 
Severless PHP Case : Agile Dashboard via GitLab Board API
Severless PHP Case : Agile Dashboard via GitLab Board APISeverless PHP Case : Agile Dashboard via GitLab Board API
Severless PHP Case : Agile Dashboard via GitLab Board API
 
給資安工程師開源授權觀念
給資安工程師開源授權觀念給資安工程師開源授權觀念
給資安工程師開源授權觀念
 
Progressive Deployment & NoDeploy
Progressive Deployment & NoDeployProgressive Deployment & NoDeploy
Progressive Deployment & NoDeploy
 
Dev(Sec)Ops - Architecture for Security and Compliance
Dev(Sec)Ops - Architecture for Security and ComplianceDev(Sec)Ops - Architecture for Security and Compliance
Dev(Sec)Ops - Architecture for Security and Compliance
 
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊擁抱開源:企業應如何善用開源技術,才能得其利而防其弊
擁抱開源:企業應如何善用開源技術,才能得其利而防其弊
 
淺談量子機器學習 - 當機器學習遇見量子計算
淺談量子機器學習 - 當機器學習遇見量子計算淺談量子機器學習 - 當機器學習遇見量子計算
淺談量子機器學習 - 當機器學習遇見量子計算
 
A Modern Web Architecture for (GDPR) Compliance
A Modern Web Architecture for (GDPR) ComplianceA Modern Web Architecture for (GDPR) Compliance
A Modern Web Architecture for (GDPR) Compliance
 
量子技術 (2018 03-31)
量子技術 (2018 03-31)量子技術 (2018 03-31)
量子技術 (2018 03-31)
 
Swoole Love PHP
Swoole Love PHPSwoole Love PHP
Swoole Love PHP
 
邏輯優化的灰色面:針對網頁應用的時序攻擊 (2018臺灣資安大會: 軟體安全論壇)
邏輯優化的灰色面:針對網頁應用的時序攻擊 (2018臺灣資安大會: 軟體安全論壇)邏輯優化的灰色面:針對網頁應用的時序攻擊 (2018臺灣資安大會: 軟體安全論壇)
邏輯優化的灰色面:針對網頁應用的時序攻擊 (2018臺灣資安大會: 軟體安全論壇)
 
Modern Web Architecture Design Journey
Modern Web Architecture Design JourneyModern Web Architecture Design Journey
Modern Web Architecture Design Journey
 

Recently uploaded

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Enterprise Architecture Case in PHP (MUZIK Online)

  • 1. Enterprise Architecture Case in PHP 2015-10-09 Ant yftzeng@gmail.com
  • 2. 2015 2/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 3. 2015 3/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 11. 11/116 2015 Monolith → Microservices Load balancing Monolith Cache Database Network
  • 12. 12/116 2015 Monolith → Microservices Load balancing Monolith Cache Database Network In-process communication A C B D
  • 13. 13/116 2015 Monolith → Microservices Load balancing Cache Database Network In-process communication A C B D
  • 15. 15/116 2015 Monolith → Microservices Death Star Diagram (Gilt) Ref: http://www.slideshare.net/goldbergjonathan/gilt-frommonolithrubyapptomicroservicescalaservicearchitecture140115150436phpapp01 (s45)
  • 16. 16/116 2015 Monolith → Microservices Death Star Diagram (Twitter) Ref: https://twitter.com/adrianco/status/441883572618948608
  • 17. 17/116 2015 Monolith → Microservices Death Star Diagram (Netflix) Ref: http://www.slideshare.net/BruceWong3/the-case-for-chaos (s12)
  • 23. 2015 23/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 24. 24/116 2015 Enterprise Architecture Case in PHP https://www.muzik-online.com/ https://muzikair.com/
  • 27. 27/116 2015 對技術研究高度投入,專注節省工程師開發時間 投入時間分析研究 MySQL / PostgreSQL / PHP / Cassandra / Redis ... 等源碼 https://www.muzik-online.com/ https://muzikair.com/
  • 28. 28/116 2015 Multi Cloud Private Azure LinodeAWS SoftLayerIDC Configuration Management DevOps
  • 29. 29/116 2015 追求 Cloud as a Cloud Leverage w/o vendor lock-in Build cloud on top of cloud https://www.muzik-online.com/ https://muzikair.com/
  • 30. 30/116 2015 Multi Cloud Private Azure LinodeAWS SoftLayerIDC Configuration Management DevOps Cloud as a Cloud
  • 31. 2015 31/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 33. 33/116 2015 History > MUZIK Zero Monolith Database Filebed
  • 34. 2015 34/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 37. 37/116 2015 History > MUZIK 1.0 (Bach) Monolith Monolith Database Filebed
  • 38. 38/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith Database Filebed
  • 39. 39/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith R1 R2 Database Filebed
  • 40. 40/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith PHPSESSID R1 R2 R1 SESSION Database Filebed
  • 41. 41/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith PHPSESSID PHPSESSID R1 R2 R1 R2 SESSION Database Filebed
  • 42. 42/116 2015 History > MUZIK 1.0 (Bach) "Sticky" balancing / cookies
  • 43. 43/116 2015 History > MUZIK 1.0 (Bach) Load balancing (sticky) Monolith Monolith PHPSESSID PHPSESSID R1 R2 R2R1 SESSION Database Filebed
  • 44. 44/116 2015 History > MUZIK 1.0 (Bach) History > MUZIK 1.0 (Bach) ✔ Cons ✔ Load balancing do more works (lower performance) ✔ Unbalanced loads ✔ Supporting ✔ Some old hardware / software do not support 'sticky' ✔ Amazon ELB support sticky sessions on April 2010 ✔ Hard to control and scale-out (Non-SDN, No APIs) ✔ 缺點 ✔ 負載平衡器多了一些工作 ( 效能耗損 ) ✔ 負載不平衡 ( 重度用戶會偏重使用某些機器 ) ✔ 支援性 ✔ 有些舊的硬體 / 軟體不支援 'sticky' ✔ 2010 年 4 月 Amazon ELB 才支援 sticky sessions ✔ 難以控制或橫向擴展 ( 硬體不支援 SDN ,沒有 API)
  • 45. 45/116 2015 History > MUZIK 1.0 (Bach) Application server session replication (Tomcat / JBoss / WAS)
  • 46. 46/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith PHPSESSID PHPSESSID R1 R2 R2R1 SESSION SESSION Replication Database Filebed
  • 47. 47/116 2015 History > MUZIK 1.0 (Bach) History > MUZIK 1.0 (Bach) ✔ Cons ✔ More application servers, more performance lost ✔ Broadcast storm ✔ Session serialization / unserialization (lower performance) ✔ Supporting ✔ Some application server do not supporting ✔ 缺點 ✔ 應用伺服器愈多,同步效能愈差 ✔ 廣播風暴 ✔ Session 需要序列化 / 反序列化,影響效能 ✔ 支援性 ✔ 不是所有應用伺服器都支援 Session 複製
  • 48. 48/116 2015 History > MUZIK 1.0 (Bach) Save sessions in database (shared-nothing architecture)
  • 49. 49/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith R1 R2 Database Filebed SESSION R1 R2
  • 50. 50/116 2015 History > MUZIK 1.0 (Bach) History > MUZIK 1.0 (Bach) ✔ Cons ✔ Need to modify application code (easy) ✔ Database do more works (lower performance) ✔ Database is more harder scale-out than application server ✔ 缺點 ✔ 需要修改應用程式 ( 容易 ) ✔ 資料庫多了一些工作 ( 效能耗損 ) ✔ 資料庫相較應用伺服器更難以橫向擴展
  • 51. 51/116 2015 History > MUZIK 1.0 (Bach) Save sessions in shared disks (shared-nothing architecture)
  • 52. 52/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith R1 R2 R1 R2 Database Filebed SESSION
  • 53. 53/116 2015 History > MUZIK 1.0 (Bach) History > MUZIK 1.0 (Bach) ✔ Cons ✔ Need to modify application code (easy) ✔ Shared disk do more works (lower performance) ✔ Shared disk is hard to scale-out ✔ Session serialization / unserialization (lower performance) ✔ 缺點 ✔ 需要修改應用程式 ( 容易 ) ✔ 共享儲存庫多了一些工作 ( 效能耗損 ) ✔ 共享儲存庫較難橫向擴展 ✔ Session 需要序列化 / 反序列化,影響效能
  • 54. 54/116 2015 History > MUZIK 1.0 (Bach) Save sessions in shared cache (Memcached / Redis / Aerospike) (shared-nothing architecture)
  • 55. 55/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith R1 R2 Database Filebed Cache R1 R2 SESSION
  • 56. 56/116 2015 History > MUZIK 1.0 (Bach) History > MUZIK 1.0 (Bach) ✔ Cons ✔ Need to modify application code (easy) ✔ Memcached need serialization / unserialization (lower performance) ✔ Redis does not ✔ Memcached do not support persistent store (thundering herd) ✔ Redis / Aerospike does ✔ Cache server do more works (lower performance) ✔ Cache server is hard to scale-out ✔ Aerospike is more easy ✔ 缺點 ✔ 需要修改應用程式 ( 容易 ) ✔ Memcahced 需要序列化 / 反序列化 ( 稍影響效能 ) ✔ Redis 不需要 ✔ Memcached 不支援永久儲存 ( 雪崩效應 ) ✔ Redis / Aerospike 支援 ✔ 快取伺服器多了一些工作 ( 效能耗損 ) ✔ 快取伺服器較難以擴展 ✔ Aerospike 相對簡單
  • 57. 57/116 2015 History > MUZIK 1.0 (Bach) History > MUZIK 1.0 (Bach) ✔ Cons ✔ Cache servers need to be monitoring (become more complex) ✔ Cache servers need large memory (more expensive) ✔ Cache servers itself may bring thundering herd problem (even Redis) ✔ Cache server reduce number of database ✔ If without cache server, database will need more power to handle ✔ So if cache server crash, all traffic will transfer to database, and resulting database crash too. ✔ Finally, database is depend on cache server. ✔ 缺點 ✔ 快取伺服器需要集群與監控 ( 架構變複雜 ) ✔ 快取伺服器需要大量記憶體 ( 費用較昂貴 ) ✔ 快取伺服器本身很可能是雪崩效應的元兇 ( 即使是 Redis) ✔ 快取存在的意義,通常為了節省資料庫效能 / 減少資料庫連線數量。 ✔ 若沒有快取,資料庫很可能需要多 10 倍或更多的數量。 ✔ 一旦快取伺服器崩溾,流量若全轉向至資料庫,也會造成資料庫崩溾。 ✔ 資料庫集群的崩溾,除了自身外,也多依賴了快取伺服器。 Web App Cache Database
  • 58. 58/116 2015 History > MUZIK 1.0 (Bach) Save sessions in client-side (shared-nothing architecture)
  • 59. 59/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith R1 R2 R1 R2 Database Filebed SESSION SESSION SESSION
  • 60. 60/116 2015 History > MUZIK 1.0 (Bach) History > MUZIK 1.0 (Bach) ✔ Pros ✔ Do not depend on Load balancing ✔ Do not depend on Application server ✔ Do not depend on Database ✔ Do not depend on Shared disk ✔ Do not depend on Cache server ✔ Shared-nothing architecture ✔ 優點 ✔ 不依賴負載平衡器 ✔ 不依賴應用伺服器 ✔ 不依賴資料庫 ✔ 不依賴共享儲存庫 ✔ 不依賴快取伺服器 ✔ Shared-nothing architecture
  • 61. 61/116 2015 History > MUZIK 1.0 (Bach) History > MUZIK 1.0 (Bach) ✔ Cons ✔ Session size limited ✔ Session need encode / decode (lower performance) ✔ Less secure (depends on how to implement) ✔ More package size (few bytes more) ✔ 缺點 ✔ Session 大小有限制 ✔ Session 需要編碼 / 反編碼 ( 效能耗損 ) ✔ 安全性稍低 ( 視如何實作 ) ✔ 耗費更多網路頻寬 ( 多了幾 bytes)
  • 62. 62/116 2015 History > MUZIK 1.0 (Bach) Load balancing Monolith Monolith R1 R2 R1 R2 Database Filebed SESSION SESSION SESSION Session Manager Session Manager
  • 63. 63/116 2015 Migrations 遷移 ✔ Vanilla PHP → Phalcon/MVC ✔ MVC is HOT, and we need it by this time ✔ Standard design pattern ✔ Full stack for Web ✔ High performance (C extension) ✔ Well document material ✔ Commit regularly ✔ Apache prefork → Nginx / PHP-FPM ✔ Vanilla PHP → Phalcon/MVC ✔ MVC 很熱門,而且當下時間點很適合我們 ✔ 標準的設計模式 ✔ 網頁全端開發 ✔ 高效能 ( 基於 C 擴展 ) ✔ 完整的文件 ✔ 官方更新頻繁 ✔ Apache prefork → Nginx / PHP-FPM
  • 64. 64/116 2015 Migrations 遷移 ✔ Database schema re-design ✔ The metadata for classical music is much more complex than others ✔ Composer / Period ✔ Album / Genre / Work / Movement / Track ✔ Performer / Instrument ✔ etc. ✔ 資料庫結構重新設計 ✔ 古典樂的後設資料非常複雜,比流行音樂複雜 N 倍 ✔ 作曲家 / 時期 ✔ 專輯 / 曲種 / 作品 / 樂章 / 音檔 ✔ 演奏家 / 樂器 ✔ 其它
  • 65. 65/116 2015 Why we still use MySQL 為什麼繼續使用 MySQL ✔ Easy / Mature than NoSQL / NewSQL ✔ Our team are familiar with MySQL ✔ Connection pool ✔ Almost everyone told me connection pool is good ✔ But can you tell me what is the drawbacks ? ✔ Hello guys, PHP support connection pool ✔ 目前業務場景下, RDBMS 相較於 NoSQL / NewSQL 更容易且成熟 ✔ 團隊全員熟悉 MySQL ✔ Connection pool ✔ 幾乎每個人都會告訴我 connection pool 很好 ✔ 但可以告訴我坑在哪嗎? ✔ 嗨!開發者們 , PHP 其實支援 connection pool
  • 66. 66/116 2015 Why we still use MySQL 為什麼繼續使用 MySQL ✔ Connection pool ✔ Not all application support connection pool ✔ Connection pool can not know much about servers status / loading ✔ Connection pool need to do resource cleanup when failed ✔ If your application is complexity, you need to do yourself ✔ Connection pool keep connection ✔ Occupied server connection / thread cache ✔ Connection pool ✔ 不是所有應用程式都支援 connection pool ✔ Connection pool 無法得知伺服器的狀態及承載 ✔ Connection pool 遭遇錯誤時,必須執行完整的資源清理 ✔ 如果你的應用很複雜,有自己的資源配置,那麼你必須自己清理回收 ✔ Connection pool 會保持連線 ✔ 佔用伺服器連線數及線程快取
  • 67. 67/116 2015 Why we still use MySQL 為什麼繼續使用 MySQL ✔ Connection pool ✔ An architecture problems ✔ If your database can keep 500 connections the most ✔ Each of application server's connection pool is 100 ✔ In some cases, if you add the 6th application server, it almost cannot create any connection ✔ The 'connection pool' variable is a cross-architecture problem ✔ As mentioned above, connection pool usually cannot be adjusted depends on database status ✔ If your have DBA and Backend team, the problem arise ✔ Connection pool ✔ 一個架構問題 ✔ 如果你的資料庫最多能保持 500 連線數 ✔ 每個應用伺服器的 connection pool 為 100 ✔ 某些情況下,當你增加第六台應用伺服器時,該伺服器幾乎無法建立任何連線 ✔ 'connection pool' 變數成為跨架構的全域變數 ✔ 如前所述,通常 connection pool 無法得知伺服器狀態,所以無法自調適 ✔ 如果成員又區分為 DBA 及後端兩組人馬時,這個問題會更嚴重
  • 68. 68/116 2015 Why we still use MySQL 為什麼繼續使用 MySQL ✔ MySQL ✔ MySQL is threaded-base model ✔ Support mass concurrency without connection pool ✔ Fit short database connection ✔ MySQL 5.7 connection overhead reduction ✔ 5.6: 62.5% ✔ 5.5: 40% ✔ MySQL ✔ MySQL 是線程模式 ✔ 不需 Connection pool 就可以支持高併發 ✔ 支持短連接使用資料庫 ✔ MySQL 5.7 建立連線的開銷更少 ✔ 是 5.6 版的 62.5% ✔ 是 5.5 版的 40%
  • 69. 2015 69/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 72. 72/116 2015 History > MUZIK 2.0 (Haydn) Load balancing Monolith Monolith Database Filebed Search
  • 73. 73/116 2015 New features 遷移 ✔ ElasticSearch ✔ Solr is mature, but ElasticSearch is easy ✔ ElasticSearch is nature clustering / sharding ✔ Eventually Consistent ✔ For future purposes ✔ Monitoring ✔ ElasticSearch ✔ Solr 更成熟,但 ElasticSearch 比較容易上手 ✔ ElasticSearch 天生支援 clustering / sharding ✔ Eventually Consistent ( 最終一致性 ) ✔ 為了往後的架構設計 ✔ Monitoring ( 監控 )
  • 74. 2015 74/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 77. 77/116 2015 History > MUZIK 3.0 (Mozart) Load balancing Component Product SMAAA ……. ... Air One …... Study Database Filebed Search
  • 78. 78/116 2015 History > MUZIK 3.0 (Mozart) Load balancing API Gateway API Gateway Air …...One Study Database Filebed Search SMAAA ...…….
  • 79. 79/116 2015 History > MUZIK 3.0 (Mozart) Load balancing API Gateway API Gateway Monitor Air …... Database Filebed Search One StudySMAAA ...…….
  • 80. 80/116 2015 Migrations 遷移 ✔ Phalcon → Phalcon Micro ✔ Microservices ✔ API Gateway (Q4 2014) ✔ With MUZIK micro framework ✔ Fast ✔ Components ✔ Secure ✔ Shared-nothing architecture ✔ Phalcon → Phalcon Micro ✔ Microservices ✔ API Gateway (Q4 2014) ✔ 融合 MUZIK 自主開發的微框架 ✔ 快 ✔ 元件化 ✔ 安全 ✔ Shared-nothing architecture
  • 83. 83/116 2015 Migrations 遷移 ✔ Phalcon → Phalcon Micro ✔ Microservices ✔ API Gateway (Q4 2014) ✔ Cons ✔ Not 100% microservices ✔ Carefully use it if will migrate to microservices in the future ✔ Merge or separate microservices those face client directly ✔ Phalcon → Phalcon Micro ✔ Microservices ✔ API Gateway (Q4 2014) ✔ 缺點 ✔ 並不是 100% microservices ✔ 需特別注意未來架構演化的限制 ✔ 如未來需要合併或拆分那些直接面對客戶端的 microservices
  • 84. 84/116 2015 Migrations 遷移 ✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster ✔ Master-Master ✔ Requirements ✔ Geo-replication ✔ Automatic node joining ✔ Scalability ✔ Easy ✔ Maintenance ✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster ✔ Master-Master ✔ 需求 ✔ Geo-replication ( 地域複製 ) ✔ 自動增減節點 ✔ 擴展性 ✔ 易用性 ✔ 維護性
  • 85. 85/116 2015 Migrations 遷移 ✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster ✔ Master-Master ✔ Pros ✔ Read scalability ✔ Write scalability (?) ✔ etc. ✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster ✔ Master-Master ✔ 優點 ✔ Read scalability ( 讀擴展性 ) ✔ Write scalability ( 寫擴展性? ) ✔ 其它
  • 86. 86/116 2015 Migrations 遷移 ✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster ✔ Master-Master ✔ Cons ✔ Split brain ✔ Commit latency ✔ Hot-spot ✔ Deadlock on commit ✔ More nodes increase the transaction rollback rate ✔ MySQL 5.6 → MySQL 5.6 Master-Master Cluster ✔ Master-Master ✔ 缺點 ✔ Split brain ( 腦裂 ) ✔ Commit latency ( 提交延遲 ) ✔ Hot-spot ( 熱點 ) ✔ Deadlock on commit ( 提交死鎖 ) ✔ 當節點愈多,交易回滾機率愈高
  • 87. 87/116 2015 History > MUZIK 3.0 (Mozart) Database #1 Database #2 Database #3 ... Applications RW RW RW RW Master-Master
  • 88. 88/116 2015 History > MUZIK 3.0 (Mozart) Database #1 Database #2 Database #3 ... Applications RW RW RW RW UPDATE t SET … WHERE id = 1 T1 Master-Master UPDATE t SET … WHERE id = 1 T2
  • 89. 89/116 2015 History > MUZIK 3.0 (Mozart) Database #1 Database #2 Database #3 ... Applications RW RW RW RW UPDATE t SET … WHERE id = 1 T1 Master-Master UPDATE t SET … WHERE id = 1 T2 100 → 200 100 → 200
  • 90. 90/116 2015 History > MUZIK 3.0 (Mozart) Database #1 Database #2 Database #3 ... Applications RW RW RW RW UPDATE t SET … WHERE id = 1 T1 Master-Master UPDATE t SET … WHERE id = 1 T2 100 → 200 100 → 200 Deadlock / Rollback
  • 91. 91/116 2015 History > MUZIK 3.0 (Mozart) Database #1 Database #2 Database #3 ... Applications Master-Master Load balancing W R RR
  • 92. 92/116 2015 History > MUZIK 3.0 (Mozart) Database #1 Database #2 Database #3 ... Applications UPDATE t SET … WHERE id = 1 T1 Master-Master SELECT ... T2 W R RR T3 SELECT ... T4 SELECT ... T5 Load balancing
  • 93. 93/116 2015 History > MUZIK 3.0 (Mozart) Database #1 Database #2 Database #3 ... Applications UPDATE t SET … WHERE id = 1 T1 Master-Master SELECT ... T2 W R RR T3 SELECT ... T4 SELECT ... T5 Load balancingLoad balancing HA Monitor
  • 94. 94/116 2015 History > MUZIK 3.0 (Mozart) Percona XtraDB Cluster: Multi-node writing and Unexpected deadlocks 2012-08-17 https://www.percona.com/blog/2012/08/17/percona-xtradb-cluster-multi-node-writing-and-unexpected-deadlocks/ Avoiding Deadlocks in Galera - Set up HAProxy for single-node writes and multi-node reads 2013-09-17 http://www.severalnines.com/blog/avoiding-deadlocks-galera-set-haproxy-single-node-writes-and-multi-node-reads Optimizing Percona XtraDB Cluster for write hotspots 2015-06-03 https://www.percona.com/blog/2015/06/03/optimizing-percona-xtradb-cluster-write-hotspots/
  • 95. 95/116 2015 History > MUZIK 3.0 (Mozart) Database #1 Database #2 Database #3 ... Applications UPDATE t SET … WHERE id = 1 T1 Master-Master SELECT ... T2 W R RR T3 SELECT ... T4 SELECT ... T5 Load balancingLoad balancing HA Monitor Hot-Spot 1 Complexity 2
  • 96. 96/116 2015 History > MUZIK 3.0 (Mozart) Database #1 Database #2 Database #3 ... Applications RW RW RW RW Master-Master Smart Client
  • 97. 2015 97/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 100. 100/116 2015 History > MUZIK 4.0 (Beethoven, +ing) Geo DNS Bare Metal Azure AWS
  • 101. 101/116 2015 Why not use Docker ? 為何不使用 Docker ? ✔ Docker is not yet widely in production ✔ http://sirupsen.com/production-docker/ ✔ http://www.theplatform.net/2015/09/29/why-containers-at-scale-is-hard/ ✔ Docker is not stable in our test environment ✔ We use Docker lots in our develop environment ✔ Performance loss on single machine in our testing ✔ Single Docker lost 8% ✔ Two Dockers lost 31% ✔ Four Dockers lost 51% ✔ Docker 為什麼還未在生產環境上普及 ✔ http://sirupsen.com/production-docker/ ✔ http://www.theplatform.net/2015/09/29/why-containers-at-scale-is-hard/ ✔ Docker 在我們的測試環境中並不穩定,偶會無預警當機 ✔ 我們仍然在我們的開發環境中大量使用 ✔ 效能損失 ( 單機 / 我們的場景測試環境 ) ✔ 單台 Docker 在單機時,損失 8 % ✔ 雙台 Docker 在單機時,共損失 31% ✔ 四台 Docker 在單機時,共損失 51%
  • 102. 2015 102/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 103. 103/116 2015 History > MUZIK Next (maybe...) Load balancing Database API Gateway Content MonitorFilebed Search Cache AAA Stream Air One …... Study CDN API Gateway SM
  • 104. 104/116 2015 History > MUZIK Next (maybe...) History > MUZIK Next (maybe...) ✔ CDN ✔ We are building our own CDN ✔ Hybrid MUZIK CDN with third-party services ✔ CDN ✔ 我們一直研究並嘗試自主研發 CDN ✔ 混用自主研發 CDN 及第三方的服務
  • 105. 105/116 2015 History > MUZIK Next (maybe...) Load balancing Database API Gateway Content MonitorFilebed Search Cache Bigdata AAA Stream Air One …... Study CDN API Gateway SM
  • 106. 106/116 2015 History > MUZIK Next (maybe...) History > MUZIK Next (maybe...) ✔ BigData ✔ We are building our own BigData ✔ Hybrid MUZIK BigData with third-party services ✔ BigData ✔ 我們一直研究並嘗試自主研發 BigData ✔ 混用自主研發 BigData 及第三方的服務
  • 107. 107/116 2015 History > MUZIK Next (maybe...) History > MUZIK Next (maybe...) ✔ BigData ✔ Questions ✔ Spark is faster than Hadoop ? What is the trade-off ? ✔ What is the limit of Spark ? ✔ The difference between Spark streaming and Storm streaming ? ✔ What is the limit of Amazon Redshift ? ✔ BigData ✔ 問題 ✔ Spark 確定比 Hadoop 快嗎 ? 請問若有的話,是拿什麼條件交換 ? ✔ Spark 的限制是什麼 ? ✔ Spark streaming 與 Storm streaming 本質上的差異 ? ✔ Amazon Redshift 的限制是什麼 ?
  • 108. 2015 108/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 109. 109/116 2015 PHP 7 ? PHP 7 ? ✔ PHP 7 ? HHVM ? ✔ Hybrid PHP 7 / HHVM, but most PHP 7 ✔ Migrating from PHP 5.6.x to PHP 7.0.x ✔ http://php.net/manual/en/migration70.php ✔ PHP 7 Compatibility Checker ✔ https://github.com/sstalle/php7cc ✔ Architecture painless (but code?) ✔ PHP 7 ? HHVM ? ✔ 混用 PHP 7 與 HHVM ,但大多都是 PHP 7 ✔ Migrating from PHP 5.6.x to PHP 7.0.x ✔ http://php.net/manual/en/migration70.php ✔ PHP 7 Compatibility Checker ✔ https://github.com/sstalle/php7cc ✔ 架構無痛 ( 但程式碼? )
  • 111. 2015 111/116 Agenda ✔ Prologue ✔ History of MUZIK architecture ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 architecture design rules 議程 ✔ 楔子 ✔ MUZIK 架構演化史 ✔ MUZIK Zero ✔ MUZIK 1.0 (Bach) ✔ MUZIK 2.0 (Haydn) ✔ MUZIK 3.0 (Mozart) ✔ MUZIK 4.0 (Beethoven) ✔ MUZIK Next ✔ PHP 7 ? ✔ 15 條架構設計心法
  • 112. 112/116 2015 15 architecture design rules 01. 冪等操作設計 Idempotent 02. 分層低耦設計 Decoupling 03. 服務節流設計 Throttling 04. 熱點緩衝設計 Leveraging 05. 服務同質檢測 Immutablility 06. 服務降級設計 Degrade 07. 拓撲調優設計 Topology 08. 日誌追蹤設計 Tracing 09. 監控警報設計 Monitoring 10. 自動修復設計 Self-healthy 11. 異常預測設計 Anomaly detection 12. 持續灰度發布 Continuous deployment 13. 自動擴展設計 Auto-scaling 14. 異地多活設計 Multi regional resiliency 15. 混沌破壞設計 Chaos tolerance
  • 114. 2015 114/116 End 結語 ➀ 架構先決。 ➁ 沒有完美的架構,只有最適的架構。 ➂ 架構是演進的,預想但不過早調優。
  • 116. 116/116 2015 We PHP❤ Shared-nothing architecture Monolith → Microservice Phalcon → Phalcon Micro Caching !? Connection pool !? Extension (Zephir) / HHVM / PHP 7 !?