CCB12 Couchbase at The Hut Group

18
COUCHBASE AT THE HUT GROUP Chris Woods – Architect @ The Hut Group

Transcript of CCB12 Couchbase at The Hut Group

COUCHBASE AT THE HUT GROUP

Chris Woods – Architect @ The Hut Group

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

About

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.

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

Background

• 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. • Not resilient: If the server you are bound to via sticky session goes

down customer gets kicked out of checkout. • Costly to scale: very difficult to scale out across data centres.

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

Background

Ecommerce Platform

SQL Server

Payment Processing

ServiceDelivery Options

Service

Backend

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

The Future

Requirements

• Be capable of supporting 4,000 concurrent sessions per min at a sustained rate during “peak”.

• Should be able to release the system at any time of day and not affect the user experience.

• Grows with the company - can be expanded to support 1,000 to 10,000 times more traffic.

• Can be scaled across multiple data centres in multiple physical locations.

• In case of failover should not cause downtime.

• Improve customer dropout rates (single page).

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

The Contenders

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

The Contenders

Low Latency Scalable Data Query-able

SQL Server No Hard Hard Yes

Couchbase 1.8 Yes Yes Yes No

Couchbase 2 Yes Yes Yes Yes

Extendable Support

SQL Server Hard Yes

Couchbase 1.8 Yes Yes

Couchbase 2 Yes Yes

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

Couchbase 1.8 Migrate Couchbase 2.0

Features Added •Queryable

• to input in data warehouse• Inter-data centre Replication

• to support service continuality

Zero downtime migration options

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

New

Checkout Web Platform

Web App Web API

Couchbase Server

Ecommerce platform

Sql Server

Payment Processing Service

Delivery Options Service

Account ServiceOrder Service

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

Key Considerations

• Performance.• Availability.• Data storage (serializing and de-serializing).• Segmenting data into buckets.• Code Implementation• Data consistency in an asynchronous, event-driven

environment.• Changing document schema;

• Versioning the document that is stored.

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

Checkout Web Platform

WebApp

WebAPI

Queue AdaptorDeliveryService

CouchbaseServer

1. 2.

3.

4.

5.

Queue Adaptor

ChannelService

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

CAS

Q) How do we keep the checkout session object (which is a serialized JSON document) consistent?

• CAS• Divide and conquer ...• …And if that fails, compare

Note: this is in Couchbase 1.8

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

Document Storage

Checkout Session:id:123

PaymentDetailsId:123

DeliveryOptionsid:123

Shipping RestrictionsId:123

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

Success

• Released on 2nd July and has taken over 400,000 orders

• Very few CAS violations, which are gracefully handled when they

do occur.

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

What next for Couchbase at The Hut Group

• Local server cache replacement• Tomcat session • Product cache• Special Offer Cache

• Big Data – Speed Layer!

CO

UC

HB

AS

E A

T T

HE

HU

T G

RO

UP

Questions

?