SlideShare a Scribd company logo
Aviran Mordo
Head of Engineering
@aviranm
linkedin.com/in/aviran
aviransplace.com
Scaling with
Microservices Architecture
and Multi-cloud platforms
Scaling wix with microservices architecture jax london-2015
Wix in Numbers
Over 72M users
Static storage is >2PB of data
3 data centers + 3 clouds (Google, Amazon,Azure)
2B HTTP requests/day
1000 people work atWix
Initial Architecture
Built for fast development
Stateful login (Tomcat session), Ehcache, file uploads
No consideration for performance, scalability and testing
Intended for short-term use
Tomcat, Hibernate, custom web framework
Lighttpd
(file serving) MySQL
DB
Wix
(Tomcat)
The Monolithic Giant
One monolithic server that handled everything
Dependency between features
Changes in unrelated areas of the system caused deployment of
the whole system
Failure in unrelated areas will cause system wide downtime
Breaking the System Apart
Scaling wix with microservices architecture jax london-2015
Concerns and SLA
DataValidation
Security / Authentication
Data consistency
Lots of data
Edit websites
High availability
High performance
Lots of static files
Very high traffic volume
Viewport optimization
Long tail (immutable)
Serving Media
High availability
High performance
High traffic volume
Long tail (mutable)
View sites, created by
Wix editor
Wix Segmentation
1. Editor Segment 3. Public Segment2. Media Segment
Networking
HTML
Editor
Flash
Editor
MSM
Private
Media
Public
Media
Editor Segment Public Segment
Premium
Services
eCommerse
List DB
App
Builder
App
Store
App
Market
Dashboard
Statics/me
dia
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
ContactsHUB
Activit
y
Site
Members
Provided
Mailing
Service
Comments
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
It is all about
Scaling wix with microservices architecture jax london-2015
Microservices Guidelines
Each service has its own DB schema (if one is needed)
Only one service should write to a specific DB table(s)
There may be additional read-only services that directly
accesses the DB (for performance reasons)
Services are stateless
No DB transactions
Cache is not a building block, but an optimization
Microservices Tradeoffs
Each service has its own DB schema (if one is needed)
Gain - Easy to scale microservices based on service level concerns
Tradeoff – system complexity, performance
Only one service should write to a specific DB table(s)
Gain - Decoupling architecture – faster development
Tradeoff – system complexity / performance
May have additional read-only services that accesses the DB
Gain - Performance gain
Tradeoff - coupling
Services are stateless
Gain - Easy to scale out (just add more servers)
Tradeoff - performance / consistency
No DB transactions
Gain - Better DB performance, easier to scale
Tradeoff - system complexity
1. Editor Segment
Editor Server
Immutable JSON pages (~3M / day)
Site revisions
Active – standby MySQL cross datacenters
Editor Server
MySQL
Active
Sites
MySQL
Archive
Scaling wix with microservices architecture jax london-2015
Protect The Data
DB outage with fast recovery = replication
Data poisoning/corruption = revisions / backup
Make the data available at all times = data distribution to multiple
locations / providers
Browser
Editor
Server
GCS
MySQL
Active
Sites
MySQL
Archive
Saving Editor Data
WixMedia
(Amazon)
WixMedia
(Google)
Save Page(s)
200 OK
Upload
Save Page
DC replication
Notify
MySQL
Archive
MySQL
Active
Sites
S3
WixMedia
(DC-1)
Browser
Editor
Server
GCS
MySQL
Active
Sites
MySQL
Archive
WixMedia
(Amazon)
WixMedia
(Google)
Save Page(s)
200 OK
Upload
Save Page
DC replication
Notify
MySQL
Archive
MySQL
Active
Sites
S3
WixMedia
(DC-1)
Self Healing Process
No DB Transactions
Save each page (JSON) as an atomic operation
Page ID is a content based hash (immutable/idempotent)
Finalize transaction by sending site header (list of pages)
Can generate orphaned pages, not a problem in practice
2. Media Segment (WixMP)
Wix Media Platform (WixMP)
Eventual consistent distributed file system
(2PB user media files)
Dynamic media processing
Multi datacenter aware
Automatic fallback cross DC
Run on commodity servers & cloud
T
Google
Cloud
Prospero – Wix Media Manager
get image.jpg
First
fallback
Second
fallback
If not in
CDN
Amazon
x36
T
x36
T
x32
Austin
CDN
3. Public Segment
Public Segment Roles
Routing (resolve URLs)
Dispatching (to a renderer)
Rendering (HTML,XML,TXT)
Public
Server
HTML
Renderer
HTML SEO
Renderer
Flash
Renderer
Sitemap
Renderer
Robots.txt
Renderer
www.example.com
Flash SEO
Renderer
Public SLA
Our goal: 99% response time <100ms at peak traffic
Publish Site
Publish site header (a map of pages for a site)
Publish routing table
Publish site header / routes (CQRS)
Editor Segment Public Segment
Built For Speed
Minimize out-of-process hops (2 DB, 1 RPC)
Lookup tables are cached in memory, updated every few minutes
Denormalized data – optimize for read by primary key (MySQL)
Minimize business logic
How a Page Gets Rendered
Bootstrap HTML template that contains only data
Only JavaScript imports
JSON data (site-header + dynamic data)
No “real” HTML view
Offload rendering work to the browser
The average Intel Core
i750 can push up to 7
GFLOPS without
overclocking
Why JSON?
Easy to parse in JavaScript and Java/Scala
Fairly compact text format
Highly compressible (5:1 even for small payloads)
Easy to fix rendering bugs and cross browsers issues (just
deploy a new code)
Minimum Number of Public Servers
Needed to Serve 66M Sites
4
Public SLA
Be Available 99.999%
Serving a Site – Sunny Day
Archive
CDN WixMP
Browser
http://example.wix.com
Store HTML
to cache
HTTP
Request
Notify
site view
LB
Public
Renderer
HTML
Resources / Media
HTTP
Request
Serving a Site – DC Lost
Archive
CDN WixMP
Browser
http://example.wix.com
LB
Public
Renderer
LB
Public
Renderer
Change DNS
HTTP
Request
Serving a Site – Public Lost
Archive
Browser
http://example.wix.com
LB
Public
Renderer
Get
Cached HTML
Version
HTML
HTTP
Request
LB
Public
Renderer
Fallback to 2nd
DC
Living in the Browser
CDN WixMP
Browser
http://example.wix.com
LB
Public
Renderer
Editor Pages
Fallback
JSON /
Media
HTML
HTTP
Request Fallback
Summary
Identify concerns and SLA for different parts of the system
Build redundancy in critical path (for availability)
De-normalize data (for performance)
Minimize out-of-process hops (for performance)
Take advantage of client’s CPU power
Scaling wix with microservices architecture jax london-2015
Aviran Mordo
Head of Engineering
@aviranm
linkedin.com/in/aviran
aviransplace.com
http://engineering.wix.com
http://goo.gl/3xhpNW
@WixEng

