• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Mongo @ homeshop18
 

Mongo @ homeshop18

on

  • 371 views

How you introduce mongo as a datastore for your eCommerce appliactions

How you introduce mongo as a datastore for your eCommerce appliactions

Statistics

Views

Total Views
371
Views on SlideShare
371
Embed Views
0

Actions

Likes
0
Downloads
2
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Hi! This is Mahesh. I lead the teams that builds the backend systems @ homeshop18.com Homeshop18 is a tv / e-comerce business e-commerce is a thin margin business - its profitable when done a scale Technology is our leverage to make that happen In this talk; I'll present how we use Mongo (and plan it) as an extension to our current data stores: MySql, Solr
  • DataStore: A Store(age) of Data
  • Why should you look beyond: RDBMS (MySQL) We all use Lucene/Solr for search - Why? Its the right thing to do for supporting search Similarly Mongo is the right thing to do for storing and serving data in denormalized form at scale Its in the sweet spot between Key-Value stores and RDBMS
  • 1. images of a Product product with multiple images pid - img1 url pid - img2 url small image, zoom images pid - img1 - img type imgtype master default image pid - img1 - img type - seq nr Thats not how we think... its cognitive burden- unnecessary cognitive burden we are thinking in terms of the tools - and that inherently wrong 2. Books : Author, Publisher, Nr of pages Mobile: Brand, Battery Life, Screen size pid-aid aid-keyid-value aid-keyid-value keyid-keyname-datatype multiple values? maintain order? The write model has to all validations Read model has to parse all this crap to simply compare two products knowling data type is good: you can leverage a whole lot code like comparing two integers ;) 3. Order States process variables order is verifed, its cr'ed, shipped, rto or delivered; sales resturn being a good business; we capture diff data at diff steps to improve the process 10 states, 4 variables each = 40 cols!! inefficient use of space, dev time, maintainability, extending it etc.. Lets model this in rdbms
  • MySQL is you write Store : CQRS/DDD Mongo/Solr are your read stores Don't use Solr as a Doc store; use it as a search store-- that is what it is good at. Mongo is denormalized data store that is good for serving data to apps Write app can send an event to update read model (think of it as a cache; but its more than that) Beautiful for storing search click logs : capped collections Nice to use as a cache: ttl collections
  • Store denormalized product in mongo as a batch job every 8 hours
  • Now, you website need not hit Mysql - its just key lookups now, no joins ;) Keep updating data in Mongo in real-time whenever there is a update to DB
  • if u haven't heard of JPA itself ;) think of it as hibernate standardised If you are on java stack and use spring - definetly look at spring-data-mongo Its amazing how little code you need to write to do CRUD on a data store. persist and fetch data from your data store Amazing DSL for querying

Mongo @ homeshop18 Mongo @ homeshop18 Presentation Transcript

  • Mongo @ e-CommerceRdbms.next() ~ Mongo
  • Mongo as a Data Store isDev Friendly: Data modeling and ProgrammingBusiness Friendly: Evolving schema - MVPOps Friendly: ReplSet in 30 minutesUI Friendly : no-impedance gap with JSAnalytics friendly: Ad Hoc queriesReporting friendly: ??
  • But Why?- Right tool for Right jobImage credit: http://blog.pilotfishseo.com/open-sourced-content-management-system-cms-is-it-right-for-you/
  • Data ModelingProduct imagesProduct EAV Books MobilesState machine Order Lifecycle transitions
  • 3 essential* data storesDB, Mongo, Solr Solr MySql App Mongo Write App * necessary, but may not be sufficient ;)
  • V1How we evolved from here to prev slide: Solr MySql
  • V2MySql Solr Mongo
  • V3MySql Solr Mongo v2 - catalogue, replSet
  • Ecosystem around MongoSpring-Data has JPA for MongoIts the icing on cake for your to transition
  • Thank youGlad to answer any questions you have..