53
Revolutionizing Application Development With MongoDB Solutions Architect, MongoDB Jay Runkel #MongoDB

Webinar: Revolutionizing Application Development with MongoDB

  • Upload
    mongodb

  • View
    2.457

  • Download
    1

Embed Size (px)

DESCRIPTION

Application development with relational databases is time consuming, expensive, and has a high risk of failure. This is due to constantly evolving requirements, agile development processes, scalability and performance needs, and cloud-based architectures. MongoDB, the leading NoSQL database, offers flexibility, scalability, and performance to greatly increase the success of modern application development. In this webinar we will provide an introduction of MongoDB focusing on its benefits for project success, such as: * Faster time to market * Lower development costs * Improved customer experience

Citation preview

Page 1: Webinar: Revolutionizing Application Development with MongoDB

Revolutionizing Application Development With MongoDB

Solutions Architect, MongoDB

Jay Runkel

#MongoDB

Page 2: Webinar: Revolutionizing Application Development with MongoDB

• What can go wrong?– Plus, some success stories

• Why are relational projects difficult?

• Why more successful with MongoDB?

Agenda

Page 3: Webinar: Revolutionizing Application Development with MongoDB

Part 1 – What can go wrong? (and how MongoDB customers got it right)

Page 4: Webinar: Revolutionizing Application Development with MongoDB

Projects Fail

1. Never get to initial version?

2. Initial success, but then can’t scale?

3. Initial success, but new requirements derail them?

4. Application development is slow

Page 5: Webinar: Revolutionizing Application Development with MongoDB

Common Reasons

1. Working with unstructured or semi-structure data

2. Polymorphic data

3. Disparate data from multiple sources

4. Platform not architected for scale

5. Development environment does meet developers needs

Page 6: Webinar: Revolutionizing Application Development with MongoDB

The problem is in the foundation

Lets look at a few organizations that chose a different foundation

RDBMS

Your Application

Page 7: Webinar: Revolutionizing Application Development with MongoDB

Delivers agile automated supply chain service to retailers powered by MongoDB

Example 1 – Managing Diverse Products

Problem Why MongoDB Results

• RDBMS poorly-equipped to handle varying data types (e.g., SKUs, images)

• Inefficient use of storage in RDBMS (i.e., 90% empty columns)

• Complex joins degraded performance

• Document-oriented model less complex, easier to code

• Single data store for structured, semi-structured and unstructured data

• Scalability and availability

• Analytics with MapReduce

• Decreased supplier onboard time by 12x

• Grew from 400K records to 40M in 12 months

• Significant cost reductions on schema design time, ongoing developer effort, and storage usage

Page 8: Webinar: Revolutionizing Application Development with MongoDB

Example 2 – Multiple Data Sources

The Wall– 360° real-time view of 100M

customers– 70 siloed systems– Tried for 2 years on RDBMS– Massive TCO savings– $300M commitment to Big Data

• Why MongoDB?– Flexible data model– Fast app development

Page 9: Webinar: Revolutionizing Application Development with MongoDB

Stores billions of posts in myriad formats with MongoDB

Example 3 - Scalability

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 10: Webinar: Revolutionizing Application Development with MongoDB

Part 2 – Challenges of Relational Development

Page 11: Webinar: Revolutionizing Application Development with MongoDB

Relational: All Data is Column/Row

Customer ID First Name Last Name City0 John Doe New York1 Mark Smith San Francisco2 Jay Black Newark3 Meagan White London4 Edward Daniels Boston

Account Number Branch ID Account Type Customer ID10 100 Checking 011 101 Savings 012 101 IRA 013 200 Checking 114 200 Savings 115 201 IRA 2

Page 12: Webinar: Revolutionizing Application Development with MongoDB

But, some things are hard to model

Let’s look at a product catalog:

Page 13: Webinar: Revolutionizing Application Development with MongoDB

Baseball Bat

-3 length to weight ratio

2-5/8" barrel diameter

