SlideShare a Scribd company logo
Wix eCommerce Case Study
Refactoring vs Rewriting
Doron Rosenstock
doron@wix.com
What is Wix?
What is WixStores?
Agenda
Part I
Overview of old system
Problems with the old system
Refactoring vs rewriting
Part II
Problems and solutions
Part III
Lessons learned
3
PART I
Wix eCommerce
aka the “old system”
Architecture
One monolithic server
Magento as a base
Written in PHP
MySql DB
Redis Cache
Some Numbers
~1M stores
Over 5M http requests per day
Average response time of ~300 ms
2 data centers + 1 cloud (AWS)
Couple of seconds for store provision
The Good
Stable system
Mature product
Lots of satisfied customers
Domain knowledge
Sounds good right?
Refacoring vs Rewriting WixStores
Refacoring vs Rewriting WixStores
?
MONOLITH
SERVER
CAN’T SCALE
LOW DEV
VELOCITY
DEAD
TECHNOLOGY
Rewriting?Refactoring?
Pros
Will continue to deliver
Only critical sections fixed
Cons
Stuck with dead tech
Still different stack than Wix
Rewriting?
Refactoring?
Pros
If done correctly, solves old
system’s problems
Cons
Product freeze for 6 months
Might fail
Pros
Will continue to deliver
Only critical sections fixed
Cons
Stuck with dead tech
Still different stack than Wix
Rewriting?Refactoring?
Refacoring vs Rewriting WixStores
Refacoring vs Rewriting WixStores
PART II
aka the “new system”
The Problem:
Monolithic Server
What’s the problem with Mono-server?
One server to rule them all - single point of failure
Dependency between unrelated features
Need to deploy the entire system each time
What’s the problem with Mono-server?
One server to rule them all - single point of failure
Dependency between unrelated features
Need to deploy the entire system each time
Monolithic Server
Micro-services
Each microservice is relatively small
Each service can be deployed
independently of other services
Easier to scale development
Improved fault isolation
Each service can be developed and
deployed independently
Eliminates any long-term commitment
to a technology stack
Did we solve our problems?
Did we solve our problems?
One server to rule them all - single point of failure
Dependency between unrelated features
Need to deploy the entire system each time
Did we solve our problems?
One server to rule them all - single point of failure
Dependency between unrelated features
Need to deploy the entire system each time
Lessons Learned about Micro-Services
Error handling and log tracing in the cluster
Synced micro-services (WIP)
Configuration of micro-services (WIP)
Backward and forward compatibility design
Backward and forward compatibility
Service1 V1 Service2 V1
Backward and forward compatibility
Service1 V1 Service2 V1PRODUCT
Backward and forward compatibility
Service1 V1 Service2 V1PRODUCT
Service1 V2
Backward and forward compatibility
Service1 V1 Service2 V1PRODUCT
Service1 V2
PRODUCT
Backward and forward compatibility
Service2 V1
Service1 V2
PRODUCT
Backward and forward compatibility
Service2 V1
Service1 V2
PRODUCT
Service2 V2
PRODUCT’
Backward and forward compatibility
Service2 V1
Service1 V2
PRODUCT
Service2 V2
PRODUCT’
Backward and forward compatibility
Service1 V2 Service2 V2
Backward and forward compatibility
Service1 V1 Service2 V1
Backward and forward compatibility
Service1 V1 Service2 V1PRODUCT
Backward and forward compatibility
Service1 V1 Service2 V1PRODUCT
Service1 V2
Backward and forward compatibility
Service1 V1 Service2 V1PRODUCT
Service1 V2
PRODUCT
Backward and forward compatibility
Service1 V1 Service2 V1PRODUCT
Service1 V2
PRODUCT
Service2 V2
PRODUCT’
Backward and forward compatibility
Service1 V1 Service2 V1PRODUCT
Service1 V2
PRODUCT
Service2 V2
The Problem:
Dev Velocity
Web App DBClient
Traditional CRUD
Web App DBClient
Traditional CRUD
upadteProduct
PRODUCT
Web App DBClient
Traditional CRUD
upadteProduct
PRODUCT
Web App DBClient
Traditional CRUD
getProduct
PRODUCT
Web App DBClient
Traditional CRUD
getProduct
PRODUCT
someCommand
Event Sourcing
Web App DBClient
COMMAND
someCommand
Event Sourcing
Command = “Change product X price to 3$“
Web App DBClient
COMMAND
someCommand
Event Sourcing
Command = “Change product X price to 3$“
Web App DBClient
COMMAND
someCommand
Event Sourcing
Command = “Change product X price to 3$“
Web App DBClient
COMMANDEVENT
event = “Product X price was changed to 3$“
someCommand
Event Sourcing
Command = “Change product X price to 3$“
Web App DBClient
EVENT
event = “Product X price was changed to 3$“
Event Sourcing
Web App DBClient
EVENT
EVENT
EVENT
getProduct
Event Sourcing
Web App DBClient
EVENT
EVENT
EVENT
getProduct
Event Sourcing
Web App DBClient
EVENT
EVENT
EVENT
getProduct
Event Sourcing
Web App DBClient
VIEW
getProduct
Event Sourcing
Web App DBClient
VIEW
Event Sourcing @ WixStores
Flexible
Immutable
Stateless
DB view
Refacoring vs Rewriting WixStores
Lessons Learned about Event Sourcing
Paradigm shifts - convincing the team…
Code complexity
Invest time in your framework - it will pay up
Solves backward and forward compatibly problem
DB size - space problem?
getProduct
Web App DBClient
EVENT
EVENT
EVENT
Web App
Events DB
Client
EVENT
EVENT
EVENT
getProduct
Web App
Events DB
Client
EVENT
EVENT
EVENT
getProduct
Web App
Events DB
Client
EVENTEVENTEVENT
getProduct
Web App
Events DB
Client
VIEWVIEW
getProduct
Web App
Events DB
Client
VIEW
SnapShots
VIEW
getProduct
Web App
Events DB
Client
VIEW
SnapShots
VIEW
Command Query Responsibility Segregation
@WixStores
SLA concerns:
Strong
consistency vs
Eventual
consistency
Viewer vs
Editor
Lessons Learned about CQRS
Again - Code complexity
Self-healing
DevOps - two DB’s (Mysql + Mongo)
Performance
Refacoring vs Rewriting WixStores
So…
When should we stop and think?
CQRS
CUTTING EDGE
TECHNOLOGY
!
MICRO-SERVICES EVENT-SOURCED
LOW DEV
VELOCITY
DEAD
TECHNOLOGY
MONOLITH
SERVER
CAN’T SCALE
?
CQRS
CUTTING EDGE
TECHNOLOGY
!
MICRO-SERVICES EVENT-SOURCED
LOW DEV
VELOCITY
DEAD
TECHNOLOGY
MONOLITH
SERVER
CAN’T SCALE
?
Extra Reading
Micro-Services:
http://www.slideshare.net/aviranwix/scaling-wix-with-microservices-architecture
http://martinfowler.com/articles/microservices.html
CQRS:
http://www.udidahan.com/2009/12/09/clarified-cqrs/
Event Sourcing:
http://martinfowler.com/eaaDev/EventSourcing.html
http://blog.confluent.io/2015/01/29/making-sense-of-stream-processing/
http://esrad.org/
Questions?
il.linkedin.com/in/dorosen
doron@wix.com
http://engineering.wix.com

