Slide 1

Slide 1 text

Scaling Software Architecture 101 and Best Practices

Slide 2

Slide 2 text

Disclaimer Presentations are intended for educational purposes only and not to replace independent professional judgment. The views and opinions expressed in this presentation do not necessarily reflect the official policy or position of blibli.com. Audience discretion is advised.

Slide 3

Slide 3 text

Who am I? • Alex Xandra Albert Sim • Principal Research and Development Engineer at blibli.com • [email protected] • bertzzie(.sim)

Slide 4

Slide 4 text

What is SOFTWARE ARCHITECTURE?

Slide 5

Slide 5 text

The highest-level breakdown of a system into its parts

Slide 6

Slide 6 text

System Parts Academics IS Finance IS Bank A Bank B HR IS IT IS

Slide 7

Slide 7 text

Structural Elements

Slide 8

Slide 8 text

Interfaces

Slide 9

Slide 9 text

Architectural decisions are hard to change

Slide 10

Slide 10 text

Multiple architectures in one big system is normal

Slide 11

Slide 11 text

Architecture changes over time

Slide 12

Slide 12 text

the GOALS OF ARCHITECTURE

Slide 13

Slide 13 text

Expose the structure of the system Hiding the implementation details while

Slide 14

Slide 14 text

Realize all of the use cases and scenarios

Slide 15

Slide 15 text

Address the requirements of various stakeholders

Slide 16

Slide 16 text

Handle both functional and quality requirements

Slide 17

Slide 17 text

TYPES OF SOFTWARE ARCHITECTURE (WEB)

Slide 18

Slide 18 text

Monolithic Architecture Image source: http://bits.citrusbyte.com/microservices/

Slide 19

Slide 19 text

Monolithic Architecture Pros • Cross cutting component integration is easy • Communication between layers / components are fast Cons • Long development cycle • Scaling problem • 1 problematic part == whole app down

Slide 20

Slide 20 text

Microservice Architecture User Membership System Order System Messaging System Payment System API Gateway

Slide 21

Slide 21 text

Microservice Architecture – User Registration User Membership System Order System Messaging System Payment System API Gateway

Slide 22

Slide 22 text

Microservice Architecture - Purchase User Membership System Order System Messaging System Payment System API Gateway

Slide 23

Slide 23 text

Microservices Architecture Pros • Fault tolerant • Service independence means fast and easy development / deployment • Easier to add / remove stuff Cons • Operational complexity is VERY high • Contracts between services are hard to maintain • Hard to get right. Lot of teams fall into “distributed monolith” rather than “microservice”

Slide 24

Slide 24 text

Event-Driven Architecture User API Gateway Membership System Order System Messaging System Payment System Event Broker

Slide 25

Slide 25 text

Event-Driven Architecture – User Registration User API Gateway Membership System Event Broker Order System Payment System Messaging System 1 2 3 4

Slide 26

Slide 26 text

Event-Driven Architecture - Purchase User API Gateway Event Broker Membership System Order System Messaging System Payment System 1 2 3 4 4 4

Slide 27

Slide 27 text

Event-Driven Application Pros • Very low coupling • Simple to setup and scale Cons • Data consistency is hard. Eventually consistent instead of ACID • Complexity is through the roof • Flow of program is hard to trace / learn

Slide 28

Slide 28 text

Why and How to do SCALING ARCHITECTURE

Slide 29

Slide 29 text

Scalability Capability of a system to handle work that scales linearly with the resources it uses.

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

How to Scale: Vertical Scaling 2 CPU 4 GB RAM 200 IOPS storage 100 Mb/s Network 8 CPU 16 GB RAM 400 IOPS storage 1000 Mb/s Network

Slide 32

Slide 32 text

How to Scale: Horizontal Scaling 2 CPU 4 GB RAM 200 IOPS storage 100 Mb/s Network 2 CPU 4 GB RAM 200 IOPS storage 100 Mb/s Network 2 CPU 4 GB RAM 200 IOPS storage 100 Mb/s Network 2 CPU 4 GB RAM 200 IOPS storage 100 Mb/s Network 2 CPU 4 GB RAM 200 IOPS storage 100 Mb/s Network

Slide 33

Slide 33 text

How to Scale: Horizontal Scaling (2) Load Balancer Service A Service A Service A Service A

Slide 34

Slide 34 text

Evolving Architecture to Scale Monolithic Microservice Event-Driven

Slide 35

Slide 35 text

Monolithic to Microservice: Step 1 Load Balancer Service A Service A Service A /cart /login /search Database

Slide 36

Slide 36 text

Monolithic to Microservice: Step 2a Load Balancer Service B Service A Service A /cart /login /search Database Database

Slide 37

Slide 37 text

Monolithic to Microservice: Step 2b Load Balancer Service B Service A Service C /cart /login /search Database Database Database

Slide 38

Slide 38 text

How to Split Services? • From the least depended ones • By business function • Replace one by one • Potentially need to re-org too! • Test extensively per new service deployment!

Slide 39

Slide 39 text

QUESTION AND ANSWERS

Slide 40

Slide 40 text

Thank You