Top Banner
Aviran Mordo Head of Microservices and the DevOps Journey at Wix.com www.linkedin.com/in/avir an @aviranm http:// www.aviransplace.com
66

Mircoservices and DevOps journey at Wix.com

Apr 08, 2017

Download

Software

Aviran Mordo
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mircoservices and DevOps journey at Wix.com

Aviran MordoHead of

Microservices and the DevOps Journey at Wix.com

www.linkedin.com/in/aviran

@aviranm

http://www.aviransplace.com

Page 2: Mircoservices and DevOps journey at Wix.com
Page 3: Mircoservices and DevOps journey at Wix.com

Wix In Numbers~95M users

Static storage is >2Pb of data

3 data centers + 2 clouds (Google, Amazon)

2B HTTP requests/day

4 R&D centers (Tel-Aviv, Vilnius, Dnipro, Kiev)NEW

Page 4: Mircoservices and DevOps journey at Wix.com

Over 250 Microservices on Production

Page 5: Mircoservices and DevOps journey at Wix.com

Microservices - What Does it Take

Page 6: Mircoservices and DevOps journey at Wix.com

Why Microservices

Scale engineering

Development Velocity

Scale system ?

Page 7: Mircoservices and DevOps journey at Wix.com

Microservices is the First Post DevOps Architecture

Page 8: Mircoservices and DevOps journey at Wix.com

How to Get There? (Wix’s journey)

http://gpstrackit.com/wp-content/uploads/2013/11/VanishingPointwRoadSigns.jpg

Page 9: Mircoservices and DevOps journey at Wix.com

http://p1.pichost.me/i/11/1339236.jpg

In the Beginning of Time

About 6 years ago

Page 10: Mircoservices and DevOps journey at Wix.com

The Monolithic GiantOne monolithic server that handled everything

Dependency between features

Changes in unrelated areas caused deployment of the whole system

Failure in unrelated areas will cause system wide downtime

Lighttpd(file serving) MySQL

DB

Wix(Tomcat)

Page 11: Mircoservices and DevOps journey at Wix.com

Breaking the System Apart

https://upload.wikimedia.org/wikipedia/commons/6/67/Broken_glass.jpg

Page 12: Mircoservices and DevOps journey at Wix.com
Page 13: Mircoservices and DevOps journey at Wix.com

Concerns and SLA

Many feature request

Lower performance requirement

Lower availability requirement

Write intensive

Edit websites

Not many product changes

High performance

High availability

Read intensive

View sites, created by Wix editor

Page 14: Mircoservices and DevOps journey at Wix.com

Mono-Wix

Phase 1

Page 15: Mircoservices and DevOps journey at Wix.com

Extract Public Service

Editor service (Mono-Wix) Public service

Page 16: Mircoservices and DevOps journey at Wix.com

Divide and Conquer

Editor service Public service

Guideline: No runtime, deployment or data dependency

Page 17: Mircoservices and DevOps journey at Wix.com

Separation by Product LifecycleDecouple architecture => Decouple teams

Deployment independence

Areas with frequent changes

Editor service Public service

Page 18: Mircoservices and DevOps journey at Wix.com

Separation by Service LevelScale independently Use different data storeOptimize data per use case (Read vs Write)Run on different datacenters / clouds / zonesSystem resiliency (degradation of service vs. downtime)Faster recovery time

Editor service Public service

Page 19: Mircoservices and DevOps journey at Wix.com

http://blogs.adobe.com/captivate/2011/03/training-adding-interactivity-to-elearning-courses-with-adobe-captivate-5.html/time-to-learn-clock

Page 20: Mircoservices and DevOps journey at Wix.com

Service Boundary

Page 21: Mircoservices and DevOps journey at Wix.com

Separation of DatabasesCopy data between segments

Optimize data per use case (read vs. write intensive)

Different data stores

Public serviceEditor serviceCopy necessary data

