The document discusses using MongoDB as a document store for building a landing page hosting platform. It outlines some of the limitations of using SQL and ActiveRecord for this use case, and how MongoDB's flexible document model and horizontal scaling capabilities make it a better fit. Key features of MongoDB that are highlighted include its support for dynamic schemas, embedded collections, and easy aggregation.
1 of 24
Download to read offline
More Related Content
How I Learned to Stop Worrying and Love the Document Store
1. HOW I LEARNED TO
STOP WORRYING AND
LOVE THE DOCUMENT STORE
COREY EHMKE
2. IN A PREVIOUS LIFE...
BUILDING A PPC LANDING PAGE HOSTING PLATFORM
INTERACTION-LEVEL ANALYTICS
A/B AND MULTIVARIATE TESTING
DYNAMIC PAGE CONTENT
REQUIREMENT FOR REAL-TIME REPORTING
3. DOES THIS SOUND FAMILIAR?
MODELS CONSTANTLY EVOLVING IN RESPONSE TO ILL-
DEFINED REQUIREMENTS AND CHANGING NEEDS
POLYMORPHIC REPRESENTATIONS OF USER
INTERACTIONS
VERSIONING TO SUPPORT MULTIVARIATE TESTING
REQUIREMENTS
NEED TO QUICKLY SCALE UP IN RESPONSE TO DEMAND
4. ACTIVE RECORD:
THE WRONG HAMMER
BIG DATA = PAINFUL MIGRATIONS
RAKE TASKS TO MANAGE DATA TRANSFORMATIONS
SINGLE TABLE INHERITANCE NIGHTMARE
CHALLENGE OF SCALING UP A SQL DATABASE
6. IN SHORT...
ACTIVE RECORD AND SQL
JUST DONT FEEL AGILE ENOUGH.
7. MONGODB TO THE RESCUE
DOCUMENT MODEL ALLOWS FOR THE EASY ADDITION OF
NEW FIELDS
EMBEDDED COLLECTIONS
BUILT-IN VERSIONING
MAP REDUCE FOR FAST DATA AGGREGATION
SCALING IS EASY
8. THE DESIGN PHILOSOPHY
DATA MODELS SHOULD BE EASY TO CODE, EASY TO
MANAGE, AND HIGHLY PERFORMANT
DATABASES SHOULD BE ABLE TO SCALE
HORIZONTALLY WITH EASE
13. PRACTICAL CONSIDERATIONS
STOP THINKING IN TABLES, START THINKING IN
DOCUMENTS
EMBEDDED COLLECTIONS, BUT USE CAREFULLY
FULLY CAPABLE OF TRADITIONAL RELATIONS
NO SCHEMAS, NO MIGRATIONS
NO SQL (USE JAVASCRIPT)
14. MONGOID
MY OBJECT-DOCUMENT-MAPPER (ODM) OF CHOICE
ACTIVEMODEL MAKES MONGOID DOCUMENTS
FIRST-CLASS CITIZENS IN RAILS
PARTIAL UPDATES (CHANGED FIELDS ONLY)
CHAINABLE, LAZY-EVALUATED QUERIES VIA CRITERIA
23. USE CASES
BIG DATA
(LOGS, ANYONE?)
COMPLEX QUERIES
(MAP REDUCE IS YOUR FRIEND)
RAPIDLY EVOLVING MODELS
LIBERAL USE OF JSON
RELATIONS THAT WANT TO BE EMBEDDED
(E.G. ORDERS <=> LINE ITEMS)
24. DONT USE IT IF...
YOURE WORKING WITH COMPLEX TRANSACTIONS
YOURE WORKING WITH MISSION-CRITICAL DATA
YOU ENJOY WRITING RAW SQL
YOU NEED TO QUICKLY PULL DATA OUT INTO A CSV
YOURE AFRAID OF NEW THINGS