Two-piece construction

R2 alloy barrel provides outstanding durability, performance and "pop"

R2 composite handle shifts weight into the bat's knob for ultra-fast swing speeds

Rifle Barrel design removes weight from the barrel for thinner wall thickness

Acoustic barrel offers that sweet-sounding "ping"

Contact grip helps eliminate sting and vibration

AIR Elite is RIP-IT's® fastest BBCOR bat and the one with the most performance

BBCOR certified - approved for high school and collegiate play

Includes RIP-IT's® "Love It Or Return It" 30 Day Refund Policy with free return shipping

Manufacturer's warranty: 400 days

Made in the USA

Model: B1403E

Page 14: Webinar: Revolutionizing Application Development with MongoDB

Bat Product TableCateg

oryModel Name

Brand

Length to

weight ratio

Barrel Dia

Type BarrelHandl

eCert.

Country

Price

Bat B1403E Air Elite RIP-IT -3 2 5/8Composi

teR2

Alloy

R2 compos

ite BBCOR USA$399.9

9

Bat B1403 Prototype RIP-IT -3 2 5/8One-piece

R1 Alloy

R1 Alloy BBCOR USA

$199.99

Bat MCB1B OneMaruc

ci -3 2 5/8One-piece

AZ3000 alumin

um

AZ3000 alumin

um BBCORImporte

d$199.9

9

Bat BB14S1 S1Easto

n -3 2 5/8Composi

te IMX

SIC Black

Carbon BBCOR China$399.9

9

Page 15: Webinar: Revolutionizing Application Development with MongoDB

Lets Add Gloves

Size: 12"

Infield/Outfield/Pitcher model

2-Piece Web pattern

Most popular MLB® pattern among pitchers

Pro Stock® American steerhide leather offers rugged durability and a superior feel

Dual-Welting™ on "exposed edges" of the fingers helps maintain pocket shape and durability

Pro Stock™ hand-designed pattern for unbeatable craftsmanship

Dri-Lex® ultra-breathable wrist lining repels moisture from your hand

Black leather with rich brown embellishments

Pattern: B212

Model: WTA2000BBB212

Wilson

Page 16: Webinar: Revolutionizing Application Development with MongoDB

Bat and Glove Product TableCateg

oryModel Name Brand

Length to

weight ratio

Barrel Dia

Type Barrel Handle Cert.Countr

yPrice

Bat B1403E Air Elite RIP-IT -3 2 5/8Composi

teR2

Alloy

R2 compos

ite BBCOR USA$399.9

9

Bat B1403Prototy

pe RIP-IT -3 2 5/8One-piece

R1 Alloy R1 Alloy BBCOR USA

$199.99

Bat MCB1B One Marucci -3 2 5/8One-piece AL AL BBCOR

Imported

$199.99

Bat BB14S1 S1 Easton -3 2 5/8Composi

te IMX

SIC Black

Carbon BBCOR China$399.9

9 Categ

oryModel Name Brand Size Position

Pattern

Web Patter

n

Material

ColorCountr

yPrice

Glove

WTA2000BBB2

12 A2000 Wilson 12" Infield B212 2-piece Leather blackVietna

m$299.9

9

GlovePRO11

2PTHOH Pro

Rawlings

11.25" Outfield

Pro taper

Modified Trap-

Eze

Horween

Leather black China$229.9

9

Page 17: Webinar: Revolutionizing Application Development with MongoDB

Add some baseballs

Cover: Full grain leather for excellent durability

Core: Cushioned cork core

Additions/Technologies: Made to the exact specifications of MLB

Stitching/Seams: 108 classic red stitches/Rawlings® Major League seaming

League/Certification(s): MLB

Balls included per purchase: individual

Recommended Age: All ages

Model : ROMLB

Rawlings

Page 18: Webinar: Revolutionizing Application Development with MongoDB

Bat and Glove and Ball Product Table

Category

Model NameBran

d

Length to

weight ratio

