Welcome and thankyou for attending If you want to ask questions …Just a quick over viewTalk about a project we recently undertaken to update and streamline our checkoutSession title/Abstract- Couchbase at The Hut Group In this talk Iwill discuss why we decided to go with Couchbase for our newcheckout web application; the factors we had to consider whendesigning the application to use Couchbase, specifically to storedata that is mutated by concurrent threads; How the developmentteam took to the new technology and how we implemented it in a Javaenvironment; what we are looking at using Couchbase for next! andmuch moreThe story of couchbase at the hut and how it came to be
4000 concurrent sessions causes more than 4000 saves per minuet
Schale, cross data center
Performance-sizeing-infastructure-sub millisecond – replaceing session/server memory-ammount of gets, bulk opperations-performance testing the app not couchbase-what if it doesn’t perform or whit if it dosent whateverAvalibility-never had any downtime-fail over dealing with it your self – auto only one and off by default-The way its sharded and replicatedData storageGson, jacksonCode implimentationRepository pattern, aggrigate root, query object, connector, cas value? DTO?Repository - Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.Hard cache ejections.
Cas starts here
Cas/locking/ignoreDocuments borken down on next slideQuestion what do you do with the cas value? Unit of Work - Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.
Lambda Architecture Batch layer, servicing layer and the speed layer
CCB12 Couchbase at The Hut Group
COUCHBASE AT THE HUT GROUPChris Woods – Architect @ The Hut Group
COUCHBASE AT THE HUT GROUPAboutAbout MeName: Chris WoodsRole: ArchitectContact: firstname.lastname@example.org @chriswoods1983About The Hut GroupThe Hut Group is the UK’s leading multi-website online retailer withoperations in the womens fashion, health & beauty, entertainment and giftsmarket. The group has also firmly established itself in multiple internationalmarkets, with 35% of current sales coming from outside the UK.
COUCHBASE AT THE HUT GROUPBackground• 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.
COUCHBASE AT THE HUT GROUPBackground Ecommerce Platform Payment Delivery Options Processing Service Service SQL Server Backend
COUCHBASE AT THE HUT GROUPThe FutureRequirements• 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).
COUCHBASE AT THE HUT GROUPThe Contenders Low Latency Scalable Data Query-ableSQL Server No Hard Hard YesCouchbase 1.8 Yes Yes Yes NoCouchbase 2 Yes Yes Yes Yes Extendable Support SQL Server Hard Yes Couchbase 1.8 Yes Yes Couchbase 2 Yes Yes
COUCHBASE AT THE HUT GROUP Zero downtime migration optionsCouchbase 1.8 Migrate Couchbase 2.0 Features Added •Queryable • to input in data warehouse • Inter-data centre Replication • to support service continuality
COUCHBASE AT THE HUT GROUPNew Ecommerce platform Payment Processing Service Checkout Web Platform Delivery Options Service Web App Web API Account Service Couchbase Order Service Server Sql Server
COUCHBASE AT THE HUT GROUPKey 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.
COUCHBASE AT THE HUT GROUPCASQ) How do we keep the checkout session object (which is a serializedJSON document) consistent?• CAS• Divide and conquer ...• …And if that fails, compareNote: this is in Couchbase 1.8
COUCHBASE AT THE HUT GROUPDocument Storage Checkout Session: id:123 DeliveryOptions id:123 Shipping Restrictions Id:123 PaymentDetails Id:123
COUCHBASE AT THE HUT GROUPSuccess• Released on 2nd July and has taken over 400,000 orders• Very few CAS violations, which are gracefully handled when they do occur.
COUCHBASE AT THE HUT GROUPWhat next for Couchbase at The Hut Group• Local server cache replacement • Tomcat session • Product cache • Special Offer Cache• Big Data – Speed Layer!