QCon London - Gilt Microservices
QCon London - Gilt Microservices
QCon London - Gilt Microservices
MICROSERVICES
ARCHITECTURE @
QCON LONDON - 2015
YONI (JONATHAN) GOLDBERG
WHAT IS GILT?
Flash Sales Business
Founded in 2007
Top 50 Internet-Retailer
~150 Engineers
WE NEEDED TO SOLVE
THE PROBLEM FAST
WHY JVM?
Widely adopted
Stable
Better support for concurrency
Better GC vs MRI
FIRST 10 SERVICES
APP BOOTSTRAP
rake bootstrap:admin-web
rake bootstrap:client-server-core
rake bootstrap:play
rake bootstrap:play-ui-build
rake bootstrap:sbt-library
rake bootstrap:schema
DEMO
HOW TO DEFINE A
MICROSERVICE?
FUNCTIONALITY SCOPE
NUMBER OF DEVS INVOLVED
CURRENT CHALLENGES
Deployments and Testing (Functional/Integration)
Dev/Integration Environments
Service Discoverability
Who owns this service!?
Monitoring
MICRO SERVICE
DEPLOYMENT V3
SBT
Motivation: Scala adoption
Complex Scala syntax
Cool features: ~test, shell, console
Hard to debug
GILT-SBT-BUILD
Simple config for all the services
Pulls many plugins:
[nexus, testing, RPMs, run scripts, Monitoring, SemVer, ...]
Custom commands (e.g 'sbt release')
ION-CANNON + SBT
Run tests on dedicated Env
Dark canary releases
Easy rollbacks
Integrated health checks
DATA CENTER
LIMITATIONS
&&
MORE TECHNOLOGY
OWNERSHIP
IMMUTABLE
INFRASTRUCTURE
V3
Per department AWS account and budget
Longer deploys [New instances / CNAME swaps]
Each team has AWS expertise
API LOVE
APIS @ GILT
www.apidoc.me and Swagger.io
Describe the API in simple json
Auto generates versioned docs, routes and clients
Per team - API design committee
"MID-TIER MICRO-SERVICE"
BIGGEST PERFORMANCE CHALLENGE
NETWORK IO
ON DEV/INTEGRATION ENVIRONMENTS
The hardware is not strong enough
No one wants to compile 20 services
Service Dependencies
STAGING DIFFICULTIES:
Hard to keep all the services up to date
Maxed our staging env capacities
Shared data across legacy apps
ON OWNERSHIP
"code stays much longer than people" - SB
CODE OWNERSHIP
CURRENT APPROACH
Code Review!Code Review!Code Review!
Team owns services, not individual developers
Ownership transfer
DATA OWNERSHIP
WE TRANSITIONED TO
MICRO-DBS
MICROSERVICES NEEDS THEIR OWN
MONGODB | POSTGRES | RDS |
VOLDEMORT
MANAGE MICRO-RELATIONAL
DBS
SCHEMA EVOLUTION
MANAGER
https://github.com/gilt/schema-evolution-manager
PRINCIPLES OF
SCHEMA EVOLUTION
MANAGER
Independent from the service code
Manages the schema evolutions in a Git repo
Schema changes are deployed as tar flies
No rollbacks
Schema changes are required to be incremental
ON MONITORING
GRAPHITE / OPENTSDB
CAVE
HTTP://CAVELLC.GITHUB.IO
CONTINUOUS | AUDIT | VAULT |
ENTERPRISE
SUMMARY
WHAT'S NEXT ?
BUILD YOUR NEXT FEATURE
IN A NEW SERVICE
QUESTION TIME
@yoni_goldberg
jgoldberg@gilt.com
www.yonigoldberg.com