Barrel

DiaType Barrel Handle Cert.

Country

Price

Bat B1403E Air Elite RIP-IT -3 2 5/8Composit

eR2

Alloy

R2 composit

eBBCO

R USA$399.9

9

Bat B1403Prototyp

e RIP-IT -3 2 5/8One-piece

R1 Alloy R1 Alloy

BBCOR USA

$199.99

Bat MCB1B OneMaruc

ci -3 2 5/8One-piece AL AL

BBCOR

Imported

$199.99

Bat BB14S1 S1Easto

n -3 2 5/8Composit

e IMXSIC Black Carbon

BBCOR China

$399.99 Categ

oryModel Name Brand Size

Position

Pattern

Web Patter

n

Material

ColorCountr

yPrice

Glove

WTA2000BBB2

12 A2000 Wilson 12" Infield B212 2-piece Leather blackVietna

m$299.9

9

GlovePRO11

2PTHOH Pro

Rawlings 11.25"

Outfield

Pro taper

Modified Trap-

Eze

Horween

Leather black China$229.9

9 Categ

oryModel Name Brand Color Cover Core Cert.

Country

Price

Baseball

DICRLLB1PBG

Little League

Rawlings white Leather

Corkrubber

Little League China $4.99

Baseball ROML MLB

Rawlings white Leather cork China $6.99

Page 19: Webinar: Revolutionizing Application Development with MongoDB

Sparse Table

Category Model Name Brand

Length to

weight ratio

Barrel Dia Type Barrel

Handle

Certification

Country Price Size

Position

Pattern

Web Patter

n

Material Color Cover Core

Bat B1403E Air Elite RIP-IT -3 2 5/8 Composite R2 Alloy R2 composite BBCOR USA $399.99

Bat B1403 Prototype RIP-IT -3 2 5/8 One-piece R1 Alloy R1 Alloy BBCOR USA $199.99

Bat MCB1B One Marucci -3 2 5/8 One-pieceAZ3000 aluminum

AZ3000 aluminum BBCOR Imported $199.99

Bat BB14S1 S1 Easton -3 2 5/8 Composite IMXSIC Black Carbon BBCOR China $399.99

GloveWTA2000BBB212 A2000 Wilson Vietnam $299.99 12" Infield B212 2-piece Leather black

Glove PRO112PT HOH Pro Rawlings China $229.99 11.25" Outfield Pro taperModified Trap-Eze

Horween Leather black

Baseball DICRLLB1PBG Little League Rawlings Little League China $4.99 white Leathercork and rubber

Baseball ROML MLB Rawlings China $6.99 white Leather cork

Continue adding columns as you add new products

Page 20: Webinar: Revolutionizing Application Development with MongoDB

Maybe this design will work better prodI

Dpropert

y value

1length/weight -3

1barrel

dia 2 5/8

1 typecompos

ite

1certificati

on BBCOR

…5 size 125 position infield5 pattern B2125 material leather5 color black

…8 color white8 cover leather8 core cork

prodID

Category Model Name Brand Countr

y Price

1 Bat B1403E Air Elite RIP-IT USA$399.9

9

2 Bat B1403Prototyp

e RIP-IT USA$199.9

9

3 Bat MCB1B One MarucciImporte

d$199.9

9

4 Bat BB14S1 S1 Easton China$399.9

9

5 Glove

WTA2000BBB2

12 A2000 WilsonVietna

m$299.9

9

6 GlovePRO112

PT HOH ProRawling

s China$229.9

9

7Baseb

allDICRLLB1PBG

Little League

Rawlings China $4.99

8Baseb

all ROML MLBRawling

s China $6.99

Page 21: Webinar: Revolutionizing Application Development with MongoDB

What about this product?

One product = a set of products

Lists are hard

Need more tables

Product

Properties

Sub Products

Page 22: Webinar: Revolutionizing Application Development with MongoDB

Add this product?

More complexity

There are solutions

Designing/redesigning takes time

