Kevin Bahr at Crumpeta ConsultingWondering what the pros and cons are for the two Many-to-many approaches (slides 41, 42). I'm assuming slide 41 there is less query time, but there is some more logic to updating/deleting of a category-product relationship. What makes more sense when scaling out? Thanks.1 year ago
Schema
Design
http://www.mongodb.org/
Tuesday, April 27, 2010
Three
Questions
Tuesday, April 27, 2010
What’s
the
basic
unit
of
data?
Tuesday, April 27, 2010
What’s
the
basic
unit
of
data?
Documents
Tuesday, April 27, 2010
How
can
we
query
and
manipulate
that
data?
Tuesday, April 27, 2010
How
can
we
query
and
manipulate
that
data?
Dynamic
Queries
Tuesday, April 27, 2010
How
can
we
query
and
manipulate
that
data?
Dynamic
Queries
Secondary
Indexes
Tuesday, April 27, 2010
How
can
we
query
and
manipulate
that
data?
Dynamic
Queries
Secondary
Indexes
Atomic
Updates
Tuesday, April 27, 2010
How
can
we
query
and
manipulate
that
data?
Dynamic
Queries
Secondary
Indexes
Atomic
Updates
Map-‐Reduce
Tuesday, April 27, 2010
Any
limitations?
Tuesday, April 27, 2010
Any
limitations?
No
Joins
Tuesday, April 27, 2010
What
are
our
application
access
patterns?
Tuesday, April 27, 2010
What
are
our
application
access
patterns?
Read
/
Write
Ratio
Tuesday, April 27, 2010
What
are
our
application
access
patterns?
Read
/
Write
Ratio
Types
of
updates
Tuesday, April 27, 2010
What
are
our
application
access
patterns?
Read
/
Write
Ratio
Types
of
updates
Range
of
Queries
Tuesday, April 27, 2010
General
Advice
Tuesday, April 27, 2010
1.
Use
Rich
Documents
Tuesday, April 27, 2010
Tuesday, April 27, 2010
Tuesday, April 27, 2010
Tuesday, April 27, 2010
Tuesday, April 27, 2010
Tuesday, April 27, 2010
Tuesday, April 27, 2010
Tuesday, April 27, 2010
Map-‐Reduce
Tuesday, April 27, 2010
wordnik.com
Tuesday, April 27, 2010
2. Simplify
Trivial
Relations
Tuesday, April 27, 2010
Tags
Tuesday, April 27, 2010
Tags
Tuesday, April 27, 2010
Tags
Tuesday, April 27, 2010
Votes
Tuesday, April 27, 2010
Adding
a
vote
Finding
all
votes
for
a
given
user
Tuesday, April 27, 2010
3. Modeling
Typical
Relations
Tuesday, April 27, 2010
post
-‐>
many
comments
post comments
post_id
user_id
tree attrs
Tuesday, April 27, 2010
1.
Embedded
Document
Tuesday, April 27, 2010
1.
Embedded
Document
Tuesday, April 27, 2010
2.
Embedded
and
Nested
Document
Tuesday, April 27, 2010
3.
Normalized
Collection
Tuesday, April 27, 2010
Use
Cases
1.
Embedded
document
Fast
queries
Document
always
appears
w/
parent.
2.
Embedded
&
nested
document
Complex
hierarchies
Document
appears
with
parent
3.
Normalized
Maximum
flexibility.
Simplified
global
updates.
Tuesday, April 27, 2010
many-‐to-‐many
products
join
product_id
category_id
categories
Tuesday, April 27, 2010
Products
and
Categories
Tuesday, April 27, 2010
Products
and
Categories
(Alternative)
Tuesday, April 27, 2010
4. Exercises
for
the
Viewer
Tuesday, April 27, 2010
Trees
http://www.mongodb.org/display/DOCS/Trees+in+MongoDB
Tuesday, April 27, 2010
Trees
http://www.mongodb.org/display/DOCS/Trees+in+MongoDB
Stacks,
Queues,
Lists
http://www.mongodb.org/display/DOCS/findandmodify+Command
Tuesday, April 27, 2010
Trees
http://www.mongodb.org/display/DOCS/Trees+in+MongoDB
Stacks,
Queues,
Lists
http://www.mongodb.org/display/DOCS/findandmodify+Command
Contribute!
http://cookbook.mongodb.org
Tuesday, April 27, 2010
Schema
Design
http://www.mongodb.org/
Tuesday, April 27, 2010
1–2 of 2 previous next