SlideShare a Scribd company logo
The Wix Microservice
Stack
Tomer Gabel, Wix
March 2017 @ Dnipro, UA
Agenda
1. Topology
2. Networking
3. Structure
4. Operations
5. Beer
Our conceptual system
Store Service
Checkout
Service
Cart Service
1. TOPOLOGY
Image: Penrose Steps by Alex Eylar (CC BY-NC-SA 2.0)
Our conceptual system
Store Service
Checkout
Service
Cart Service
Host A
Host B Host C
Topology
Topology
Service→
host
mapping
Server
inventory
Service
catalogue
Formally,
“scheduling”
Service Scheduling
• A hard problem!
• Multiple dimensions:
– Resource utilization
(disk space, I/O, RAM,
network, power…)
– Resource availability
– Failover
(physical server, rack, row…)
– Custom constraints
(zoning, e.g. PCI compliance)
Service Scheduling
• A hard problem!
• Multiple dimensions:
– Resource utilization
(disk space, I/O, RAM,
network, power…)
– Resource availability
– Failover
(physical server, rack, row…)
– Custom constraints
(zoning, e.g. PCI compliance)
Service Scheduling
• The middle ground:
– Naïve automatic
scheduler
– Human-configured
overrides for zoning,
optimization
• Easy but limited scale
– A few hundred servers
Our conceptual system
Store Service
Checkout
Service
Cart Service
http://err:42/uh
… derp?
Service Discovery
Static Dynamic
Logical
Physical
That way
madness lies
Service Discovery
Static Dynamic
Logical
Physical
Service Discovery
Static Dynamic
Logical
Physical
In practice
• Static topology
– Managed with Frying Pan
– Exported to Chef
– Deployed via
configuration files
• Live registry in
Zookeeper
– Deployment only
– … for now
2. NETWORKING
Image: Neurons by Birth Into Being (CC BY-NC-SA 2.0)
Back to diagrams
Store Service
Checkout
Service
Cart Service
Back to diagrams
Store Service
Checkout
Service
Cart Service
Protocol
Protocol
• RPC-style
– Sync or async
– Point-to-point
• Message passing
– Async only
– Requires broker
Shared
Concerns
Topology Serialization Operations
Protocol
• Wix RPC
– RPC-style
– Custom JSON
– HTTP
• Pros/cons
– Rock-solid
– Sync/blocking
– Legacy
Image: psycho chicken by Bernhard Latzko (CC BY-ND 2.0)
Protocol
• Greyhound
–Message-passing
–Custom JSON
–Kafka
• Pros/cons
–Async + replayable
–Still experimental
Image: Robin Fledgeling by edgeplot (CC BY-NC-SA 2.0)
Load balancing
• Centralized
– Simple
– Limited flexibility
– Limited scale
– Thin implementation
 highly portable
– Suitable for static
topologies
• Distributed
– Highly scalable
– Flexible
– Fully dynamic
– Fat implementation
 difficult to port
• Quasi-distributed
– e.g. Synapse
– Best of both worlds?
Load balancing
• Centralized
– Simple
– Limited flexibility
– Limited scale
– Thin implementation
 highly portable
– Suitable for static
topologies
• Distributed
– Highly scalable
– Flexible
– Fully dynamic
– Fat implementation
 difficult to port
• Quasi-distributed
– e.g. Synapse
– Best of both worlds?
Frying Pan
 Chef
 Nginx
