High Performance
Architecture Patterns
Celso Crivelaro
@celsocrivelaro
Slide 2
Slide 2 text
$ whoami > Celso Crivelaro
- Engineer and MSc in Computer Engineering
- Dev Ruby / Python / Java
@celsocrivelaro
http://crivelaro.me
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
No content
Slide 5
Slide 5 text
SMTP Locaweb
- Transaction email platform
- Fast and high quality email sending
- Live reports
- Integration by SMTP Protocol and HTTP API
- 2,5 Millions of messages per day
- + 2 years
Slide 6
Slide 6 text
No content
Slide 7
Slide 7 text
Platforms
Slide 8
Slide 8 text
No content
Slide 9
Slide 9 text
No content
Slide 10
Slide 10 text
No content
Slide 11
Slide 11 text
No content
Slide 12
Slide 12 text
High Availability
Slide 13
Slide 13 text
Resource Consumption
Slide 14
Slide 14 text
No content
Slide 15
Slide 15 text
Disk
Memory
Band-
width
Processor
time
Logs
GC
Open
Connections
Deadlocks
Stop all disk activities
Swap
Slowness
Services stop
responding
Queues Amount
Workers
Slowness
Slide 16
Slide 16 text
Integrations
Slide 17
Slide 17 text
Integrations always
fails!
Slide 18
Slide 18 text
Integration Fails always
Internal
External
DB API Storage Network
API ISP Hop
Cloud
Slide 19
Slide 19 text
Map hidden
integrations
E.g. DNS
Slide 20
Slide 20 text
Fail Fast
Slide 21
Slide 21 text
Failing Fast reduces
transient errors
Slide 22
Slide 22 text
Timeouts
Slide 23
Slide 23 text
Never trust in
default timeouts
Slide 24
Slide 24 text
Threads Timeouts to get rid of deadlocls
Internal Little timeout
External Depends: The least possible
Slide 25
Slide 25 text
Retry
Slide 26
Slide 26 text
1 2 3 5 8 n
Fibonacci Proportion
...
Slide 27
Slide 27 text
Isolate Critical
Components
Slide 28
Slide 28 text
Panel / API
Painel Web Internal API - HTTP
Resources
Connection
Pool
App Server
Business
Rules
Integrations
Slide 29
Slide 29 text
App Internal API
App Panel
Painel Web API - HTTP
Resources
Conn.
Pool
App
Server
Business
Rules
Integrations
Resources
Conn.
Pool
App
Server
Business
Rules
Integrations
Slide 30
Slide 30 text
Less Components
==
Less Problems
Slide 31
Slide 31 text
No content
Slide 32
Slide 32 text
Redundancy
Slide 33
Slide 33 text
Health Check
Slide 34
Slide 34 text
No content
Slide 35
Slide 35 text
No content
Slide 36
Slide 36 text
Scalability
Slide 37
Slide 37 text
CAP Theorem
Slide 38
Slide 38 text
Availability
Consistency
Tolerance
to network
partition
Slide 39
Slide 39 text
Availability
Consistency
Partition
Tolerance
to network
partition
whether system is
available or not
Slide 40
Slide 40 text
Availability
Consistency
Tolerance
to network
partition
Same data in all nodes
Slide 41
Slide 41 text
Availability
Consistency
Tolerance
to network
partition
Tolerante when a network
fails