couchbase_at_the_hut_group_couchbase_uk_2013
TRANSCRIPT
THE HUT GROUP + COUCHBASE
Chris Woods - Architect
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
EAbout
About Me
Name: Chris Woods
Role: Architect
Contact: [email protected]
@chriswoods1983
About The Hut Group
The Hut Group is the UK’s leading multi-website online retailer with operations
in the women's fashion, health & beauty, entertainment and gifts market. The
group has also firmly established itself in multiple international markets, with
35% of current sales coming from outside the UK.
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
EProblem
Problem
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
EBackground
Session State• Server bound: Whenever we deployed our existing application, all
the customers currently on the site get kicked out of the ”checkout
flow”, making it costly to release and consequently restricts when
and how often you can release. • No Resiliency: If the server you are bound to via sticky session
goes down customer gets kicked out of checkout.
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
EThe Solution
Requirements • Performance: Be capable of supporting 4,000 concurrent sessions per min
at a sustained rate during “peak”.• Server Affinity: Should be able to release the system at any time of day and
not affect the user experience.• Scalability: Grows with the company - can be expanded to support 1,000 to
10,000 times more traffic.
• Resiliency: Can be scaled across multiple data centres in multiple physical locations.
• Resiliency: A failure should not cause downtime.
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
EThe Contenders
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
EWhy Couchbase
• Performance.• Resiliency.• Schemaless.• Simplicity.• Cost.
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
E
The Hard Stuff
Aggregate Document
{“checkoutOrder”: { "orderNumber": "27162500", "customer": { "customerId": 5830953, "email": "[email protected]", "customerName": "mr c woods", }, "basket": { "basketItems": [{ "productTitle": "Apple iPad Mini: 64GB Wifi - White and Silver", "quantity": 1, "itemPrice": { "money": { "amount": 419.99, "currency": "GBP“ } }, }, “shipping”:{etc…}, “delivery”:{etc…}, etc… }}
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
E
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
EUpdate Consistency Issues
2, On receiving change of address request the
application:-
2a, Request Delivery Options
2b, Check Shipping Restrictions
1, Customer changes address
3, Restrictions return then the thread loads the document modifies it
and saves it
4, Delivery options
return then the thread loads the document modifies it
and saves itCAS:1 CAS:1
ONE WILL FAIL !
Shipability Service
DeliveryService
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
ESeparate Aggregates
{“delivery”:{}} {“shipping”:{}}
{“checkoutOrder”: { "orderNumber": "27162500", "customer": { "customerId": 5830953, "email": "[email protected]", "customerName": "mr c woods", }, "basket": { "basketItems": [{ "productTitle": "Apple iPad Mini: 64GB Wifi - White and Silver", "quantity": 1, "itemPrice": { "money": { "amount": 419.99, "currency": "GBP“ } }, },etc… }}
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
ESchema Migrations in a Schemaless data model
V 2.0
Version 2.0 Version 2.0 Version 1.0Version 2.0
V 2.0V 1.0
V 1.0
1.2. 3.
4.
?
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
ESuccess
• Released on 2nd July
• Passed Christmas with flying colours
• Very few CAS errors
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
E
New Stuff
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
ECouchbase 2.0 and Elastic Search for product search
Existing infrastructure
Jar + Cron Job
Data
Solr Master
Solr Slaves
Product update
Search
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
ECouchbase 2.0 and Elastic Search for product search
Product update
Search/findBy(Query criteria)
XDRC
Summary
Summary
TH
E H
UT
GR
OU
P +
CO
UC
HB
AS
EQuestions
?