Page 22: Mircoservices and DevOps journey at Wix.com

Serialization

Page 23: Mircoservices and DevOps journey at Wix.com

Serialization / ProtocolBinary?JSON / XML / Text?HTTP?

Public serviceEditor service ?

Page 24: Mircoservices and DevOps journey at Wix.com

Serialization / Protocol - TradeoffsReadability?

Performance?Debug?Tools?Monitoring?Dependency?

Public serviceEditor service ?

Page 25: Mircoservices and DevOps journey at Wix.com

API Transport/Protocol

Page 26: Mircoservices and DevOps journey at Wix.com

How to Expose an APIREST?RPC?SOAP?

Public serviceEditor service ?

Page 27: Mircoservices and DevOps journey at Wix.com

Wix’s ChoicesRESTHTTP

Public serviceEditor service

BinaryJSON-RPCHTTP

Page 28: Mircoservices and DevOps journey at Wix.com

API Versioning

Page 29: Mircoservices and DevOps journey at Wix.com

API Versioning

Public serviceEditor serviceBackward compatibility

Maybe here

API Schema /v1/v2YAGNI

Page 30: Mircoservices and DevOps journey at Wix.com

A-Synchronous

Page 31: Mircoservices and DevOps journey at Wix.com

Which Queuing System to Use

Public serviceEditor serviceThreads

Kafka?RabbitMQ?ActiveMQ????

YAGNI

Page 32: Mircoservices and DevOps journey at Wix.com

Service Discovery

Page 33: Mircoservices and DevOps journey at Wix.com

Service Discovery

Public serviceEditor serviceConfiguration (DNS+LB)

Zookeeper?Consul?Etcd?Eureka?

YAGNI

Page 34: Mircoservices and DevOps journey at Wix.com

Resilience

Page 35: Mircoservices and DevOps journey at Wix.com

What does the Arrow Mean?

Public serviceEditor service

Failure PointEvery Network Hop Reduces

Availability

Page 36: Mircoservices and DevOps journey at Wix.com

Failure Points = Network I/O

Public serviceEditor service

Failure Point

Retry policyCircuit breakerThrottlers

Be careful – you may cause downtime

Retry only on idempotent operations

Page 37: Mircoservices and DevOps journey at Wix.com

Degradation of Service

Public serviceEditor service

Failure Point

Feature killer (Killer feature)FallbacksSelf healing

Page 38: Mircoservices and DevOps journey at Wix.com

Testing

Page 39: Mircoservices and DevOps journey at Wix.com

Test a Distributed System (at Wix)

Public serviceEditor service

Unit TestIntegration TestServer E2EAutomation

Client

Page 40: Mircoservices and DevOps journey at Wix.com

Distributed LoggingYAGNI

Page 41: Mircoservices and DevOps journey at Wix.com

Build Visibility Into the Service

Page 42: Mircoservices and DevOps journey at Wix.com

Ownership

Page 43: Mircoservices and DevOps journey at Wix.com

Team WorkMicroservice is owned by a team

You build it – you run it

No microservice is left without a clear owner

Microservice is NOT a library – it is a live production system

Page 44: Mircoservices and DevOps journey at Wix.com

What is the Right Size of a Microservice?

Page 45: Mircoservices and DevOps journey at Wix.com

The Size of a Microservice is the Size of the Team that is Building it

“Organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations”Conway, Melvin

Page 46: Mircoservices and DevOps journey at Wix.com

What did you Learn from Just 2 Services

● Service boundary● Monitoring infrastructure● Serialization format● Synchronous communication protocol (HTTP/Binary)● Asynchronous (queuing infra)● Service SLA● API definition (REST/ RPC / Versioning)● Data separation● Deployment strategy● Testing infrastructure (integration test, e2e test)● Compatibility (backwards / forward)

Page 47: Mircoservices and DevOps journey at Wix.com

Continue to Extract More Microservices

