Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Alvin Richards
Technical Director alvin@10gen.com @jonnyeight alvinonmongodb.com
http://bit.ly/OT71M4
http://bit.ly/QDUIUF
that enables agile development and is usable for a broad variety of applications
Consistency
Eventually Multi Master updates, resolve conflicts later
Immediately
Single Master updates, always consistent
memcached key/value
RDBMS
depth of functionality
9
Flexibility
Cost
10
that enables agile development and is usable for a broad variety of applications
11
shard01
shard02
shard03
13
shard01
shard02
shard03
a-i
j-r
s-z
14
Sharding - Splits
shard01
shard02
shard03
a-i
ja-jz k-r
s-z
15
Sharding - Splits
shard01
shard02
shard03
a-i
s-z
shard01
shard02
shard03
a-i js-jw
s-z
jz-r
shard01
shard02
shard03
a-i js-jw
ja-ji ji-js
s-z
jz-r
18
shard01
shard02
shard03
a-i js-jw
ja-ji ji-js
s-z
jz-r
19
shard01
shard02
shard03
a-i js-jw
ja-ji ji-js
s-z
jz-r
20
shard01
shard02
shard03
a-i js-jw
ja-ji ji-js
s-z
jz-r
21
shard01
shard02
shard03
a-i js-jw
ja-ji ji-js
s-z
jz-r
22
Sharding - Caching
96 GB Mem 3:1 Data/Mem
shard01
300 GB Data
shard01
300 GB Data
shard02
shard03
j-r
s-z
100 GB
24
100 GB
Sharding
Partitions data across many nodes
Scales Read & Writes
Replica Sets
App
Write Read
Primary
Asynchronous Replication
Secondary
Secondary
26
Replica Sets
App
Write Read
Primary
Secondary
Secondary
27
Replica Sets
App
Primary
Write Read Automatic Election of new Primary
Primary
Secondary
28
Replica Sets
App
Recovering
Write Read New primary serves data
Primary
Secondary
29
Replica Sets
App
Secondary
Write Read
Primary
Secondary
30
App
Read Write Read Read
Secondary
Primary
Secondary
31
Java example
ReadPreference pref = ReadPreference.primaryPreferred();! DBCursor cur = new DBCursor(collection, query, ! null, pref);!
32
Immediate Consistency
Thread #1
Insert Read Update Read Primary
v1
"
v2
"
33
Eventual Consistency
Thread #1
Insert Read Primary
v1
Secondary
Thread #2
v1 does not exist
"
"
v1
reads v1
"
34
Eventual Consistency
Thread #1
Insert Read Update Read Primary
v1
Secondary
Thread #2
v1 does not exist
"
v2
"
v1
reads v1
"
" "
v2
reads v1
"
35
reads v2
Journal
async
sync
More
Text Search
Search by word, phrase, stemming, stop words Use cases: Consistent text search
37
that enables agile development and is usable for a broad variety of applications
38
Data Model
Why JSON?
Simple, well understood encapsulation of data Maps simply to objects in your OO language Linking & Embedding to describe relationships
39
40
start transaction! insert into comments (...)! update posts ! set comment_count = comment_count + 1! where post_id = 123! commit!
!
posts authors
41
start transaction! insert into comments (...)! update posts ! set comment_count = comment_count + 1! where post_id = 123! commit!
!
posts authors
server a
server b
server c
42
43
server a
server b
server c
44
Schemas in MongoDB
Examples
// Find the object! > db.blogs.find( { text: "Destination Moon" } )! ! // Find posts with tags! > db.blogs.find( { tags: { $exists: true } } )! ! // Regular expressions: posts where author starts with h! > db.blogs.find( { author: /^h/i } )! ! // Counting: number of posts written by Herg! > db.blogs.find( { author: "Herg" } ).count() !
46
Data Manipulation
Conditional Query Operators
Scalar: $ne, $mod, $exists, $type, $lt, $lte, $gt, $gte, $ne Vector: $in, $nin, $all, $size
47
that enables agile development and is usable for a broad variety of applications
49
Data Hub
50
that enables agile development and is usable for a broad variety of applications
51
190+ employees
500+ customers
Offices in New York, Palo Alto, Washington DC, London, Dublin, Barcelona and Sydney
52
Consulting
Expert Resources for All Phases of MongoDB Implementations
Training
Online and In-Person for Developers and Administrators
53
Indeed.com Trends
Top Job Trends 1. HTML 5 2. MongoDB 3. iOS 4. Android 5. Mobile Apps 6. Puppet 7. Hadoop 8. jQuery 9. PaaS 10. Social Media
54
2.0 Sept 11
2.2 Aug 12
2.4 March 13
Kerberos/SASL Hash Shard Key V8 Intersecting polygons Aggregation enhancements Text Search
Index enhancements Aggregation to improve size and Framework performance Multi-Data Center Authentication with Deployments sharded clusters Improved Replica Set Enhancements Concurrency improvements
55
download at mongodb.org
http://bit.ly/mongoC((
Facebook((((((((((|(((((((((Twitter(((((((((|(((((((((LinkedIn(
@mongodb(
http://linkd.in/joinmongo(