SlideShare a Scribd company logo
Wix Architecture at Scale

Aviran Mordo
Head of Back-End Engineering @ Wix

@aviranm
linkedin.com/in/aviran

aviransplace.com
Wix Architecture at Scale - QCon London 2014
Wix in Numbers
Over 45,000,000 users
1M new users/month
Static storage is >800TB of data
1.5TB new files/day

3 data centers + 2 clouds (Google, Amazon)
300 servers
700M HTTP requests/day
600 people work at Wix, of which ~ 200 in R&D
Initial Architecture
Tomcat, Hibernate, custom web framework
Built for fast development
Stateful login (Tomcat session), Ehcache, file uploads

No consideration for performance, scalability and testing
Intended for short-term use
Lighttpd
(file serving)

Wix
(Tomcat)

MySQL
DB
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
Concerns and SLA
Edit websites
Data Validation
Security /
Authentication
Data consistency
Lots of data

View sites, created
by Wix editor
High availability

Serving Media
High availability

High performance

High performance

High traffic
volume

Lots of static files

Long tail

Very high traffic
volume
Viewport optimization
Cacheable data
Wix Segmentation
Networking

1. Editor Segment

2. Media Segment

3. Public Segment
Making SOA Guidelines
Each service has its own database (if one is needed)
Only one service can write to a specific DB

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
1. Editor
Segment
Editor Server
Immutable JSON pages (~2.5M / day)
Site revisions
Active – standby MySQL cross datacenters

Editor Server

MySQL
Active
Sites

MySQL
Archive
Wix Architecture at Scale - QCon London 2014
Protect The Data
Protect against DB outage with fast recovery = replication
Protect against data poisoning/corruption = revisions /
backup
Make the data available at all times = data distribution to
multiple locations / providers
Saving Editor Data
Browser

Save
Page(s)
200 OK

Editor
Server

Upload

Static
Grid

Notify
Save
Page

MySQL
Active
Sites

MySQL
Archive

DC
replication

MySQL
Active
Sites

MySQL
Archive

Download Page
Notify

Archive
(Google)

Google
Cloud
Storage

Archive
(Amazon)
Self Healing Process
Browser

Save
Page(s)
200 OK

Editor
Server

Upload

Static
Grid

Notify
Save
Page

MySQL
Active
Sites

MySQL
Archive

DC
replication

MySQL
Active
Sites

MySQL
Archive

Download Page
Notify

Archive
(Google)

Google
Cloud
Storage

Archive
(Amazon)
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
Prospero – Wix Media Storage
800TB user media files
3M files uploaded daily
500M metadata records
Dynamic media processing
• Picture resize, crop and sharpen “on the fly”
• Watermark
• Audio format conversion
Prospero
Eventual consistent distributed file system
Multi datacenter aware
Automatic fallback cross DC

Run on commodity servers & cloud
Prospero – Wix Media Manager
Tampa

Google
Cloud

x36
x36
T x32
T

Second
fallback

First
fallback

Austin
CDN
get image.jpg

If not
in
CDN

x36
x36
T x32
T
3. Public
Segment
Public Segment Roles
Routing (resolve URLs)

www.example.com

HTML
Renderer

Dispatching (to a renderer)

HTML
SEO
Renderer

Flash
SEO
Renderer

Flash
Renderer

Sitemap
Renderer

Robots.txt
Renderer

Rendering (HTML,XML,TXT)
Public
Server
Public SLA
Response time <100ms at peak traffic
Publish A Site
Publish site header (a map of pages for a site)
Publish routing table

Publish site header / routes
Editor Segment

Public Segment
Built For Speed
Minimize out-of-service hops (2 DB, 1 RPC)
Lookup tables are cached in memory, updated every 5
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 (just deploy a new client code)
Minimum Number of Public
Servers Needed to Serve 45M
Sites

4
Public SLA
Be Available 99.99999%
Serving a Site – Sunny Day
Browser
http://example.wix.com
HTTP
Request

HTML

Resources /
Media

CDN

Notify
site view
HTTP
Request

LB
Store HTML
to cache

Public

Rendere
r

Archiv
e

Statics
Serving a Site – DC Lost
Browser
http://example.wix.com

CDN

Statics

HTTP
Request

LB

Archiv
e

LB

Public

Public

Rendere
r

Rendere
r

Change DNS
Serving a Site – Public Lost
Browser
http://example.wix.com
HTTP
Request

CDN

HTML
Get
Cached HTML
Version

LB

Public

Rendere
r

Archiv
e

Statics
Living in the Browser
Browser
http://example.wix.com
HTTP
Request

Fallback

Editor

LB

Public

Rendere
r

HTML

JSON /
Media

CDN

Fallback

Archiv
e

