1 of 33

Growing from 0 to 1 million users

2 of 33

Devops Citytaxi, Docente catedrático Tecnología sistemas informáticos.

Contact : jhon.castro@ucaldas.edu.co

jhon.castro@citytaxiapp.com

Twitter : @edisoncast

Github : edisoncast

Who am I ?

3 of 33

Monolithic Application

Source: https://dzone.com/storage/temp/570495-slide1.png

4 of 33

Decide which language is best for you!

Not all languages work in the same way, and perhaps their approach is more specialized is certain aspects.

Prototype.

Speed.

Mathematical Processes.

Access to database.

Processing of queues.

Synchronous.

Asynchronous.

RAM or CPU

5 of 33

Response Time

6 of 33

Kind of hosting?

Source:

https://www.gigsgigs.com/wp-content/uploads/2015/05/compare3-1080px.png

7 of 33

Bottleneck

Source: http://www.fredberinger.com/images/bottleneck.jpg

8 of 33

Sympthoms

  1. CPU, Memory and Disk too high.
  2. Service interruption

9 of 33

Vertical Scaling vs horizontal scaling

10 of 33

First steps

Source: https://homes.cs.washington.edu/~mernst/advice/version-control-fig3.png

https://assets.digitalocean.com/articles/architecture/separate_database.png

11 of 33

Load Balancer

Source: https://www.ricohidc.com/images/load-balancing-diagram.png

  1. Horizontal scaling
  2. Can protect against DDOS attacks

12 of 33

Caching Reverse Proxy

Source: https://cdn-1.wp.nginx.com/wp-content/uploads/2016/08/Garrett-Content_Caching-9_Caching-Process-11-14.jpg

  • Nginx, Varnish, Squid.
  • Review where your users are.

13 of 33

Master-Slave Database Replication

Source: https://mariadb.com/sites/default/files/pictures/Images/dbreplication173.png

  • You need to change the code.
  • Maintenance is complex.
  • If master fail, slave can receive updates.
  • Information out of date in slaves.

14 of 33

Our Case

36.000 Transactions per minute

52.000.000 Transactions per day

15 of 33

Our solution

  1. AWS

Auto Scaling

Microservices

RDS

Http to Web sockets

16 of 33

Auto scaling

“ Auto Scaling le permite mantener la disponibilidad de la aplicación y aumentar o reducir automáticamente la capacidad de Amazon EC2, según las condiciones que defina. Puede utilizar Auto Scaling para asegurarse de que está ejecutando la cantidad deseada de instancias de Amazon EC2. Auto Scaling también puede incrementar automáticamente el número de instancias de Amazon EC2 durante los picos de demanda para mantener el desempeño y reducir la capacidad durante los periodos de calma en la demanda para minimizar los costos. ”

17 of 33

Auto scaling

18 of 33

Microservices

19 of 33

RDS

“ Con Amazon Relational Database Service (Amazon RDS), es sencillo configurar, utilizar y escalar una base de datos relacional en la nube. Proporciona capacidad rentable y de tamaño modificable y, al mismo tiempo, administra las tediosas tareas de administración de la base de datos, lo que le permite centrarse en sus aplicaciones y en su negocio. “

20 of 33

RDS

21 of 33

Protocols

22 of 33

NoSQL database inclusion

23 of 33

Our Goal

1 million users

24 of 33

Costs

25 of 33

Micro deploy (Devops Culture)

26 of 33

Infrastructure as code

Define infrastructure as code to increase operator productivity and transparency.

COLLABORATE & SHARE

Terraform configuration can be stored in version control, shared, and collaborated on by teams of operators.

EVOLVE YOUR INFRASTRUCTURE

Track the complete history of infrastructure versions.

AUTOMATION FRIENDLY

If it can be codified, it can be automated.

27 of 33

Continuous integration

28 of 33

Application load balancer

29 of 33

Maintaining Quality at Scale

30 of 33

Real cases

31 of 33

Netflix Bandwidth Usage Climbs to Nearly 37% of Internet Traffic at Peak Hours

32 of 33

Trend of global User Numbers

33 of 33

Questions

Preguntas?