More Related Content

PDF
Continuously Integrating Distributed Code at Netflix
PDF
Principles of microservices velocity
PPTX
0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...
PDF
From Monoliths to Microservices at Realestate.com.au
PPTX
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...
PDF
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
PPTX
How to Implement Hybrid Cloud Solutions Successfully
PPTX
A Guide to Event-Driven SRE-inspired DevOps
Continuously Integrating Distributed Code at Netflix
Principles of microservices velocity
0Flake - Reaching reliable non-flaky tests - Itai Friendinger - DevOpsDays Te...
From Monoliths to Microservices at Realestate.com.au
WinOps Conf 2016 - Gael Colas - Configuration Management Theory: Why Idempote...
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
How to Implement Hybrid Cloud Solutions Successfully
A Guide to Event-Driven SRE-inspired DevOps

What's hot (18)

PDF
API Gateway How-To: The Many Ways to Apply the Gateway Pattern
PDF
Bringing Server Add-ons to the Cloud and Back Again
PDF
Next-Generation Cloud Native Apps with Spring Cloud and Kubernetes
PDF
Five (easy?) Steps Towards Continuous Delivery
PPTX
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
PDF
Modern Operations at Scale within Viasat – How to Structure Teams and Build A...
PDF
Deploying and Testing Microservices
PDF
Server Add-ons for Front-end Developers
PDF
Atlassian Connect on Serverless Platforms: Low Cost Add-Ons
PPTX
Speed-up Your Big Data Applications with Sencha and Speedment
PPTX
AWS Summit - Trends in Advanced Monitoring for AWS environments
PPTX
Monitoring as a Self-Service in Atlassian DevOps Toolchain
PDF
Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...
PDF
Size as an Advantage: How Big Enterprises Can Move Fast
PPTX
Deploying to Production with Your Eyes Open | SeaLights | Jason Wides
PPTX
Jenkins Online Meetup - Automated SLI based Build Validation with Keptn
PDF
The Four Principles of Atlassian Performance Tuning
PPTX
Data Driven DevOps: from Culture to Gamification
API Gateway How-To: The Many Ways to Apply the Gateway Pattern
Bringing Server Add-ons to the Cloud and Back Again
Next-Generation Cloud Native Apps with Spring Cloud and Kubernetes
Five (easy?) Steps Towards Continuous Delivery
DevOps Days Toronto: From 6 Months Waterfall to 1 hour Code Deploys
Modern Operations at Scale within Viasat – How to Structure Teams and Build A...
Deploying and Testing Microservices
Server Add-ons for Front-end Developers
Atlassian Connect on Serverless Platforms: Low Cost Add-Ons
Speed-up Your Big Data Applications with Sencha and Speedment
AWS Summit - Trends in Advanced Monitoring for AWS environments
Monitoring as a Self-Service in Atlassian DevOps Toolchain
Creating Polyglot Communication Between Kubernetes Clusters and Legacy System...
Size as an Advantage: How Big Enterprises Can Move Fast
Deploying to Production with Your Eyes Open | SeaLights | Jason Wides
Jenkins Online Meetup - Automated SLI based Build Validation with Keptn
The Four Principles of Atlassian Performance Tuning
Data Driven DevOps: from Culture to Gamification
Ad

