MongoDB
The Database for Modern Applications
Solutions Architect, MongoDB
Henrik Ingo
2
The 70s...
3
1979: Sony Walkman
4
1974: Post-it notes
5
1971: First Man on the Moon
6
1966: Telefax (popularized during the 70s)
7
1977: Apple II, the first PC
8
The Relational Database
Things the RDBMS is optimized for...
10
Disk space
11
Data integrity
12
Waterfall Development Cycle
Business
Requirementss
Analysis
Technical
Requirements
DataBase
Schema
Design
Software
Development
QA
Production
13
Flexibility (seriously)
/* ---------------------------------- */
/* ----- Begin the PL/SQL block ----- */
/* ---------------------------------- */
EXEC SQL EXECUTE
DECLARE
insufficient_funds EXCEPTION;
old_bal NUMBER;
min_bal CONSTANT NUMBER := 500;
BEGIN
SELECT bal INTO old_bal FROM accounts
WHERE account_id = :acct;
-- If the account doesn't exist, the NO_DATA_FOUND
-- exception will be automatically raised.
:new_bal := old_bal - :debit;
IF :new_bal >= min_bal THEN
UPDATE accounts SET bal = :new_bal
WHERE account_id = :acct;
INSERT INTO journal
VALUES (:acct, 'Debit', :debit, SYSDATE);
:status := 'Transaction completed.';
ELSE
RAISE insufficient_funds;
END IF;
....
The reality in 2014...
15
Business logic in PL/SQL is not a best practice
?
16
RDBMS is a poor match to OO
Relational
Database
Object Relational
Mapping
Application
Code XML Config DB Schema
17
Document Data Model
Relational MongoDB
{
first_name: ‘Paul’,
surname: ‘Miller’,
city: ‘London’,
location:
[45.123,47.232],
cars: [
{ model: ‘Bentley’,
year: 1973,
value: 100000, … },
{ model: ‘Rolls Royce’,
year: 1965,
value: 330000, … }
}
}
18
Developers are more productive
19
Iterative development
Business
Requirementss
Rapid
Prototyping
Review
Production
20
Data exists in diverse sources...
...beyond our control, btw.
social media
sensors
Legacy
RDBMS
Legacy
RDBMS
Legacy
RDBMS
Big Data?
22
Big Data is all about
Volume
Velocity
Variety
23
You want a DB that has
Volume
Velocity
Variety
Scale-out
Low latency
Flexible schema
Typical MongoDB projects
for Oracle experts
25
Data Hub
CRM CRM CRM
MongoDB
Dashboard
26
Insurance leader generates coveted 360-degree view of
customers in 90 days – “The Wall”
Case
Problem Why MongoDB Results
• No single view of
customer
• 145 yrs of policy data,
70+ systems, 15+ apps
• 2 years, $25M trying to
aggregate in RDBMS –
failed
• Agility – prototype in 5
days; production in 90
days
• Dynamic schema & rich
querying – combine
disparate data into one
data store
• Hot tech to attract top
talent
• Increased call center
productivity
• Better customer
experience, reduced
churn, more upsell opps
• Dozens more projects in
the works to leverage
this data platform
27
Staging hub
MongoDB
RDBMS
systems
RDBMS
Staging,
Data preparation
DWH
Graphing SW
28
Archive
Archive
App
(MySQL)
29
Stores billions of posts in myriad formats
with MongoDB
Case
Problem Why MongoDB Results
• 1.5M posts per day,
different structures
• Inflexible MySQL,
lengthy delays for
making changes
• Data piling up in
production database
• Poor performance
• Flexible document-
based model
• Horizontal scalability
built in
• Easy to use
• Interface in familiar
language
• Initial deployment held
over 5B documents and
10TB of data
• Automated failover
provides high
availability
• Schema changes are
quick and easy
30
Branch out
MongoDB
RDBMS
app
Original
DB
New functionality
or Big Data
MongoDB for Oracle Experts - OUGF Harmony 2014

MongoDB for Oracle Experts - OUGF Harmony 2014