More Related Content

What's hot (20)

PPTX
Scaling up to 30M users - The Wix Story
Aviran Mordo
 
PPTX
Scaling up to 30 m users
Yoav Avrahami
 
PPTX
Scaling wix to over 70 m users
Yoav Avrahami
 
PPTX
DV03 Smooth Migration to Windows Azure
Ronald Widha
 
PPTX
MSDN - Converting an existing ASP.NET application to Windows Azure
Maarten Balliauw
 
PPT
Shopzilla - Performance By Design
Tim Morrow
 
PPTX
The Essentials of Building Cloud-Based Web Apps with Azure
Ido Flatow
 
PPTX
Azure Data Storage
Ken Cenerelli
 
PPTX
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Ido Flatow
 
PDF
Best Practices for couchDB developers on Microsoft Azure
Brian Benz
 
PPTX
BizSpark Startup Night Windows Azure March 29, 2011
Spiffy
 
PPTX
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
Ido Flatow
 
PPTX
Building & managing wa app wely
Spiffy
 
PPTX
Experimenting on Humans - Advanced A/B Tests - QCon SF 2014
Aviran Mordo
 
PPTX
Azure in Developer Perspective
rizaon
 
PDF
Java in the Cloud : PaaS Platforms in Comparison
Eberhard Wolff
 