Viewers also liked (6)

PPTX
Building The Wix SDK
PDF
Wix - NOAH12 London
PPTX
5 visual tips for an awesome Wix site
PPTX
Scaling Wix with microservices architecture and multi-cloud platforms - Reve...
PPTX
Scaling wix with microservices architecture devoxx London 2015
KEY
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
Building The Wix SDK
Wix - NOAH12 London
5 visual tips for an awesome Wix site
Scaling Wix with microservices architecture and multi-cloud platforms - Reve...
Scaling wix with microservices architecture devoxx London 2015
jQTouch – Mobile Web Apps with HTML, CSS and JavaScript
Ad

Similar to Refacoring vs Rewriting WixStores (20)

PPTX
DOs and DONTs on the way to 10M users
PPTX
Architecting Microservices in .Net
PDF
Presentation business critical applications in a virtual env
PDF
Presentation business critical applications in a virtual env
PPTX
Accelerate application delivery with docker containers and windows server 2016
PPTX
vFabric for i ISVs and MSPs
PDF
Evolution of Microservices - Craft Conference
PPTX
Decomposing the Monolith (Riga Dev Days 2019)
PPTX
Build Web Applications using Microservices on Node.js and Serverless AWS
PPTX
Virtualising Tier 1 Apps
PPTX
Refactoring to Microservices
PDF
Performance and Scalability Art of Isomorphic React Applications
PPTX
Microservices Architecture for MEAN Applications using Serverless AWS
PPTX
PDF
Dockercon State of the Art in Microservices
PPT
Democratizing the Cloud with Open Source Cloud Development
PPTX
Reduce Risk with End to End Monitoring of Middleware-based Applications
PDF
VMware Developer-Ready Transformation
PDF
Goto meetup Stockholm - Let your microservices flow
PDF
Crossroads of Asynchrony and Graceful Degradation
DOs and DONTs on the way to 10M users
Architecting Microservices in .Net
Presentation business critical applications in a virtual env
Presentation business critical applications in a virtual env
Accelerate application delivery with docker containers and windows server 2016
vFabric for i ISVs and MSPs
Evolution of Microservices - Craft Conference
Decomposing the Monolith (Riga Dev Days 2019)
Build Web Applications using Microservices on Node.js and Serverless AWS
Virtualising Tier 1 Apps
Refactoring to Microservices
Performance and Scalability Art of Isomorphic React Applications
Microservices Architecture for MEAN Applications using Serverless AWS
Dockercon State of the Art in Microservices
Democratizing the Cloud with Open Source Cloud Development
Reduce Risk with End to End Monitoring of Middleware-based Applications
VMware Developer-Ready Transformation
Goto meetup Stockholm - Let your microservices flow
Crossroads of Asynchrony and Graceful Degradation

Recently uploaded (20)

PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Transform Your Business with a Software ERP System
PDF
Understanding Forklifts - TECH EHS Solution
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Introduction to Artificial Intelligence
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
medical staffing services at VALiNTRY
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Digital Strategies for Manufacturing Companies
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
CHAPTER 2 - PM Management and IT Context
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Odoo POS Development Services by CandidRoot Solutions
Which alternative to Crystal Reports is best for small or large businesses.pdf
Transform Your Business with a Software ERP System
Understanding Forklifts - TECH EHS Solution
PTS Company Brochure 2025 (1).pdf.......
Introduction to Artificial Intelligence
Design an Analysis of Algorithms I-SECS-1021-03
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Odoo Companies in India – Driving Business Transformation.pdf
Nekopoi APK 2025 free lastest update
Wondershare Filmora 15 Crack With Activation Key [2025
medical staffing services at VALiNTRY
How to Migrate SBCGlobal Email to Yahoo Easily
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Digital Strategies for Manufacturing Companies
ManageIQ - Sprint 268 Review - Slide Deck
Design an Analysis of Algorithms II-SECS-1021-03
CHAPTER 2 - PM Management and IT Context
Lecture 3: Operating Systems Introduction to Computer Hardware Systems

Refacoring vs Rewriting WixStores