Using MongoDB for a Product Catalog Application

DZone 's Guide to

Using MongoDB for a Product Catalog Application

In this blog, I will describe an application – product catalog management – that distinctly benefits from features that MongoDB offers.

· Database Zone ·
Free Resource

In today’s era of data-driven business, enterprises are continuously adopting new technologies to gain a competitive advantage. Distributed and cloud databases is one such technology that is being adopted by enterprises. These databases are fundamentally different from relational databases and offer scalability, availability, and flexible data models that are beyond the capabilities of traditional relational databases. MongoDB is one of the leading next-generation scale-out databases. It is a document-oriented database that provides dynamic schemas, making the integration of data in certain types of applications easier and faster. MongoDB also provides easy scaling through auto-sharding, tunable consistency for reads, and built-in replication.

In this blog, I will describe an application – product catalog management – that distinctly benefits from features that MongoDB offers. So why are we talking about an application here in the context of Datos IO?  Well, eventually all enterprise hardware and software infrastructure is driven by the applications. At Datos IO, we are building next-generation data protection products to minimize application downtime and hence we draw inspiration for our use cases and requirements from such enterprise applications.

Product catalogs that are mostly used by e-commerce enterprises require the ability to store varied types of objects with different sets of attributes. These kinds of data collections are quite compatible with MongoDB, which can offer dynamic queries on a constantly changing dataset.  However, it is important to understand the major requirements of industry verticals such as retail, media and entertainment, insurance, healthcare and e-commerce that are addressed by MongoDB before designing an optimal data model for your own use case(s). For example, Ebay offers several use cases where MongoDB has been implemented successfully and delivered much value.

  • Product Availability – Being a JSON document store, not only can MongoDB help in complex querying of a product catalog in real-time but it can also keep track of placed orders to accurately calculate the available quantity for popular products. The data is important from customer service point of view as it keep them aware of available choices at the time of order placement as well as prevents order cancellations later due to non fulfillment.
  • Dynamic Pricing – Product prices change quite frequently in the online world. E-commerce enterprises need to keep pace with these fluctuations and dynamically adjust product prices to retain their existing customer base. MongoDB helps tremendously through its ability to update data on live sites without shutting down/restarting any systems. On top of that, ability to run geospatial queries using geospatial index allows the sites to show converted pricing and taxes based on the location of their customers. The example below shows how to find all theatres within 10 miles of a location using a geospatial query.

    db.theatres.find({ location:
    { $geoWithin:
    { $centerSphere: [ [ <longitude> , <latitude> ], 10 / 3963.2 ] } } })
  • Shipping Estimation – Today’s customers enjoy the convenience of shopping online at home but also demand the flexibility to control the delivery of their products. Some customers will pay extra money for expedited delivery while the others are content with paying no shipping costs at the expense of waiting longer. The ability to provide correct shipping costs and time estimates is a critical functionality for e-commerce applications. Again, MongoDB comes to rescue with its geospatial queries to calculate correct shipping estimates based on the locations of the user and the inventory.
  • Personalized experience – E-commerce enterprises want their customers to enjoy the online shopping experience by understanding their needs as well as their social profile. This allows them to provide every single user with a personalized version of the site which can be based on their past order history and their interaction with the company via stores, customer service and social media. Not only that, e-commerce enterprises run applications that recommend new products based on customers’ indicated preferences. MongoDB is being used by online retailers such as Otto to consume data from multiple sources and build customized catalog experiences for individual e-commerce customers.
  • Sales/Discounts – In order to engage their customers at the next level, e-commerce enterprises have built capabilities to develop customized discount offerings. This can be done via Flash Sales that allows customers to buy their coveted products at lower prices within the constraints of quantity, time and minimum spend. MongoDB has been the with technology of choice here as well (for example GILT Groupe) because it can keep track of time bound and volume bound parameters in real-time to make such deals successful.

It can be argued that e-commerce industry and dynamic product catalogs have been in existence for a long time. So, how is MongoDB changing the landscape? The answer lies in the rapidly evolving landscape of customer buying patterns. Today, a wait of an extra minute means losing customers and revenue to the next best online competitor. Always-on applications are a norm and scalable infrastructure is a must-have requirement. Hence, MongoDB is helping enterprises to meet their changing business needs. However, product catalog applications generally require consolidating data from disparate sources and present a uniform view to customers. This also makes the underlying database, MongoDB, prone to logical and human errors. Hence, a highly-available data protection infrastructure that can guarantee minimal data loss (low RPO and RTO) is required to keep online retail engines running. Further, certain catalog portions could be updated more frequently such as perishable goods and hence, those databases need to be backed up every hour versus the slow moving goods. The data protection system should provide enough flexibility to set backup policies per the business requirements (granularity, etc.).

At Datos IO, we have built RecoverX to tackle these data protection challenges for next-generation applications. RecoverX, the industry-first scale-out data protection software, enables you to onboard your product catalog and other mission critical applications on MongoDB with confidence and deploy them on-premise or natively in public cloud (Amazon AWS, Google Cloud Platform, Microsoft Azure).

data protection, databases, datos io, e-commerce, io, mongodb, scale-out

Published at DZone with permission of Shalabh Goyal , DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}