To our shame
• There’s always IDL.
• Informal
– Text documentation
– Code samples
• Formal
– Swagger, Apiary etc.
– ProtoBuf, Thrift, Avro
– WSDL, god forbid!
• … or
– Ad-hoc
public interface SiteMembersService {
SiteMemberDto getMemberById(
Guid<SiteMember> memberId,
UserGuid userId);
SiteMemberDto getMemberOrOwnerById(
Guid<SiteMember> memberId,
Guid<SMCollection> collectionId);
SiteMemberDto getMemberDtoByEmailAndCollectionId(
String email,
Guid<SMCollection> collectionId);
List<SiteMemberDto> listMembersByCollectionId(
Guid<SMCollection> collectionId);
}
To our shame
• There’s always IDL.
• Informal
– Text documentation
– Code samples
• Formal
– Swagger, Apiary etc.
– ProtoBuf, Thrift, Avro
– WSDL, god forbid!
• … or
– Ad-hoc
public interface SiteMembersService {
SiteMemberDto getMemberById(
Guid<SiteMember> memberId,
UserGuid userId);
SiteMemberDto getMemberOrOwnerById(
Guid<SiteMember> memberId,
Guid<SMCollection> collectionId);
SiteMemberDto getMemberDtoByEmailAndCollectionId(
String email,
Guid<SMCollection> collectionId);
List<SiteMemberDto> listMembersByCollectionId(
Guid<SMCollection> collectionId);
}
In Detail
• Java interfaces?
+ Ridiculously simple
+ Lend well to RPC
– Coupled to JVM
• JSON serialization
+ Jackson-based
+ Custom, extensible
mapping
– Reflection-based
• Server stack (JVM)
– Jetty
– Spring + Spring MVC
– Custom handler
• RPC client stack (JVM)
– Spring
– Proxy classes
generated at runtime
– AsyncHttpClient
In Detail
• Java interfaces?
+ Ridiculously simple
+ Lend well to RPC
– Coupled to JVM
• JSON serialization
+ Jackson-based
+ Custom, extensible
mapping
– Reflection-based
• Alternative stack
– Based on Node.js
– Generated RPC clients
– Manually-converted
entity schema :-(
In Detail
• Java interfaces?
+ Ridiculously simple
+ Lend well to RPC
– Coupled to JVM
• JSON serialization
+ Jackson-based
+ Custom, extensible
mapping
– Reflection-based
• Alternative stack
– Based on Node.js
– Generated RPC clients
– Manually-converted
entity schema :-(
Cascade Failures
• What is a
cascade failure?
• Mitigations
– Bulkheading
– Circuit breakers
– Load shedding
• We don’t do any
of that (mostly)
Does it go?
• Short answer: yes.
• Battle-tested
– Evolving since 2010.
– >200 services in
production.
• Known quantity
– Easy to operate
– Performs well enough
– Known workarounds
Not all is well, though
• Polyglot development
– Custom client stack
– Expensive to port!
Not all is well, though
• Polyglot development
– Custom client stack
– Expensive to port!
• Implicit state
– Transparently handled
by the framework
– Thread local storage
– Hard to go async!
Client Proxy
Service A
Service B
Session info
Session info
Transaction ID
Session info
Transaction ID
A/B experiment
Transaction ID
A/B experiment
3. STRUCTURE
Codebase modeling
• A product comprises
multiple services
• Services have
dependencies
– Creating a DAG
– Tends to cluster
around domains
• Org structure reflects
the clustering
(Conway)
Codebase modeling
Repository-per-domain
• Small repositories
• Artifacts built
independently
• Binary dependencies
• Requires specialized tools
to manage:
– Versions
– Build dependencies
Monorepo
• Repository contains
everything
• Code is built atomically
• Source dependencies
• Requires a specialized
build tool
At Wix
• One repo per domain
• Dependencies:
– Declared in POMs
– Version management
via custom plugin
– Builds managed by
custom tool*
• Custom dashboard,
“Wix Lifecycle”
* Lifecycle – Dependency Management Algorithm
Version management
[INFO] QuickRelease
/home/builduser/agent01/work/d9922a1c87aee4bb
bf1bc8bcfb2eccebc4268651c5f19faa689be6e4
[08:10:55][INFO] Adding tag RC;.;1.20.0
[08:10:56][INFO] Tag RC;.;1.20.0 added
successfully
[08:10:56][INFO] Working on onboarding-server-web
[08:10:56][INFO] onboarding-server-web-1.19.0-
SNAPSHOT jar deployable copied
[08:10:56][INFO] onboarding-server-web-1.19.0-
SNAPSHOT jar sources copied
[08:10:56][INFO] onboarding-server-web-1.19.0-
SNAPSHOT jar copied
[08:10:56][INFO] onboarding-server-web-1.19.0-
SNAPSHOT jar tests copied
[08:10:56][INFO] onboarding-server-web pom
deployed
[08:10:57][INFO] Deploying artifacts to release
artifacts repository
[08:10:57][INFO] Deploying onboarding-server-web
to RELEASE
[08:10:57][INFO] pushing new pom
[08:10:59]2016-02-22 08:10:39 [INFO ] /usr/bin/git
push --tag origin master exitValue = 0
• All artifacts share a
common parent
– Master list of versions
• Manually-triggered
release builds
– Custom release plugin
– Increments version
– Updates master
– Pushes changes to git
4. OPERATIONS
Back to diagrams
Store Service
Checkout
Service
Cart Service
How ya
doin’?
Health
• Host monitoring
– Sensu alerts
– Usual host metrics
– Health-check endpoint
in framework
• End-to-end
– Pingdom
• Business
– Custom BI toolchain
Instrumentation
• Metrics
– DropWizard Metrics
– Graphite and Anodot
– Built-in metrics (RPC,
resource pools…)
– APIs for custom
metrics
• Alerts
– Anodot, NewRelic
– Via PagerDuty
Debugging
• Logs
– Good old Logback
– No centralized
aggregation
– Not particularly useful
• Feature toggle
overrides
• Distributed tracing
WE’RE DONE HERE!
… AND YES, WE’RE HIRING :-)
Thank you for listening
tomer@tomergabel.com
@tomerg
http://il.linkedin.com/in/tomergabel
Wix Engineering blog:
http://engineering.wix.com

More Related Content

What's hot (20)

PDF
Ruby and Distributed Storage Systems
SATOSHI TAGOMORI
 
PDF
Redis Everywhere - Sunshine PHP
Ricard Clau
 
PDF
Big Data! Great! Now What? #SymfonyCon 2014
Ricard Clau
 
PDF
Lessons Learned From Running Spark On Docker
Spark Summit
 
PDF
DrupalCampLA 2014 - Drupal backend performance and scalability
cherryhillco
 
PPTX
Rebooting design in RavenDB
Oren Eini
 
PPTX
Realtime classroom analytics powered by apache druid
Karthik Deivasigamani
 
PDF
Data Processing and Ruby in the World
SATOSHI TAGOMORI
 
PDF
Grand Central Dispatch and multi-threading [iCONdev 2014]
Kuba Břečka
 
ZIP
Constructing Web APIs with Rack, Sinatra and MongoDB
Oisin Hurley
 
PPTX
Staying friendly with the gc
Oren Eini
 
PDF
Webinar - DreamObjects/Ceph Case Study
Ceph Community
 
PDF
Planet-scale Data Ingestion Pipeline: Bigdam
SATOSHI TAGOMORI
 
PDF
Cassandra Core Concepts - Cassandra Day Toronto
Jon Haddad
 
PPTX
/path/to/content - the Apache Jackrabbit content repository
Jukka Zitting
 
PDF
Modern software architectures - PHP UK Conference 2015
Ricard Clau
 
PDF
Scalable and Available, Patterns for Success
Derek Collison
 
KEY
KeyValue Stores
Mauro Pompilio
 
PDF
HPCC Systems Engineering Summit Presentation - Leveraging HPCC Systems with V...
HPCC Systems
 
PPT
Scaling MySQL using Fabric
Karthik .P.R
 
Ruby and Distributed Storage Systems
SATOSHI TAGOMORI
 
Redis Everywhere - Sunshine PHP
Ricard Clau
 
Big Data! Great! Now What? #SymfonyCon 2014
Ricard Clau
 
Lessons Learned From Running Spark On Docker
Spark Summit
 
DrupalCampLA 2014 - Drupal backend performance and scalability
cherryhillco
 
Rebooting design in RavenDB
Oren Eini
 
Realtime classroom analytics powered by apache druid
Karthik Deivasigamani
 
Data Processing and Ruby in the World
SATOSHI TAGOMORI
 
Grand Central Dispatch and multi-threading [iCONdev 2014]
Kuba Břečka
 
Constructing Web APIs with Rack, Sinatra and MongoDB
Oisin Hurley
 
Staying friendly with the gc
Oren Eini
 
Webinar - DreamObjects/Ceph Case Study
Ceph Community
 
Planet-scale Data Ingestion Pipeline: Bigdam
SATOSHI TAGOMORI
 
Cassandra Core Concepts - Cassandra Day Toronto
Jon Haddad
 
/path/to/content - the Apache Jackrabbit content repository
Jukka Zitting
 
Modern software architectures - PHP UK Conference 2015
Ricard Clau
 
Scalable and Available, Patterns for Success
Derek Collison
 
KeyValue Stores
Mauro Pompilio
 
HPCC Systems Engineering Summit Presentation - Leveraging HPCC Systems with V...
HPCC Systems
 
Scaling MySQL using Fabric
Karthik .P.R
 

Similar to The Wix Microservice Stack (20)

PPT
Introduction to Web Services - Architecture
Matrix823409
 
PDF
Brian.suda.thesis
Aravindharamanan S
 
PDF
Microservices Architecture For Conversational Intelligence Platform
Rafael Casuso Romate
 
PPTX
Future Internet
Saber Ferjani
 
PPTX
Effective Microservices In a Data-centric World
Randy Shoup
 
PDF
09-01-services-slides.pdf for educations
katariraju71
 
PDF
"Fintech inside of a SaaS powered by 2000+ Microservices", Volodymyr Malyk
Fwdays
 
PPTX
Service stack all the things
cyberzeddk
 
PDF
Cloud Native API Design and Management
AllBits BVBA (freelancer)
 
PDF
Do you think you're doing microservice architecture? What about infrastructur...
Marcin Grzejszczak
 
PDF
4Developers 2015: Do you think you're doing microservice architecture? - Marc...
PROIDEA
 
PPTX
Pragmatic Approach to Microservices and Cell-based Architecture
Andrew Blades
 
PDF
Microservices for java architects it-symposium-2015-09-15
Derek Ashmore
 
PPTX
Microservices
Shamil Nunhuck
 
PDF
[WSO2Con EU 2017] Building Next Generation Banking Middleware at ING: The Rol...
WSO2
 
PDF
Week2 cloud computing week2
Ankit Gupta
 
PPTX
The Right Kind of API – How To Choose Appropriate API Protocols and Data Form...
Nordic APIs
 
PDF
Cmis Virtual Training Webinar 24 Nov09
Alfresco Software
 
PDF
µServices Architecture @ EPAM WOW 2015
Izzet Mustafaiev
 
PPT
Web servicesoverview
thisismusthafa
 
Introduction to Web Services - Architecture
Matrix823409
 
Brian.suda.thesis
Aravindharamanan S
 
Microservices Architecture For Conversational Intelligence Platform
Rafael Casuso Romate
 
Future Internet
Saber Ferjani
 
Effective Microservices In a Data-centric World
Randy Shoup
 
09-01-services-slides.pdf for educations
katariraju71
 
"Fintech inside of a SaaS powered by 2000+ Microservices", Volodymyr Malyk
Fwdays
 
Service stack all the things
cyberzeddk
 
Cloud Native API Design and Management
AllBits BVBA (freelancer)
 
Do you think you're doing microservice architecture? What about infrastructur...
Marcin Grzejszczak
 
4Developers 2015: Do you think you're doing microservice architecture? - Marc...
PROIDEA
 
Pragmatic Approach to Microservices and Cell-based Architecture
Andrew Blades
 
Microservices for java architects it-symposium-2015-09-15
Derek Ashmore
 
Microservices
Shamil Nunhuck
 
[WSO2Con EU 2017] Building Next Generation Banking Middleware at ING: The Rol...
WSO2
 
Week2 cloud computing week2
Ankit Gupta
 
The Right Kind of API – How To Choose Appropriate API Protocols and Data Form...
Nordic APIs
 
Cmis Virtual Training Webinar 24 Nov09
Alfresco Software
 
µServices Architecture @ EPAM WOW 2015
Izzet Mustafaiev
 
Web servicesoverview
thisismusthafa
 
Ad

More from Tomer Gabel (20)

PDF
How shit works: Time
Tomer Gabel
 
PDF
Nondeterministic Software for the Rest of Us
Tomer Gabel
 
PDF
Slaying Sacred Cows: Deconstructing Dependency Injection
Tomer Gabel
 
PDF
An Abridged Guide to Event Sourcing
Tomer Gabel
 
PDF
How shit works: the CPU
Tomer Gabel
 
PPTX
Scala Refactoring for Fun and Profit (Japanese subtitles)
Tomer Gabel
 
PPTX
Scala Refactoring for Fun and Profit
Tomer Gabel
 
PDF
Onboarding at Scale
Tomer Gabel
 
PPTX
Speaking Scala: Refactoring for Fun and Profit (Workshop)
Tomer Gabel
 
PPTX
Leveraging Scala Macros for Better Validation
Tomer Gabel
 
PDF
A Field Guide to DSL Design in Scala
Tomer Gabel
 
PPTX
Functional Leap of Faith (Keynote at JDay Lviv 2014)
Tomer Gabel
 
PPTX
Scala Back to Basics: Type Classes
Tomer Gabel
 
PDF
5 Bullets to Scala Adoption
Tomer Gabel
 
PPTX
Nashorn: JavaScript that doesn’t suck (ILJUG)
Tomer Gabel
 
PDF
Ponies and Unicorns With Scala
Tomer Gabel
 
PPTX
Lab: JVM Production Debugging 101
Tomer Gabel
 
PPTX
DevCon³: Scala Best Practices
Tomer Gabel
 
PPTX
Maven for Dummies
Tomer Gabel
 
PPTX
Scala in practice
Tomer Gabel
 
How shit works: Time
Tomer Gabel
 
Nondeterministic Software for the Rest of Us
Tomer Gabel
 
Slaying Sacred Cows: Deconstructing Dependency Injection
Tomer Gabel
 
An Abridged Guide to Event Sourcing
Tomer Gabel
 
How shit works: the CPU
Tomer Gabel
 
Scala Refactoring for Fun and Profit (Japanese subtitles)
Tomer Gabel
 
Scala Refactoring for Fun and Profit
Tomer Gabel
 
Onboarding at Scale
Tomer Gabel
 
Speaking Scala: Refactoring for Fun and Profit (Workshop)
Tomer Gabel
 
Leveraging Scala Macros for Better Validation
Tomer Gabel
 
A Field Guide to DSL Design in Scala
Tomer Gabel
 
Functional Leap of Faith (Keynote at JDay Lviv 2014)
Tomer Gabel
 
Scala Back to Basics: Type Classes
Tomer Gabel
 
5 Bullets to Scala Adoption
Tomer Gabel
 
Nashorn: JavaScript that doesn’t suck (ILJUG)
Tomer Gabel
 
Ponies and Unicorns With Scala
Tomer Gabel
 
Lab: JVM Production Debugging 101
Tomer Gabel
 
DevCon³: Scala Best Practices
Tomer Gabel
 
Maven for Dummies
Tomer Gabel
 
Scala in practice
Tomer Gabel
 
Ad

Recently uploaded (20)

PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Finding Your License Details in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Comprehensive Risk Assessment Module for Smarter Risk Management
EHA Soft Solutions
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 

The Wix Microservice Stack

  • 1. The Wix Microservice Stack Tomer Gabel, Wix March 2017 @ Dnipro, UA
  • 2. Agenda 1. Topology 2. Networking 3. Structure 4. Operations 5. Beer
  • 3. Our conceptual system Store Service Checkout Service Cart Service
  • 4. 1. TOPOLOGY Image: Penrose Steps by Alex Eylar (CC BY-NC-SA 2.0)
  • 5. Our conceptual system Store Service Checkout Service Cart Service Host A Host B Host C
  • 7. Service Scheduling • A hard problem! • Multiple dimensions: – Resource utilization (disk space, I/O, RAM, network, power…) – Resource availability – Failover (physical server, rack, row…) – Custom constraints (zoning, e.g. PCI compliance)
  • 8. Service Scheduling • A hard problem! • Multiple dimensions: – Resource utilization (disk space, I/O, RAM, network, power…) – Resource availability – Failover (physical server, rack, row…) – Custom constraints (zoning, e.g. PCI compliance)
  • 9. Service Scheduling • The middle ground: – Naïve automatic scheduler – Human-configured overrides for zoning, optimization • Easy but limited scale – A few hundred servers
  • 10. Our conceptual system Store Service Checkout Service Cart Service http://err:42/uh … derp?
  • 14. In practice • Static topology – Managed with Frying Pan – Exported to Chef – Deployed via configuration files • Live registry in Zookeeper – Deployment only – … for now
  • 15. 2. NETWORKING Image: Neurons by Birth Into Being (CC BY-NC-SA 2.0)
  • 16. Back to diagrams Store Service Checkout Service Cart Service
  • 17. Back to diagrams Store Service Checkout Service Cart Service Protocol
  • 18. Protocol • RPC-style – Sync or async – Point-to-point • Message passing – Async only – Requires broker Shared Concerns Topology Serialization Operations
  • 19. Protocol • Wix RPC – RPC-style – Custom JSON – HTTP • Pros/cons – Rock-solid – Sync/blocking – Legacy Image: psycho chicken by Bernhard Latzko (CC BY-ND 2.0)
  • 20. Protocol • Greyhound –Message-passing –Custom JSON –Kafka • Pros/cons –Async + replayable –Still experimental Image: Robin Fledgeling by edgeplot (CC BY-NC-SA 2.0)
  • 21. Load balancing • Centralized – Simple – Limited flexibility – Limited scale – Thin implementation  highly portable – Suitable for static topologies • Distributed – Highly scalable – Flexible – Fully dynamic – Fat implementation  difficult to port • Quasi-distributed – e.g. Synapse – Best of both worlds?
  • 22. Load balancing • Centralized – Simple – Limited flexibility – Limited scale – Thin implementation  highly portable – Suitable for static topologies • Distributed – Highly scalable – Flexible – Fully dynamic – Fat implementation  difficult to port • Quasi-distributed – e.g. Synapse – Best of both worlds? Frying Pan  Chef  Nginx
  • 23. To our shame • There’s always IDL. • Informal – Text documentation – Code samples • Formal – Swagger, Apiary etc. – ProtoBuf, Thrift, Avro – WSDL, god forbid! • … or – Ad-hoc public interface SiteMembersService { SiteMemberDto getMemberById( Guid<SiteMember> memberId, UserGuid userId); SiteMemberDto getMemberOrOwnerById( Guid<SiteMember> memberId, Guid<SMCollection> collectionId); SiteMemberDto getMemberDtoByEmailAndCollectionId( String email, Guid<SMCollection> collectionId); List<SiteMemberDto> listMembersByCollectionId( Guid<SMCollection> collectionId); }
  • 24. To our shame • There’s always IDL. • Informal – Text documentation – Code samples • Formal – Swagger, Apiary etc. – ProtoBuf, Thrift, Avro – WSDL, god forbid! • … or – Ad-hoc public interface SiteMembersService { SiteMemberDto getMemberById( Guid<SiteMember> memberId, UserGuid userId); SiteMemberDto getMemberOrOwnerById( Guid<SiteMember> memberId, Guid<SMCollection> collectionId); SiteMemberDto getMemberDtoByEmailAndCollectionId( String email, Guid<SMCollection> collectionId); List<SiteMemberDto> listMembersByCollectionId( Guid<SMCollection> collectionId); }
  • 25. In Detail • Java interfaces? + Ridiculously simple + Lend well to RPC – Coupled to JVM • JSON serialization + Jackson-based + Custom, extensible mapping – Reflection-based • Server stack (JVM) – Jetty – Spring + Spring MVC – Custom handler • RPC client stack (JVM) – Spring – Proxy classes generated at runtime – AsyncHttpClient
  • 26. In Detail • Java interfaces? + Ridiculously simple + Lend well to RPC – Coupled to JVM • JSON serialization + Jackson-based + Custom, extensible mapping – Reflection-based • Alternative stack – Based on Node.js – Generated RPC clients – Manually-converted entity schema :-(
  • 27. In Detail • Java interfaces? + Ridiculously simple + Lend well to RPC – Coupled to JVM • JSON serialization + Jackson-based + Custom, extensible mapping – Reflection-based • Alternative stack – Based on Node.js – Generated RPC clients – Manually-converted entity schema :-(
  • 28. Cascade Failures • What is a cascade failure? • Mitigations – Bulkheading – Circuit breakers – Load shedding • We don’t do any of that (mostly)
  • 29. Does it go? • Short answer: yes. • Battle-tested – Evolving since 2010. – >200 services in production. • Known quantity – Easy to operate – Performs well enough – Known workarounds
  • 30. Not all is well, though • Polyglot development – Custom client stack – Expensive to port!
  • 31. Not all is well, though • Polyglot development – Custom client stack – Expensive to port! • Implicit state – Transparently handled by the framework – Thread local storage – Hard to go async! Client Proxy Service A Service B Session info Session info Transaction ID Session info Transaction ID A/B experiment Transaction ID A/B experiment
  • 33. Codebase modeling • A product comprises multiple services • Services have dependencies – Creating a DAG – Tends to cluster around domains • Org structure reflects the clustering (Conway)
  • 34. Codebase modeling Repository-per-domain • Small repositories • Artifacts built independently • Binary dependencies • Requires specialized tools to manage: – Versions – Build dependencies Monorepo • Repository contains everything • Code is built atomically • Source dependencies • Requires a specialized build tool
  • 35. At Wix • One repo per domain • Dependencies: – Declared in POMs – Version management via custom plugin – Builds managed by custom tool* • Custom dashboard, “Wix Lifecycle” * Lifecycle – Dependency Management Algorithm
  • 36. Version management [INFO] QuickRelease /home/builduser/agent01/work/d9922a1c87aee4bb bf1bc8bcfb2eccebc4268651c5f19faa689be6e4 [08:10:55][INFO] Adding tag RC;.;1.20.0 [08:10:56][INFO] Tag RC;.;1.20.0 added successfully [08:10:56][INFO] Working on onboarding-server-web [08:10:56][INFO] onboarding-server-web-1.19.0- SNAPSHOT jar deployable copied [08:10:56][INFO] onboarding-server-web-1.19.0- SNAPSHOT jar sources copied [08:10:56][INFO] onboarding-server-web-1.19.0- SNAPSHOT jar copied [08:10:56][INFO] onboarding-server-web-1.19.0- SNAPSHOT jar tests copied [08:10:56][INFO] onboarding-server-web pom deployed [08:10:57][INFO] Deploying artifacts to release artifacts repository [08:10:57][INFO] Deploying onboarding-server-web to RELEASE [08:10:57][INFO] pushing new pom [08:10:59]2016-02-22 08:10:39 [INFO ] /usr/bin/git push --tag origin master exitValue = 0 • All artifacts share a common parent – Master list of versions • Manually-triggered release builds – Custom release plugin – Increments version – Updates master – Pushes changes to git
  • 38. Back to diagrams Store Service Checkout Service Cart Service How ya doin’?
  • 39. Health • Host monitoring – Sensu alerts – Usual host metrics – Health-check endpoint in framework • End-to-end – Pingdom • Business – Custom BI toolchain
  • 40. Instrumentation • Metrics – DropWizard Metrics – Graphite and Anodot – Built-in metrics (RPC, resource pools…) – APIs for custom metrics • Alerts – Anodot, NewRelic – Via PagerDuty
  • 41. Debugging • Logs – Good old Logback – No centralized aggregation – Not particularly useful • Feature toggle overrides • Distributed tracing
  • 42. WE’RE DONE HERE! … AND YES, WE’RE HIRING :-) Thank you for listening [email protected] @tomerg http://il.linkedin.com/in/tomergabel Wix Engineering blog: http://engineering.wix.com