PPTX
Azure and web sites hackaton deck
Alexey Bokov
 
PPTX
Microsoft Azure: Deploy and Scale Modern Websites
WinWire Technologies Inc
 
PPTX
Moving to the Cloud: AWS, Zend, RightScale
mmoline
 
PPTX
Azure Storage Revisited
Joel Cochran
 
Scaling up to 30M users - The Wix Story
Aviran Mordo
 
Scaling up to 30 m users
Yoav Avrahami
 
Scaling wix to over 70 m users
Yoav Avrahami
 
DV03 Smooth Migration to Windows Azure
Ronald Widha
 
MSDN - Converting an existing ASP.NET application to Windows Azure
Maarten Balliauw
 
Shopzilla - Performance By Design
Tim Morrow
 
The Essentials of Building Cloud-Based Web Apps with Azure
Ido Flatow
 
Azure Data Storage
Ken Cenerelli
 
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Ido Flatow
 
Best Practices for couchDB developers on Microsoft Azure
Brian Benz
 
BizSpark Startup Night Windows Azure March 29, 2011
Spiffy
 
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
Ido Flatow
 
Building & managing wa app wely
Spiffy
 
Experimenting on Humans - Advanced A/B Tests - QCon SF 2014
Aviran Mordo
 
Azure in Developer Perspective
rizaon
 
Java in the Cloud : PaaS Platforms in Comparison
Eberhard Wolff
 
Azure and web sites hackaton deck
Alexey Bokov
 
Microsoft Azure: Deploy and Scale Modern Websites
WinWire Technologies Inc
 
Moving to the Cloud: AWS, Zend, RightScale
mmoline
 
Azure Storage Revisited
Joel Cochran
 

Viewers also liked (8)

PDF
Cassandra as event sourced journal for big data analytics
Anirvan Chakraborty
 
PPTX
Advanced A/B Testing - Jax London 2015
Aviran Mordo
 
PDF
GC Tuning Confessions Of A Performance Engineer - Improved :)
Monica Beckwith
 
PPTX
Road to Continuous Delivery - Wix.com
Aviran Mordo
 
PPTX
Java micro-services
James Lewis
 
PDF
Apache Cassandra for Timeseries- and Graph-Data
Guido Schmutz
 
PPTX
Wix Dev-Centric Culture And Continuous Delivery
Aviran Mordo
 
PPTX
Wix.com Back-end Engineering Guild Manifesto
Aviran Mordo
 
Cassandra as event sourced journal for big data analytics
Anirvan Chakraborty
 
Advanced A/B Testing - Jax London 2015
Aviran Mordo
 
GC Tuning Confessions Of A Performance Engineer - Improved :)
Monica Beckwith
 
Road to Continuous Delivery - Wix.com
Aviran Mordo
 
Java micro-services
James Lewis
 
Apache Cassandra for Timeseries- and Graph-Data
Guido Schmutz
 
Wix Dev-Centric Culture And Continuous Delivery
Aviran Mordo
 
Wix.com Back-end Engineering Guild Manifesto
Aviran Mordo
 
Ad

Similar to Scaling wix with microservices architecture jax london-2015 (20)

PPT
Spring 2007 SharePoint Connections Oleson Advanced Administration and Plannin...
Joel Oleson
 
PPT
Dot Net Nuke Presentation
Tony Cosentino
 
PPTX
NZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices Session
Michael Noel
 
PPTX
Azure Data platform
Mostafa
 
PPTX
SharePoint Saturday Michigan Keynote - Top 5 Infrastructure Concerns for a Sh...
Michael Noel
 
PPTX
Building Scalable .NET Web Applications
Buu Nguyen
 
