MongoDB for Oracle Experts - OUGF Harmony 2014

31
MongoDB The Database for Modern Applications Solutions Architect, MongoDB Henrik Ingo

description

A lightweight MongoDB introduction presented to some of the most senior Oracle experts in the Nordics.

Transcript of MongoDB for Oracle Experts - OUGF Harmony 2014

Page 1: MongoDB for Oracle Experts - OUGF Harmony 2014

MongoDBThe Database for Modern Applications

Solutions Architect, MongoDB

Henrik Ingo

Page 2: MongoDB for Oracle Experts - OUGF Harmony 2014

2

The 70s...

Page 3: MongoDB for Oracle Experts - OUGF Harmony 2014

3

1979: Sony Walkman

Page 4: MongoDB for Oracle Experts - OUGF Harmony 2014

4

1974: Post-it notes

Page 5: MongoDB for Oracle Experts - OUGF Harmony 2014

5

1971: First Man on the Moon

Page 6: MongoDB for Oracle Experts - OUGF Harmony 2014

6

1966: Telefax (popularized during the 70s)

Page 7: MongoDB for Oracle Experts - OUGF Harmony 2014

7

1977: Apple II, the first PC

Page 8: MongoDB for Oracle Experts - OUGF Harmony 2014

8

The Relational Database

Page 9: MongoDB for Oracle Experts - OUGF Harmony 2014

Things the RDBMS is optimized for...

Page 10: MongoDB for Oracle Experts - OUGF Harmony 2014

10

Disk space

Page 11: MongoDB for Oracle Experts - OUGF Harmony 2014

11

Data integrity

Page 12: MongoDB for Oracle Experts - OUGF Harmony 2014

12

Waterfall Development Cycle

Business

RequirementssAnalysis

Technical

Requirements

DataBase

Schema

Design

Software

DevelopmentQA

Production

Page 13: MongoDB for Oracle Experts - OUGF Harmony 2014

13

Flexibility (seriously)

/* ---------------------------------- *//* ----- Begin the PL/SQL block ----- *//* ---------------------------------- */EXEC SQL EXECUTE

DECLAREinsufficient_funds EXCEPTION;old_bal NUMBER;min_bal CONSTANT NUMBER := 500;

BEGINSELECT 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_balWHERE account_id = :acct;

INSERT INTO journalVALUES (:acct, 'Debit', :debit, SYSDATE);

:status := 'Transaction completed.';ELSE

RAISE insufficient_funds;END IF;....

Page 14: MongoDB for Oracle Experts - OUGF Harmony 2014

The reality in 2014...

Page 15: MongoDB for Oracle Experts - OUGF Harmony 2014

15

Business logic in PL/SQL is not a best practice

?

Page 16: MongoDB for Oracle Experts - OUGF Harmony 2014

16

RDBMS is a poor match to OO

Relational

Database

Object Relational

MappingApplication

Code XML Config DB Schema

Page 17: MongoDB for Oracle Experts - OUGF Harmony 2014

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, … }

}

}

Page 18: MongoDB for Oracle Experts - OUGF Harmony 2014

18

Developers are more productive

Page 19: MongoDB for Oracle Experts - OUGF Harmony 2014

19

Iterative development

Business

Requirementss

Rapid

PrototypingReview

Production

Page 20: MongoDB for Oracle Experts - OUGF Harmony 2014

20

Data exists in diverse sources......beyond our control, btw.

social media

sensors

Legacy

RDBMSLegacy

RDBMSLegacy

RDBMS

Page 21: MongoDB for Oracle Experts - OUGF Harmony 2014

Big Data?

Page 22: MongoDB for Oracle Experts - OUGF Harmony 2014

22

Big Data is all about

Volume

Velocity

Variety

Page 23: MongoDB for Oracle Experts - OUGF Harmony 2014

23

You want a DB that has

Volume

Velocity

Variety

Scale-out

Low latency

Flexible schema

Page 24: MongoDB for Oracle Experts - OUGF Harmony 2014

Typical MongoDB projects

for Oracle experts

Page 25: MongoDB for Oracle Experts - OUGF Harmony 2014

25

Data Hub

CRM CRM CRM

MongoDB

Dashboard

Page 26: MongoDB for Oracle Experts - OUGF Harmony 2014

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

Page 27: MongoDB for Oracle Experts - OUGF Harmony 2014

27

Staging hub

MongoDB

RDBMSsystems

RDBMS

Staging,Data preparation

DWH

Graphing SW

Page 28: MongoDB for Oracle Experts - OUGF Harmony 2014

28

Archive

Archive

App

(MySQL)

Page 29: MongoDB for Oracle Experts - OUGF Harmony 2014

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

Page 30: MongoDB for Oracle Experts - OUGF Harmony 2014

30

Branch out

MongoDB

RDBMS

app

OriginalDB

New functionalityor Big Data

Page 31: MongoDB for Oracle Experts - OUGF Harmony 2014