SlideShare ist ein Scribd-Unternehmen logo
1 von 39
Wix Architecture at Scale

Aviran Mordo
Head of Back-End Engineering @ Wix

@aviranm
linkedin.com/in/aviran

aviransplace.com
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
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
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

Weitere ähnliche Inhalte

Was ist angesagt?

Scaling wix to over 70 m users
Scaling wix to over 70 m usersScaling wix to over 70 m users
Scaling wix to over 70 m users
Yoav Avrahami
 
Moving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScaleMoving to the Cloud: AWS, Zend, RightScale
Moving to the Cloud: AWS, Zend, RightScale
mmoline
 

Was ist angesagt? (20)

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

Andere mochten auch

Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.comAdvanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
Advanced A/B Testing at Wix - Aviran Mordo and Sagy Rozman, Wix.com
DevOpsDays Tel Aviv
 
Strategies in continuous delivery
Strategies in continuous deliveryStrategies in continuous delivery
Strategies in continuous delivery
Aviran Mordo
 

Andere mochten auch (20)

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

Ähnlich wie Wix Architecture at Scale - QCon London 2014

From 0 to 60 million users scaling with microservices and multi cloud archite...
From 0 to 60 million users scaling with microservices and multi cloud archite...From 0 to 60 million users scaling with microservices and multi cloud archite...
From 0 to 60 million users scaling with microservices and multi cloud archite...
JAXLondon_Conference
 
AJAX for Scalability
AJAX for ScalabilityAJAX for Scalability
AJAX for Scalability
Tuenti
 
Building Scalable .NET Web Applications
Building Scalable .NET Web ApplicationsBuilding Scalable .NET Web Applications
Building Scalable .NET Web Applications
Buu Nguyen
 

Ähnlich wie Wix Architecture at Scale - QCon London 2014 (20)

From 0 to 60 million users scaling with microservices and multi cloud archite...
From 0 to 60 million users scaling with microservices and multi cloud archite...From 0 to 60 million users scaling with microservices and multi cloud archite...
From 0 to 60 million users scaling with microservices and multi cloud archite...
 
Architecting Cloudy Applications
Architecting Cloudy ApplicationsArchitecting Cloudy Applications
Architecting Cloudy Applications
 
Running a Megasite on Microsoft Technologies
Running a Megasite on Microsoft TechnologiesRunning a Megasite on Microsoft Technologies
Running a Megasite on Microsoft Technologies
 
Azure: Lessons From The Field
Azure: Lessons From The FieldAzure: Lessons From The Field
Azure: Lessons From The Field
 
Spring 2007 SharePoint Connections Oleson Advanced Administration and Plannin...
Spring 2007 SharePoint Connections Oleson Advanced Administration and Plannin...Spring 2007 SharePoint Connections Oleson Advanced Administration and Plannin...
Spring 2007 SharePoint Connections Oleson Advanced Administration and Plannin...
 
CloudLab: A File System Friendly Key Value Store
CloudLab: A File System Friendly Key Value StoreCloudLab: A File System Friendly Key Value Store
CloudLab: A File System Friendly Key Value Store
 
WEBINAR: Architectures for Digital Transformation and Next-Generation Systems...
WEBINAR: Architectures for Digital Transformation and Next-Generation Systems...WEBINAR: Architectures for Digital Transformation and Next-Generation Systems...
WEBINAR: Architectures for Digital Transformation and Next-Generation Systems...
 
Getting Started with Amazon Redshift
Getting Started with Amazon RedshiftGetting Started with Amazon Redshift
Getting Started with Amazon Redshift
 
Windows Azure: Lessons From The Field
Windows Azure: Lessons From The FieldWindows Azure: Lessons From The Field
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] A25: Replacing Oracle Database at DBS Bank by Mar...[db tech showcase OSS 2017] A25: Replacing Oracle Database at DBS Bank by Mar...
[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...
[db tech showcase OSS 2017] A23: Analytics with MariaDB ColumnStore by MariaD...[db tech showcase OSS 2017] A23: Analytics with MariaDB ColumnStore by MariaD...
[db tech showcase OSS 2017] A23: Analytics with MariaDB ColumnStore by MariaD...
 
Introduction of MariaDB AX / TX
Introduction of MariaDB AX / TXIntroduction of MariaDB AX / TX
Introduction of MariaDB AX / TX
 
AJAX for Scalability
AJAX for ScalabilityAJAX for Scalability
AJAX for Scalability
 
Ajax For Scalability
Ajax For ScalabilityAjax For Scalability
Ajax For Scalability
 
Keynote – When Open Source Meets the Enterprise
Keynote – When Open Source Meets the EnterpriseKeynote – When Open Source Meets the Enterprise
Keynote – When Open Source Meets the Enterprise
 
Building Scalable .NET Web Applications
Building Scalable .NET Web ApplicationsBuilding Scalable .NET Web Applications
Building Scalable .NET Web Applications
 
Internet Explorer 8
Internet Explorer 8Internet Explorer 8
Internet Explorer 8
 
Dot Net Nuke Presentation
Dot Net Nuke PresentationDot Net Nuke Presentation
Dot Net Nuke Presentation
 
Understanding The Azure Platform November 09
Understanding The Azure Platform   November 09Understanding The Azure Platform   November 09
Understanding The Azure Platform November 09
 
Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978
Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978
Building Highly Scalable Java Applications on Windows Azure - JavaOne S313978
 

Mehr von Aviran Mordo

Mehr von Aviran Mordo (6)

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

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

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
  • 2.
  • 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
  • 12.
  • 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
  • 37.
  • 38. Q&A http://goo.gl/Oo3lGr Aviran Mordo Head of Back-End Engineering @ Wix @aviranm linkedin.com/in/aviran aviransplace.com

Hinweis der Redaktion

  1. How many built a website?
  2. Editor – Read immediately after write – Small working setViewer optimize for readsWe fight for every ms. Page view = many resource downloading
  3. Read-only services only if it is part of the same business functionality
  4. 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)
  5. Revision keep data safe from poisoning Pay in storage and management
  6. Highly optimized code – every ms count
  7. 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.
  8. We can change the arrows as we want
  9. Save pages on JSONUpload to static storage
  10. Explain what is JSON and what is HTML
  11. UPS dies, secondary power source connected to the same UPS
  12. Due to error or bad configuration