More tables?

Page 23: Webinar: Revolutionizing Application Development with MongoDB

This is hard…

Long time to develop…

Difficult to change…

Queries are complex…

Page 24: Webinar: Revolutionizing Application Development with MongoDB

What happens when there are new requirements?

Page 25: Webinar: Revolutionizing Application Development with MongoDB

It is hard to iterate

New Table

New Table

New Colum

n

Name PetPhon

eEmail

New Colum

n

3 months later…

Page 26: Webinar: Revolutionizing Application Development with MongoDB

Have to Manage Changes in 3 Places

Relational Database

Object Relational Mapping

Application

Code XML Config DB Schema

Page 27: Webinar: Revolutionizing Application Development with MongoDB

What if we need to scale? (Scale Up)

Page 28: Webinar: Revolutionizing Application Development with MongoDB

Part 3 - Application Development is simpler

in MongoDB

Page 29: Webinar: Revolutionizing Application Development with MongoDB

Instead Match the Data in your Application

Relational MongoDB{ customer_id : 1,

first_name : "Mark",last_name : "Smith",city : "San Francisco",accounts : [ {

account_number : 13,branch_ID : 200,account_type :

"Checking"},{ account_number : 14,

branch_ID : 200,account_type :

”IRA”,beneficiaries: […]

} ] }

Page 30: Webinar: Revolutionizing Application Development with MongoDB

Let’s go back to our product catalog

Page 31: Webinar: Revolutionizing Application Development with MongoDB

How would we model this in MongoDB?

Size: 12"

Infield/Outfield/Pitcher model

2-Piece Web pattern

Most popular MLB® pattern among pitchers

Pro Stock® American steerhide leather offers rugged durability and a superior feel

Dual-Welting™ on "exposed edges" of the fingers helps maintain pocket shape and durability

Pro Stock™ hand-designed pattern for unbeatable craftsmanship

Dri-Lex® ultra-breathable wrist lining repels moisture from your hand

Black leather with rich brown embellishments

Pattern: B212

Model: WTA2000BBB212

Wilson

Page 32: Webinar: Revolutionizing Application Development with MongoDB

We use a document

{category: “glove”,model: “PRO112PT”,name: “Air Elite”,brand: “Rawlings”,price: 229.99,available: Date(“2013-03-

31”)}

FieldsValues

Field values are typed

string

number

date

Page 33: Webinar: Revolutionizing Application Development with MongoDB

Documents are rich structures

{category: “glove”,model: “PRO112PT”,name: “Air Elite”,brand: “Rawlings”,price: 229.99,available: Date(“2013-03-

31”),position: [“infield”,

“outfield”, “pitcher”]}

Fields can contain arrays

Page 34: Webinar: Revolutionizing Application Development with MongoDB

Documents are rich structures

{category: “glove”,model: “PRO112PT”,name: “Air Elite”,brand: “Rawlings”,price: 229.99,available: Date(“2013-03-

31”),position: [“infield”,

“outfield”, “pitcher”],endorsed: {name: “Ryan

Howard”, team:

“Phillies”, position:

“first base”},}

Fields can contain sub-documents

Page 35: Webinar: Revolutionizing Application Development with MongoDB

Documents are rich structures{

category: “glove”,model: “PRO112PT”,name: “Air Elite”,brand: “Rawlings”,price: 229.99,available: Date(“2013-03-31”),position: [“infield”, “outfield”, “pitcher”],endorsed: {name: “Ryan Howard”,

team: “Phillies”, position: “first base”},

history: [{date: Date(“2013-03-31”), price: 279.99},

{date: Date(“2013-06-01”), price: 259.79},

{date: Date(“2013-08-15”), price: 229.99}]}

Fields can contain an array of sub-documents

Page 36: Webinar: Revolutionizing Application Development with MongoDB

Document flexibility makes life easy…

Page 37: Webinar: Revolutionizing Application Development with MongoDB

Variation is easy with document model