Statics
Summary
Identify your critical path and concerns
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
Wix Architecture at Scale - QCon London 2014
Q&A
http://goo.gl/Oo3lGr

Aviran Mordo
Head of Back-End Engineering @ Wix

@aviranm
linkedin.com/in/aviran

aviransplace.com
Wix Architecture at Scale - QCon London 2014

More Related Content

PPTX
Scaling wix to over 50 m users
PPTX
Scaling wix with microservices architecture devoxx London 2015
PPTX
Scaling Wix with microservices architecture and multi-cloud platforms - Reve...
PPTX
Scaling wix with microservices architecture jax london-2015
PPTX
DOs and DONTs on the way to 10M users
PPTX
Scaling wix.com to 100 million users
PPTX
Mircoservices, dev ops and Engineering best practices at Wix.com
PPTX
Scaling up to 30 m users
Scaling wix to over 50 m users
Scaling wix with microservices architecture devoxx London 2015
Scaling Wix with microservices architecture and multi-cloud platforms - Reve...
Scaling wix with microservices architecture jax london-2015
DOs and DONTs on the way to 10M users
Scaling wix.com to 100 million users
Mircoservices, dev ops and Engineering best practices at Wix.com
Scaling up to 30 m users

What's hot (20)

PPTX
Scaling wix to over 70 m users
PPTX
Scaling wix with microservices and multi cloud - 2015
PPTX
Scaling up to 30M users - The Wix Story
PDF
Azure appfabric caching intro and tips
PPTX
The Essentials of Building Cloud-Based Web Apps with Azure
PPT
Shopzilla - Performance By Design
PPTX
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
PPTX
Moving to the Cloud: AWS, Zend, RightScale
PPTX
Cnam cours azure iaas
PPTX
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
PPTX
Cnam cours azure web sites
PPTX
Microsoft Azure Hybrid Cloud - Getting Started For Techies
PPTX
Cnam cours azure cloud services
PPTX
Cnam azure 2015 storage
PPTX
MSDN - Converting an existing ASP.NET application to Windows Azure
PDF
Best Practices for couchDB developers on Microsoft Azure
PPTX
Azure Data Storage
PPTX
Azure services
PDF
Java in the Cloud : PaaS Platforms in Comparison
PDF
Cnam azure ze cloud resource manager
Scaling wix to over 70 m users
Scaling wix with microservices and multi cloud - 2015
Scaling up to 30M users - The Wix Story
Azure appfabric caching intro and tips
The Essentials of Building Cloud-Based Web Apps with Azure
Shopzilla - Performance By Design
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Moving to the Cloud: AWS, Zend, RightScale
Cnam cours azure iaas
From VMs to Containers: Introducing Docker Containers for Linux and Windows S...
Cnam cours azure web sites
Microsoft Azure Hybrid Cloud - Getting Started For Techies
Cnam cours azure cloud services
Cnam azure 2015 storage
MSDN - Converting an existing ASP.NET application to Windows Azure
Best Practices for couchDB developers on Microsoft Azure
Azure Data Storage
Azure services
Java in the Cloud : PaaS Platforms in Comparison
Cnam azure ze cloud resource manager
Ad

Viewers also liked (20)

PPTX
Wix Dev-Centric Culture And Continuous Delivery
PPTX
Optimize Your Wix Website
PPTX
Experimenting on Humans - Advanced A/B Tests - QCon SF 2014
PPTX
5 visual tips for an awesome Wix site
PPTX
SEO: Keywords to Content
PDF
SEO Checklist for my site
PPTX
The Art of A/B Testing
PPTX
Lessons Learned Monitoring Production
PDF
HEA - Technology Enhanced Assessment and Feedback - lessons at scale
PDF
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
PPTX
Road to Continuous Delivery - Wix.com
PPTX
Scaling Wix engineering
PPTX
PPTX
Strategies in continuous delivery
PPTX
Beginner’s Guide to Windows Installer XML (WiX)
PPTX
Visual Studio 2017 Release Notes
PPTX
CES 2017 Top 5 Stories
PPTX
Introduction to HTTP protocol
PPTX
Things you can do in JavaScript ES6 that can't be done in ES5
PDF
The art of decomposing monoliths
Wix Dev-Centric Culture And Continuous Delivery
Optimize Your Wix Website
Experimenting on Humans - Advanced A/B Tests - QCon SF 2014
5 visual tips for an awesome Wix site
SEO: Keywords to Content
SEO Checklist for my site
The Art of A/B Testing
Lessons Learned Monitoring Production
HEA - Technology Enhanced Assessment and Feedback - lessons at scale
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
Road to Continuous Delivery - Wix.com
Scaling Wix engineering
Strategies in continuous delivery
Beginner’s Guide to Windows Installer XML (WiX)
Visual Studio 2017 Release Notes
CES 2017 Top 5 Stories
Introduction to HTTP protocol
Things you can do in JavaScript ES6 that can't be done in ES5
The art of decomposing monoliths
Ad

