View
2.456
Download
1
Category
Tags:
Preview:
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
Revolutionizing Application Development With MongoDB
Solutions Architect, MongoDB
Jay Runkel
#MongoDB
• What can go wrong?– Plus, some success stories
• Why are relational projects difficult?
• Why more successful with MongoDB?
Agenda
Part 1 – What can go wrong? (and how MongoDB customers got it right)
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
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
The problem is in the foundation
Lets look at a few organizations that chose a different foundation
RDBMS
Your Application
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
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
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
Part 2 – Challenges of Relational Development
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
But, some things are hard to model
Let’s look at a product catalog:
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
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
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
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
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
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
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
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
What about this product?
One product = a set of products
Lists are hard
Need more tables
Product
Properties
Sub Products
Add this product?
More complexity
There are solutions
Designing/redesigning takes time
More tables?
This is hard…
Long time to develop…
Difficult to change…
Queries are complex…
What happens when there are new requirements?
It is hard to iterate
New Table
New Table
New Colum
n
Name PetPhon
eEmail
New Colum
n
3 months later…
Have to Manage Changes in 3 Places
Relational Database
Object Relational Mapping
Application
Code XML Config DB Schema
What if we need to scale? (Scale Up)
Part 3 - Application Development is simpler
in 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: […]
} ] }
Let’s go back to our product catalog
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
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
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
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
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
Document flexibility makes life easy…
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
}
MongoDB: Adapting to new requirements
meta meta meta meta
…
meta meta meta meta
Legacy data
New data
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
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
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” } )
Performance/Scalability
Scaling in MongoDB is easy
And it is not expensive
Horizontal Scalability (Scale Out)
Sharding
Key Range0..100
Mongod
Read/Write Scalability
Sharding
Key Range0..40
Mongod
Key Range40..100
Mongod
Read/Write Scalability
Sharding
Key Range0..24
Mongod
Key Range25..40
Mongod
Key Range41..70
Mongod
Key Range71..100
Mongod
Read/Write Scalability
Summary
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
Life is simpler with MongoDB
• Flexible Document Model
• Easily supports
• New data • Changing requirements
• Developer friendly
• Scales horizontially
• Low cost RDBMS
Your Application
Follow the lead…
And over 600 other organizations…
Questions?
Thank You
Solutions Architect, MongoDB
Jay Runkeljay.runkel@mongodb.com@jayrunkel
#MongoDB
Recommended