{category: bat,model: B1403E,name: Air Elite,brand: “Rip-IT”,price: 399.99

diameter: “2 5/8”,

barrel: R2 Alloy,handle: R2

Composite,type: composite,

}

{

category: glove,model:

PRO112PT,name: Air Elite,brand:

“Rawlings”,price: “229.99”

size: 11.25,position:

outfield,pattern: “Pro

taper”,material:

leather,color: black

}

{category: ball,model: ROML,name: MLB,brand:

“Rawlings”,price: “6.99”

cover: leather,core: cork,color: white

}

Page 38: Webinar: Revolutionizing Application Development with MongoDB

MongoDB: Adapting to new requirements

meta meta meta meta

meta meta meta meta

Legacy data

New data

Page 39: Webinar: Revolutionizing Application Development with MongoDB

Life is much easier for developers

Application

Code

Relational Database

Object Relational Mapping

XML Config DB Schema

Application

Code

Rich Queries

Geospatial

Text Search

Map Reduce

Aggregation

Page 40: Webinar: Revolutionizing Application Development with MongoDB

Write queries using familiar language

Shell

Command-line shell for

interacting directly with

database

DriversDrivers for most popular programming languages and frameworks

> db.collection.insert({company:“10gen”, product:“MongoDB”})> > db.collection.findOne(){

“_id”: ObjectId(“5106c1c2fc629bfe52792e86”),“company”: “10gen”“product”: “MongoDB”

}

Java

Python

Perl

Ruby

Haskell

JavaScript

Page 41: Webinar: Revolutionizing Application Development with MongoDB

Queries are easier to develop

{

category: “glove”,

model: “PRO112PT”,

name: “Air Elite”,

brand: “Rawlings”,

price: 229.99,

available: Date(“2013-03-31”),

position: [“infield”, “outfield”, “pitcher”],

endorsed: {name: “Ryan Howard”,

team: “Phillies”,

position: “first base”},

}

> db.products.find( { “position” : “infield”, “endorsed.team” :

“Phillies” } )

Page 42: Webinar: Revolutionizing Application Development with MongoDB

Performance/Scalability

Page 43: Webinar: Revolutionizing Application Development with MongoDB

Scaling in MongoDB is easy

And it is not expensive

Page 44: Webinar: Revolutionizing Application Development with MongoDB

Horizontal Scalability (Scale Out)

Page 45: Webinar: Revolutionizing Application Development with MongoDB

Sharding

Key Range0..100

Mongod

Read/Write Scalability

Page 46: Webinar: Revolutionizing Application Development with MongoDB

Sharding

Key Range0..40

Mongod

Key Range40..100

Mongod

Read/Write Scalability

Page 47: Webinar: Revolutionizing Application Development with MongoDB

Sharding

Key Range0..24

Mongod

Key Range25..40

Mongod

Key Range41..70

Mongod

Key Range71..100

Mongod

Read/Write Scalability

Page 48: Webinar: Revolutionizing Application Development with MongoDB

Summary

Page 49: Webinar: Revolutionizing Application Development with MongoDB

Relational DBs don’t work for modern applications

• Application foundation doesn’t support data requirements

• Product catalog• Integrating data from multiple systems

• Developers manage lots of complexity

• Change is onerous

• Scaling is expensive

RDBMS

Your Application

Page 50: Webinar: Revolutionizing Application Development with MongoDB

Life is simpler with MongoDB

• Flexible Document Model

• Easily supports

• New data • Changing requirements

• Developer friendly

• Scales horizontially

• Low cost RDBMS

Your Application

Page 51: Webinar: Revolutionizing Application Development with MongoDB

Follow the lead…

And over 600 other organizations…

Page 52: Webinar: Revolutionizing Application Development with MongoDB

Questions?

Page 53: Webinar: Revolutionizing Application Development with MongoDB

Thank You

Solutions Architect, MongoDB

Jay [email protected]@jayrunkel

#MongoDB