Quantcast
Channel: » Priya Pancholi
Viewing all articles
Browse latest Browse all 11

Why businesses use MongoDB? Part two

$
0
0

ardent-software_why-businesses-using-MongoDB_software-development_ardent-newsletter-July2014In our part one of the MongoDB blog series, we talked about that MongoDB is and why it was created. Now we shall explore why business use MongoDB.

We know that MongoDB is an open-source, non-relational database that combines three key qualities: scalable, schemaless, and queryable. It has instinctive drivers for practically every major language, and a small but growing community.

So what’s so great about it?

Perfect scalability

Businesses that are growing or are the type of business where traffic on certain webpages can fluctuate need webservers that can adapt.  

Mongo has automatic sharding features that stores data records across multiple machines. This works fantastic for all growing businesses, as this feature allows your website to grow and handle being on demand.

 

It’s Document-oriented
Developers are used to the process of translating code’s data structures back and forth to the tables in database – yawn! You can make the translating easier, quicker and more efficient.

Rather than rows in a table, Mongo stores documents in bundles. These documents are (JSON objects, This means that you can hold much more complex structured  data –all in one document that can be stored in a table row – neat!

Embedding objects

Using MongoDB can change your approach data modelling. Rather than using multiple tables and integrating them together with foreign keys, we can embed objects within a single document.

For example, typically each post on your site is a document so on a MySQL -based system, a post would be a row in a table. However the comments will be stored different. With MongoDB you can embed comments directly within the post document as a collection of objects. All of the comment data, including the text of each comment, information on who posted it, and the thumbs up/thumbs down voting, is stored directly within the post document.

This means that your code pulls up a post, the database doesn’t have to query over a separate comments table. The comments are right there as part of the post object, ready to be displayed – simple, neat and convenient!

Simplified changes

With MongoDB there is no database-enforced schema, so when a big change is made (like adding stars to the comments), it can be simply made in a backwards-compatible way.

Sounds blissful right? However, every now and then you’ll have a need to do a data migration that goes along with a code release. But it wouldn’t be as often as when using MySQL.

 

Tag it!

Mongo is fantastic with indexed “tag” type queries.  If you have a post on your website tagged Apple and iPhone, this can be stored internally as an array of strings.

The what MongoDB does is index that field and understand that it needs to search the contents of the array, so you can query for all posts tagged “iPhone” very easily – simple!

 

Real-Time website analytics

Like many businesses that have websites, to measure traffic, most use Google Analytics or other packages to get detailed information about traffic. However, especially now a days, things are more speedy and waiting till tomorrow can seem rather distant.

MongoDB allows you to create statistics pages that provide up-to-the-second live data on what’s happening on your site: what pages people are looking at and clicking that very second! Editors can use that data throughout the day for instant feedback on all website activates.

Image Storage

Mongo can store binary data in the database, this means you don’t have to deal with the oh-so-long hassle of having files in the file system and metadata in the database, MongoDB just integrates them into one database using its GridFS API, so you can easily place all of your images on the site in Mongo.

But overall, MongoDB is probably well-suited for a lot of web applications. It most certainly makes life easier for web developers to manage websites, and allows businesses to want changes to their site easily. Also the fantastic feature of real-time analytic is a bonus!

Find out more now on MongoDB, let’s see how we can make IT easy for you.

Look out for part three of our series on MongoDB – the challenges of using MongoDB.


Viewing all articles
Browse latest Browse all 11

Latest Images

Trending Articles





Latest Images