Databases Reference
In-Depth Information
arbitrary deep nesting of tree structures, but doesn't support the ability to store and
query document attributes such as bold, italics, or hyperlinks within the text. We call
this complex content . In our context we refer to JSON data stores as serialized object stores
and to document stores that support complex content as true document stores with XML
as the native format.
4.4.6
Case study: ad server with MongoDB
Do you ever wonder how those banner ads show up on the web pages you browse or
how they really seem to target the things you like or are interested in? It's not a coinci-
dence that they match your interests: they're tailored to you. It's done with ad serving.
The original reason for MongoDB, a popular NoSQL product, was to create a service
that would quickly send a banner ad to an area on a web page for millions of users at
the same time.
The primary purpose behind ad serving is to quickly select the most appropriate
ad for a particular user and place it on the page in the time it takes a web page to load.
Ad servers should be highly available and run 24/7 with no downtime. They use com-
plex business rules to find the most appropriate ad to send to a web page. Ads are
selected from a database of ad promotions of paid advertisers that best match the per-
son's interest. There are millions of potential ads that could be matched to any one
user. Ad servers can't send the same ad repeatedly; they must be able to send ads of a
specific type (page area, animation, and so on) in a specific order. Finally, ad systems
need accurate reporting that shows what ads were sent to which user and which ads
the user found interesting enough to click on.
The business problem 10gen (creators of MongoDB) was presented with was that
no RDBMS s could support the complex real-time needs of the ad service market.
MongoDB proved that it could meet all of the requirements at its inception. It has
built-in autopartitioning, replication, load balancing, file storage, and data aggrega-
tion. It uses a document store structure that avoids the performance problems associ-
ated with most object-relational systems. In short, it was custom designed to meet the
needs and demands of the ever-growing ad serving business and in the process turned
out to be a good strategy for other problems that don't have real-time requirements,
but want the ability to avoid the complex and slow object-relational mapping prob-
lems of traditional systems.
As well as being used as a basis for banner ad serving, MongoDB can be used in
some of the following use cases:
Content management —Store web content and photos and use tools such as geolo-
cation indexes to find items.
Real-time operational intelligence —Ad targeting, real-time sentiment analysis, cus-
tomized customer-facing dashboards, and social media monitoring.
Product data management —Store and query complex and highly variable product
data.
Search WWH ::




Custom Search