Page 48: Mircoservices and DevOps journey at Wix.com

HTML Editor

Flash Editor

MSM

Private Media

Public Media

Editor Segment Public Segment

Premium Services

List DB

App Builder

App Store

App Market

Dashboard

Mailer

TimeZone

Public HTML API

Public API (Flash)

MSP

Public Server

HTML Renderer

HTML SEO Renderer

Flash Renderer

Flash SEO Renderer

Sitemap Renderer

Robots.txt Renderer

User Server

Template Viewer

ContactsHUBActivity

Site Members

Store MgrComments

Snapshoter

User Pref

Feed Me

Shout-out Hotels

PETRI

Site Pref

Dist LoggerSlicer

eCom Renderer

eCom Cart

eCom Checkout

eCom Catalog

eCom Orders

Payment Facade

Account Info

HTML API

HTML Embeder

BlogMobile

Mostly writes

2 Data centers

Db active-standby (preferably active-active)

Performance < 2s 99%

Serves mostly site builders

Uptime > 99.9

Mostly reads

>2 Data centers

Db active-active(-active)

Performance < 500ms 99%

Serves mostly site viewers

Uptime > 99.99

Page 49: Mircoservices and DevOps journey at Wix.com

When to Extract a New Microservice

Page 50: Mircoservices and DevOps journey at Wix.com

Microservice or Library?Do I create deployment dependency?

What is DevOps overhead (managing middleware) ?

Who owns it?

Does it have its own development lifecycle?

Does it fit the scalability / availability concerns?

Can a different team develop it?

I need time zone from an IP address

Page 51: Mircoservices and DevOps journey at Wix.com

Microservice has Ops, Library is Only Computational

Page 52: Mircoservices and DevOps journey at Wix.com

Which Technology Stack to Use

Page 53: Mircoservices and DevOps journey at Wix.com

Free to Chose?Microservices give the freedom to use different technology stacksEnables innovation

Page 54: Mircoservices and DevOps journey at Wix.com

Default to the Stack You Know how to Operate

Page 55: Mircoservices and DevOps journey at Wix.com

Innovate on Non Critical Microservices and Take Full Responsibility for its Operation

Page 56: Mircoservices and DevOps journey at Wix.com

Polyglotic System?

Page 57: Mircoservices and DevOps journey at Wix.com

Limit your StackCode reuse

Cross cutting concerns (session, security, auditing, testing, logging…)

Faster system evolution

Development velocity

Page 58: Mircoservices and DevOps journey at Wix.com

http://wallpaperbeta.com/dogs_kiss_noses_animals_hd-wallpaper-242054/

Reduce the Cost of a New Microservice

Page 59: Mircoservices and DevOps journey at Wix.com

What else will you learn

● Distributed transactions● System monitoring● Distributed traces● Tradeoff of a new microservice vs. extending an

existing one● Deployment strategy and dependency● Handling cascading failures● Team building/splitting

Page 60: Mircoservices and DevOps journey at Wix.com

Summary

Page 61: Mircoservices and DevOps journey at Wix.com

Every Microservice is a Overhead

Page 62: Mircoservices and DevOps journey at Wix.com

YAGNIIt is all about trade-off

Page 63: Mircoservices and DevOps journey at Wix.com

Microservices TradeoffsMonolith Microservice

s

Team Autonomy

Maintainability

Cognitive load

Scaling

Testing

System Complexity

Time to Market

Page 64: Mircoservices and DevOps journey at Wix.com
Page 65: Mircoservices and DevOps journey at Wix.com

Thank You

Page 66: Mircoservices and DevOps journey at Wix.com

Q&A@aviranm

http://www.aviransplace.com

www.linkedin.com/in/aviran

Aviran MordoHead of Engineering

http://goo.gl/32xOTt

http://engineering.wix.com

@WixEng

We’re hiringwww.wix.com/jobs

Kiev