“kick-off with scale in mind” by yousef wadi

21
Kickowith scale in Mind Server/Code Solution Architecture to scale easily as you grow

Upload: jordan-open-source-association

Post on 02-Jul-2015

72 views

Category:

Software


2 download

DESCRIPTION

“Kick-off with Scale in Mind” Well begun is half done; this techtalk guides you on how to start your web projects keeping scaling in mind, it describes what you can achieve from an architectural perspective, and discusses how you can build it with the current open source technologies. by: Yousef Wadi- Chief Product Officer and Co-Founder at Arabiaweather

TRANSCRIPT

Page 1: “Kick-off with Scale in Mind” by Yousef Wadi

Kickoff with scale in MindServer/Code Solution Architecture to scale easily as you grow

Page 2: “Kick-off with Scale in Mind” by Yousef Wadi

Yousef Wadi Chief Product Officer / Co-Founder

Arabiaweather Inc.

Page 3: “Kick-off with Scale in Mind” by Yousef Wadi

What is (Ready to Scale)

Ability to grow fast without the need to change your architecture

Page 4: “Kick-off with Scale in Mind” by Yousef Wadi

Should I always thing of Scale?

If you want to grow !

Page 5: “Kick-off with Scale in Mind” by Yousef Wadi

Outline• Server Setup Structure

• QA-1 • Web/API Application Servers

• Scaling using NodeJS • QA-2

• Data Storage • Scaled Storage • QA-3

• Final QA

Page 6: “Kick-off with Scale in Mind” by Yousef Wadi

What is Vertical VS Horizontal Scaling Mean?

Vertical ex: (Grow Server Resources)

Horizontal ex: (Expand into others servers)

Page 7: “Kick-off with Scale in Mind” by Yousef Wadi

Server Setup Structures

Linear

Diamond

Fan-out

Multi-Fans

Page 8: “Kick-off with Scale in Mind” by Yousef Wadi

Linear

Database'Server'1'

Web'Server'Machine'1'X

X

Page 9: “Kick-off with Scale in Mind” by Yousef Wadi

Diamond

Database'Server'1'

Load'Balancer'

Web'Server'1' Web'Server'2' Web'Server'n…'

X

XX

Page 10: “Kick-off with Scale in Mind” by Yousef Wadi

Database'Server'1'

Load'Balancer'

Web'Server'1' Web'Server'2' Web'Server'n…'

Database'Server'2' Database'Server'n…'

Fan-out

X

Page 11: “Kick-off with Scale in Mind” by Yousef Wadi

Database'Server'1'

Load'Balancer'1'

Web'Server'1' Web'Server'2' Web'Server'n…'

Database'Server'2' Database'Server'n…'

Load'Balancer'n…'

DNS'Round'Robin'

Multi-Fans

Page 12: “Kick-off with Scale in Mind” by Yousef Wadi

Why is this Applicable Now?

There was no cloud servers, there was no ability to spin off instances fast!

Page 13: “Kick-off with Scale in Mind” by Yousef Wadi

Q/A - 1

Page 14: “Kick-off with Scale in Mind” by Yousef Wadi

WEB/API Application Server

Page 15: “Kick-off with Scale in Mind” by Yousef Wadi

• ASYNC

• Non-Blocking I/O

• ASYNC Bindings

• Single Threaded Servers

• Cluster Servers

• FAST !

• Best Used as Server Glue

Page 16: “Kick-off with Scale in Mind” by Yousef Wadi

Scaling Using NodeJS

M1(4xC)

NodeJS Code

Port 1000

NodeJS Code

Port 1001

NodeJS Code

Port 1002

NodeJS Code

Port 1003

M2(4xC)

NodeJS Code

Port 1000

NodeJS Code

Port 1001

NodeJS Code

Port 1002

NodeJS Code

Port 1003

Reverse Proxy (nginx, haproxy, ats, etc…) Port 80

Page 17: “Kick-off with Scale in Mind” by Yousef Wadi

Q/A - 2

Page 18: “Kick-off with Scale in Mind” by Yousef Wadi

Data Storage (Reads and Writes)

Page 19: “Kick-off with Scale in Mind” by Yousef Wadi

Availability

Partition Tolerance Consistency

CA MYSQL

Postgres LevelDB

CP MongoDB

Redis SOLR

AP Kasandra CouchDB

DynamoDB SimpleDB

A

C P

Always Available for Reads and Writes

Works Well over Net. Partitions

All Clients always have Same Data

CP ->QUEUE-> CA (For High Write Volume and Speed of Writes)

CA ->INDEX-> CP (For Faster Reads)

CP ->INDEX-> CP (For Faster Reads)

Page 20: “Kick-off with Scale in Mind” by Yousef Wadi

Q/A - 3

Page 21: “Kick-off with Scale in Mind” by Yousef Wadi

Overall Q/A