Refacoring vs Rewriting WixStores
-
Upload
doron-rosenstock -
Category
Software
-
view
207 -
download
1
Transcript of Refacoring vs Rewriting WixStores
AgendaPart I
Overview of old system
Problems with the old system
Refactoring vs rewriting
Part II
Problems and solutions
Part III
Lessons learned
3
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
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?
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
Micro-servicesEach 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?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-ServicesError handling and log tracing in the cluster
Synced micro-services (WIP)
Configuration of micro-services (WIP)
Backward and forward compatibility design
PRODUCT’
Backward and forward compatibility
Service1 V1 Service2 V1PRODUCT
Service1 V2
PRODUCT
Service2 V2
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$“
Lessons Learned about Event SourcingParadigm 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?
Lessons Learned about CQRSAgain - Code complexity
Self-healing
DevOps - two DB’s (Mysql + Mongo)
Performance
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 ReadingMicro-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
http://engineering.wix.com