PPTX
Azure SQL Managed Instance - SqlBits 2019
Jovan Popovic
 
PPTX
Ordina SOFTC Presentation - SharePoint 2010 Architecture
Ordina Belgium
 
PDF
SharePoint Performance Optimization In 10 Steps for the IT Professional
Joel Oleson
 
PPT
Running a Megasite on Microsoft Technologies
goodfriday
 
PPTX
Taking SharePoint to the Cloud
Aaron Saikovski
 
PPTX
TechEd Africa 2011 - OFC307: Architecting a Disaster Tolerant and Highly Avai...
Michael Noel
 
PPT
MOSS 2007 Deployment Fundamentals -Part2
Information Technology
 
PDF
OpenCms Days 2012 - The Dispatch - Running OpenCms 8 on Amazon cloud services
Alkacon Software GmbH & Co. KG
 
PPTX
Ultimate SharePoint Infrastructure Best Practises Session - Isle of Man Share...
Michael Noel
 
PDF
Keynote – When Open Source Meets the Enterprise
MariaDB plc
 
PPTX
Introduction To Cloud Computing
Rinat Shagisultanov
 
PPTX
Building the Perfect SharePoint 2010 Farm - SharePoint Saturday NYC 2011
Michael Noel
 
PPTX
Building the Perfect SharePoint 2010 Farm - SPS Sacramento
Michael Noel
 
PPTX
Azure data platform overview
James Serra
 
Spring 2007 SharePoint Connections Oleson Advanced Administration and Plannin...
Joel Oleson
 
Dot Net Nuke Presentation
Tony Cosentino
 
NZSPC 2013 - Ultimate SharePoint Infrastructure Best Practices Session
Michael Noel
 
Azure Data platform
Mostafa
 
SharePoint Saturday Michigan Keynote - Top 5 Infrastructure Concerns for a Sh...
Michael Noel
 
Building Scalable .NET Web Applications
Buu Nguyen
 
Azure SQL Managed Instance - SqlBits 2019
Jovan Popovic
 
Ordina SOFTC Presentation - SharePoint 2010 Architecture
Ordina Belgium
 
SharePoint Performance Optimization In 10 Steps for the IT Professional
Joel Oleson
 
Running a Megasite on Microsoft Technologies
goodfriday
 
Taking SharePoint to the Cloud
Aaron Saikovski
 
TechEd Africa 2011 - OFC307: Architecting a Disaster Tolerant and Highly Avai...
Michael Noel
 
MOSS 2007 Deployment Fundamentals -Part2
Information Technology
 
OpenCms Days 2012 - The Dispatch - Running OpenCms 8 on Amazon cloud services
Alkacon Software GmbH & Co. KG
 
Ultimate SharePoint Infrastructure Best Practises Session - Isle of Man Share...
Michael Noel
 
Keynote – When Open Source Meets the Enterprise
MariaDB plc
 
Introduction To Cloud Computing
Rinat Shagisultanov
 
Building the Perfect SharePoint 2010 Farm - SharePoint Saturday NYC 2011
Michael Noel
 
Building the Perfect SharePoint 2010 Farm - SPS Sacramento
Michael Noel
 
Azure data platform overview
James Serra
 
Ad

More from Aviran Mordo (9)

PDF
Platform as a Runtime - PaaR QCON 2024 - Final
Aviran Mordo
 
PPTX
Scaling Engineering by Hacking Conway’s Law - Geecon,2022
Aviran Mordo
 
PDF
Arrested by the cap devoxx uk 2018
Aviran Mordo
 
PPTX
Scaling Wix engineering
Aviran Mordo
 
PPTX
The Art of A/B Testing
Aviran Mordo
 
PPTX
Scaling r&d org while maintaining quality
Aviran Mordo
 
PPTX
Introduction to HTTP protocol
Aviran Mordo
 
PPTX
Lessons Learned Monitoring Production
Aviran Mordo
 
PPTX
Strategies in continuous delivery
Aviran Mordo
 
Platform as a Runtime - PaaR QCON 2024 - Final
Aviran Mordo
 
