Creating infrastructure for global web and mobile applications can be hard. Creating infrastructure for fast growing global applications can be very hard :) In brainly we had to move from traditional LAMP setup with bare metal servers to something new and cloud was not enough. With software like ansible, mesos, docker, consul, we have designed fully automated immutable setup, even with tests! On this presentation we will show you how, and share with you our exeperince with running this kind of platform.
08448380779 Call Girls In Friends Colony Women Seeking Men
Atmosphere 2016 - Pawel Mastalerz, Wojciech Inglot - New way of building infrastructure
1. NEW WAY OF BUILDING
INFRASTRUCTURE
Paweł Mastalerz
DevOps Engineer @ Brainly
pawel.mastalerz@brainly.com
Wojciech Inglot
DevOps Engineer @ Brainly
wojciech.inglot@brainly.com
2. 2
1. About Brainly
2.Current infrastructure
3.SOA (µservices)
4.Idea of new infrastructure
5.How have we made the concept alive?
6.Summary
Presentation Plan
3. 3
Brainly is the world’s largest social learning platform
About Brainly
60M
Monthly Unique
Users
4K
requests per
second
360M
Monthly Page
Views
6. 6
Current infrastructure
Pros:
●Low costs
●Full server power 24x7
●Good community support
for LAMP
Cons:
●We need to take care of
hardware failures
●Designed to run only LAMP stack
●Low network stability
●Too slow and time consuming
scaling
8. 8
Why Service Oriented Architecture?
●Simple design focused on one business capability
●Can be developed independently by different teams
●Can be developed using different programming languages and
tools
●Decentralized data management
●Can be easily scaled by adding more instances of a service
11. 11
●Defining the infrastructure as DSL
●Documentation
●Changes goes through review via PRs like in normal
development cycle
Infrastructure as a Code
13. ●Easy to add more servers when needed
●Shut them down when not needed
●Done automatically
13
Scalable
14. 14
●Failure of few servers should not affect the system
●Failure of entire zone should not affect the system
●Fast and relatively easy to fix or replace failed servers
Fault Tolerant
15. 15
Language agnostic
●PHP is not enough
●Allow to run applications written in any language
●Use the best language to solve specific problem
17. 17
Core: Cloud instead of bare metal
●Third party is taking care of the hardware
●Isolated private network
●Elastic costs
18. 18
Core: Mesos
●Easy scaling
●Abstracts out the managing resources from processing
application
●Handles cluster health and management
●Production proven at massive scale
19. 19
Core: Marathon
●Designed to run on Mesos
●Creates tasks for app
●Rolling deploy / restart
●Evaluate application's health using HTTP or TCP checks
to ensure 100% uptime
26. 26
●Deploy declaration in .yaml file stored in repository
○ Resources for single instance
○ Minimum number of instances
○ Environment variables and secrets
○ Before/after deployment scripts to run
●Loaded and processed by Ansible during build
●Secrets are injected from Ansible Vault to microservice
during deployment
Continuous Delivery with Ansible
28. 28
●ELK stack
●EC2 Discovery plugin - easy scaling of Elasticsearch
Data nodes
●> 100GB logs a day
Centralized logs
29. 29
●Using tools developed by InfluxData: Telegraf and
InlfuxDB
●Tracking resource usage for each microservice - cpu,
memory, network, events in data bus
●Gathering stats for each server
●Visualisation on Grafana
Monitoring
31. 31
●Each μservice should define contract under which
quality of service will be delivered, measured and
monitored
●The file must be stored in root directory of the project,
under the name .sla.yml
Alerting
34. 34
Platform in numbers
●28 (micro)services
●72 instances
●18 GB memory
●60% CPU utilization
●30s - deploy time
for most services
35. 35
Benefits - Dev
●We have entire set of Dockerized services, written in
Python, for machine learning
●OCR µservices written in Go and Python
●Common environment for DEV and PROD
36. 36
Benefits - Ops
●More time spent on actual problems rather than fixing
broken RAID :)
●Easy and fast scaling
●Utilize the DevOps approach