couchbase_at_the_hut_group_couchbase_uk_2013

19
THE HUT GROUP + COUCHBASE Chris Woods - Architect

Upload: couchbase

Post on 31-May-2015

372 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

THE HUT GROUP + COUCHBASE

Chris Woods - Architect

Page 2: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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.

Page 3: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

TH

E H

UT

GR

OU

P +

CO

UC

HB

AS

EProblem

Problem

Page 4: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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.

Page 5: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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.

Page 6: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

TH

E H

UT

GR

OU

P +

CO

UC

HB

AS

EThe Contenders

Page 7: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

TH

E H

UT

GR

OU

P +

CO

UC

HB

AS

EWhy Couchbase

• Performance.• Resiliency.• Schemaless.• Simplicity.• Cost.

Page 8: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

TH

E H

UT

GR

OU

P +

CO

UC

HB

AS

E

The Hard Stuff

Page 9: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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… }}

Page 10: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

TH

E H

UT

GR

OU

P +

CO

UC

HB

AS

E

Page 11: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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

Page 12: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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… }}

Page 13: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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.

?

Page 14: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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

Page 15: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

TH

E H

UT

GR

OU

P +

CO

UC

HB

AS

E

New Stuff

Page 16: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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

Page 17: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

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

Page 18: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

Summary

Summary

Page 19: Couchbase_at_The_Hut_Group_Couchbase_UK_2013

TH

E H

UT

GR

OU

P +

CO

UC

HB

AS

EQuestions

?