Scaling Engineering by Hacking Conway’s Law - Geecon,2022
Aviran Mordo
 
Arrested by the cap devoxx uk 2018
Aviran Mordo
 
Scaling Wix engineering
Aviran Mordo
 
The Art of A/B Testing
Aviran Mordo
 
Scaling r&d org while maintaining quality
Aviran Mordo
 
Introduction to HTTP protocol
Aviran Mordo
 
Lessons Learned Monitoring Production
Aviran Mordo
 
Strategies in continuous delivery
Aviran Mordo
 

Recently uploaded (20)

PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PPTX
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Agentic Automation Journey Series Day 2 – Prompt Engineering for UiPath Agents
klpathrudu
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Tally software_Introduction_Presentation
AditiBansal54083
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 

Scaling wix with microservices architecture jax london-2015

  • 1. Aviran Mordo Head of Engineering @aviranm linkedin.com/in/aviran aviransplace.com Scaling with Microservices Architecture and Multi-cloud platforms
  • 3. Wix in Numbers Over 72M users Static storage is >2PB of data 3 data centers + 3 clouds (Google, Amazon,Azure) 2B HTTP requests/day 1000 people work atWix
  • 4. Initial Architecture Built for fast development Stateful login (Tomcat session), Ehcache, file uploads No consideration for performance, scalability and testing Intended for short-term use Tomcat, Hibernate, custom web framework Lighttpd (file serving) MySQL DB Wix (Tomcat)
  • 5. The Monolithic Giant One monolithic server that handled everything Dependency between features Changes in unrelated areas of the system caused deployment of the whole system Failure in unrelated areas will cause system wide downtime
  • 8. Concerns and SLA DataValidation Security / Authentication Data consistency Lots of data Edit websites High availability High performance Lots of static files Very high traffic volume Viewport optimization Long tail (immutable) Serving Media High availability High performance High traffic volume Long tail (mutable) View sites, created by Wix editor
  • 9. Wix Segmentation 1. Editor Segment 3. Public Segment2. Media Segment Networking
  • 10. HTML Editor Flash Editor MSM Private Media Public Media Editor Segment Public Segment Premium Services eCommerse List DB App Builder App Store App Market Dashboard Statics/me dia 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 ContactsHUB Activit y Site Members Provided Mailing Service Comments 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
  • 11. It is all about
  • 13. Microservices Guidelines Each service has its own DB schema (if one is needed) Only one service should write to a specific DB table(s) There may be additional read-only services that directly accesses the DB (for performance reasons) Services are stateless No DB transactions Cache is not a building block, but an optimization
  • 14. Microservices Tradeoffs Each service has its own DB schema (if one is needed) Gain - Easy to scale microservices based on service level concerns Tradeoff – system complexity, performance Only one service should write to a specific DB table(s) Gain - Decoupling architecture – faster development Tradeoff – system complexity / performance May have additional read-only services that accesses the DB Gain - Performance gain Tradeoff - coupling Services are stateless Gain - Easy to scale out (just add more servers) Tradeoff - performance / consistency No DB transactions Gain - Better DB performance, easier to scale Tradeoff - system complexity
  • 16. Editor Server Immutable JSON pages (~3M / day) Site revisions Active – standby MySQL cross datacenters Editor Server MySQL Active Sites MySQL Archive
  • 18. Protect The Data DB outage with fast recovery = replication Data poisoning/corruption = revisions / backup Make the data available at all times = data distribution to multiple locations / providers
  • 19. Browser Editor Server GCS MySQL Active Sites MySQL Archive Saving Editor Data WixMedia (Amazon) WixMedia (Google) Save Page(s) 200 OK Upload Save Page DC replication Notify MySQL Archive MySQL Active Sites S3 WixMedia (DC-1)
  • 20. Browser Editor Server GCS MySQL Active Sites MySQL Archive WixMedia (Amazon) WixMedia (Google) Save Page(s) 200 OK Upload Save Page DC replication Notify MySQL Archive MySQL Active Sites S3 WixMedia (DC-1) Self Healing Process
  • 21. No DB Transactions Save each page (JSON) as an atomic operation Page ID is a content based hash (immutable/idempotent) Finalize transaction by sending site header (list of pages) Can generate orphaned pages, not a problem in practice
  • 22. 2. Media Segment (WixMP)
  • 23. Wix Media Platform (WixMP) Eventual consistent distributed file system (2PB user media files) Dynamic media processing Multi datacenter aware Automatic fallback cross DC Run on commodity servers & cloud
  • 24. T Google Cloud Prospero – Wix Media Manager get image.jpg First fallback Second fallback If not in CDN Amazon x36 T x36 T x32 Austin CDN
  • 26. Public Segment Roles Routing (resolve URLs) Dispatching (to a renderer) Rendering (HTML,XML,TXT) Public Server HTML Renderer HTML SEO Renderer Flash Renderer Sitemap Renderer Robots.txt Renderer www.example.com Flash SEO Renderer
  • 27. Public SLA Our goal: 99% response time <100ms at peak traffic
  • 28. Publish Site Publish site header (a map of pages for a site) Publish routing table Publish site header / routes (CQRS) Editor Segment Public Segment
  • 29. Built For Speed Minimize out-of-process hops (2 DB, 1 RPC) Lookup tables are cached in memory, updated every few minutes Denormalized data – optimize for read by primary key (MySQL) Minimize business logic
  • 30. How a Page Gets Rendered Bootstrap HTML template that contains only data Only JavaScript imports JSON data (site-header + dynamic data) No “real” HTML view
  • 31. Offload rendering work to the browser
  • 32. The average Intel Core i750 can push up to 7 GFLOPS without overclocking
  • 33. Why JSON? Easy to parse in JavaScript and Java/Scala Fairly compact text format Highly compressible (5:1 even for small payloads) Easy to fix rendering bugs and cross browsers issues (just deploy a new code)
  • 34. Minimum Number of Public Servers Needed to Serve 66M Sites 4
  • 36. Serving a Site – Sunny Day Archive CDN WixMP Browser http://example.wix.com Store HTML to cache HTTP Request Notify site view LB Public Renderer HTML Resources / Media HTTP Request
  • 37. Serving a Site – DC Lost Archive CDN WixMP Browser http://example.wix.com LB Public Renderer LB Public Renderer Change DNS HTTP Request
  • 38. Serving a Site – Public Lost Archive Browser http://example.wix.com LB Public Renderer Get Cached HTML Version HTML HTTP Request LB Public Renderer Fallback to 2nd DC
  • 39. Living in the Browser CDN WixMP Browser http://example.wix.com LB Public Renderer Editor Pages Fallback JSON / Media HTML HTTP Request Fallback
  • 40. Summary Identify concerns and SLA for different parts of the system Build redundancy in critical path (for availability) De-normalize data (for performance) Minimize out-of-process hops (for performance) Take advantage of client’s CPU power
  • 42. Aviran Mordo Head of Engineering @aviranm linkedin.com/in/aviran aviransplace.com http://engineering.wix.com http://goo.gl/3xhpNW @WixEng

Editor's Notes

  • #9: Editor – Read immediately after write – Small working set Viewer optimize for reads We fight for every ms. Page view = many resource downloading
  • #14: Read-only services only if it is part of the same business functionality
  • #15: Read-only services only if it is part of the same business functionality
  • #17: Immutable data helps handle eventual consistency MySql is a great key-value store Not all data is equal (only 6% of websites are edited 3 months after creation)
  • #19: Revision keep data safe from poisoning Pay in storage and management
  • #25: We can change the arrows as we want Tech vendor lock is a myth,  easy to change the api (small dev effort).  Invest in data distribution. Evaluation of new platform starts by putting the data.
  • #29: Save pages on JSON Upload to static storage
  • #37: Explain what is JSON and what is HTML
  • #38: UPS dies, secondary power source connected to the same UPS
  • #39: Due to error or bad configuration