Similar to Wix Architecture at Scale - QCon London 2014 (20)

PPTX
From 0 to 60 million users scaling with microservices and multi cloud archite...
PPTX
Architecting Cloudy Applications
PPT
Running a Megasite on Microsoft Technologies
PPTX
Azure: Lessons From The Field
PPT
Spring 2007 SharePoint Connections Oleson Advanced Administration and Plannin...
PPT
CloudLab: A File System Friendly Key Value Store
PPTX
WEBINAR: Architectures for Digital Transformation and Next-Generation Systems...
PPTX
Windows Azure: Lessons From The Field
PDF
[db tech showcase OSS 2017] A25: Replacing Oracle Database at DBS Bank by Mar...
PDF
[db tech showcase OSS 2017] A23: Analytics with MariaDB ColumnStore by MariaD...
PDF
Introduction of MariaDB AX / TX
PPTX
AJAX for Scalability
PPTX
Ajax For Scalability
PDF
Keynote – When Open Source Meets the Enterprise
PPTX
Building Scalable .NET Web Applications
PDF
Internet Explorer 8
PPT
Dot Net Nuke Presentation
PPTX
Understanding The Azure Platform November 09
PPTX
Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978
PPTX
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...
From 0 to 60 million users scaling with microservices and multi cloud archite...
Architecting Cloudy Applications
Running a Megasite on Microsoft Technologies
Azure: Lessons From The Field
Spring 2007 SharePoint Connections Oleson Advanced Administration and Plannin...
CloudLab: A File System Friendly Key Value Store
WEBINAR: Architectures for Digital Transformation and Next-Generation Systems...
Windows Azure: Lessons From The Field
[db tech showcase OSS 2017] A25: Replacing Oracle Database at DBS Bank by Mar...
[db tech showcase OSS 2017] A23: Analytics with MariaDB ColumnStore by MariaD...
Introduction of MariaDB AX / TX
AJAX for Scalability
Ajax For Scalability
Keynote – When Open Source Meets the Enterprise
Building Scalable .NET Web Applications
Internet Explorer 8
Dot Net Nuke Presentation
Understanding The Azure Platform November 09
Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978
Designing a Scalable Twitter - Patterns for Designing Scalable Real-Time Web ...

More from Aviran Mordo (6)

PDF
Platform as a Runtime - PaaR QCON 2024 - Final
PPTX
Scaling Engineering by Hacking Conway’s Law - Geecon,2022
PDF
Arrested by the cap devoxx uk 2018
PPTX
Advanced A/B Testing - Jax London 2015
PPTX
Wix.com Back-end Engineering Guild Manifesto
PPTX
Scaling r&d org while maintaining quality
Platform as a Runtime - PaaR QCON 2024 - Final
Scaling Engineering by Hacking Conway’s Law - Geecon,2022
Arrested by the cap devoxx uk 2018
Advanced A/B Testing - Jax London 2015
Wix.com Back-end Engineering Guild Manifesto
Scaling r&d org while maintaining quality

Recently uploaded (20)

PPTX
Spectroscopy.pptx food analysis technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
KodekX | Application Modernization Development
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Electronic commerce courselecture one. Pdf
Spectroscopy.pptx food analysis technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
cuic standard and advanced reporting.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
The AUB Centre for AI in Media Proposal.docx
Understanding_Digital_Forensics_Presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
The Rise and Fall of 3GPP – Time for a Sabbatical?
Reach Out and Touch Someone: Haptics and Empathic Computing
KodekX | Application Modernization Development
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Review of recent advances in non-invasive hemoglobin estimation
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
MYSQL Presentation for SQL database connectivity
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Electronic commerce courselecture one. Pdf

Wix Architecture at Scale - QCon London 2014

  • 1. Wix Architecture at Scale Aviran Mordo Head of Back-End Engineering @ Wix @aviranm linkedin.com/in/aviran aviransplace.com
  • 3. Wix in Numbers Over 45,000,000 users 1M new users/month Static storage is >800TB of data 1.5TB new files/day 3 data centers + 2 clouds (Google, Amazon) 300 servers 700M HTTP requests/day 600 people work at Wix, of which ~ 200 in R&D
  • 4. Initial Architecture Tomcat, Hibernate, custom web framework Built for fast development Stateful login (Tomcat session), Ehcache, file uploads No consideration for performance, scalability and testing Intended for short-term use Lighttpd (file serving) Wix (Tomcat) MySQL DB
  • 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
  • 7. Concerns and SLA Edit websites Data Validation Security / Authentication Data consistency Lots of data View sites, created by Wix editor High availability Serving Media High availability High performance High performance High traffic volume Lots of static files Long tail Very high traffic volume Viewport optimization Cacheable data
  • 8. Wix Segmentation Networking 1. Editor Segment 2. Media Segment 3. Public Segment
  • 9. Making SOA Guidelines Each service has its own database (if one is needed) Only one service can write to a specific DB 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
  • 11. Editor Server Immutable JSON pages (~2.5M / day) Site revisions Active – standby MySQL cross datacenters Editor Server MySQL Active Sites MySQL Archive
  • 13. Protect The Data Protect against DB outage with fast recovery = replication Protect against data poisoning/corruption = revisions / backup Make the data available at all times = data distribution to multiple locations / providers
  • 14. Saving Editor Data Browser Save Page(s) 200 OK Editor Server Upload Static Grid Notify Save Page MySQL Active Sites MySQL Archive DC replication MySQL Active Sites MySQL Archive Download Page Notify Archive (Google) Google Cloud Storage Archive (Amazon)
  • 15. Self Healing Process Browser Save Page(s) 200 OK Editor Server Upload Static Grid Notify Save Page MySQL Active Sites MySQL Archive DC replication MySQL Active Sites MySQL Archive Download Page Notify Archive (Google) Google Cloud Storage Archive (Amazon)
  • 16. 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
  • 18. Prospero – Wix Media Storage 800TB user media files 3M files uploaded daily 500M metadata records Dynamic media processing • Picture resize, crop and sharpen “on the fly” • Watermark • Audio format conversion
  • 19. Prospero Eventual consistent distributed file system Multi datacenter aware Automatic fallback cross DC Run on commodity servers & cloud
  • 20. Prospero – Wix Media Manager Tampa Google Cloud x36 x36 T x32 T Second fallback First fallback Austin CDN get image.jpg If not in CDN x36 x36 T x32 T
  • 22. Public Segment Roles Routing (resolve URLs) www.example.com HTML Renderer Dispatching (to a renderer) HTML SEO Renderer Flash SEO Renderer Flash Renderer Sitemap Renderer Robots.txt Renderer Rendering (HTML,XML,TXT) Public Server
  • 23. Public SLA Response time <100ms at peak traffic
  • 24. Publish A Site Publish site header (a map of pages for a site) Publish routing table Publish site header / routes Editor Segment Public Segment
  • 25. Built For Speed Minimize out-of-service hops (2 DB, 1 RPC) Lookup tables are cached in memory, updated every 5 minutes Denormalized data – optimize for read by primary key (MySQL) Minimize business logic
  • 26. 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
  • 27. Offload rendering work to the browser
  • 28. The average Intel Core i750 can push up to 7 GFLOPS without overclocking
  • 29. 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 (just deploy a new client code)
  • 30. Minimum Number of Public Servers Needed to Serve 45M Sites 4
  • 32. Serving a Site – Sunny Day Browser http://example.wix.com HTTP Request HTML Resources / Media CDN Notify site view HTTP Request LB Store HTML to cache Public Rendere r Archiv e Statics
  • 33. Serving a Site – DC Lost Browser http://example.wix.com CDN Statics HTTP Request LB Archiv e LB Public Public Rendere r Rendere r Change DNS
  • 34. Serving a Site – Public Lost Browser http://example.wix.com HTTP Request CDN HTML Get Cached HTML Version LB Public Rendere r Archiv e Statics
  • 35. Living in the Browser Browser http://example.wix.com HTTP Request Fallback Editor LB Public Rendere r HTML JSON / Media CDN Fallback Archiv e Statics
  • 36. Summary Identify your critical path and concerns 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
  • 38. Q&A http://goo.gl/Oo3lGr Aviran Mordo Head of Back-End Engineering @ Wix @aviranm linkedin.com/in/aviran aviransplace.com

Editor's Notes

  • #3: How many built a website?
  • #11: Editor – Read immediately after write – Small working setViewer optimize for readsWe fight for every ms. Page view = many resource downloading
  • #13: Read-only services only if it is part of the same business functionality
  • #15: Immutable data helps handle eventual consistencyMySql is a great key-value storeNot all data is equal (only 6% of websites are edited 3 months after creation)
  • #17: Revision keep data safe from poisoning Pay in storage and management
  • #22: Highly optimized code – every ms count
  • #23: 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.
  • #24: We can change the arrows as we want
  • #28: Save pages on JSONUpload to static storage
  • #36: Explain what is JSON and what is HTML
  • #37: UPS dies, secondary power source connected to the same UPS
  • #38: Due to error or bad configuration