MongoDB

281 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
281
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

MongoDB

  1. 1. GROUP 1 | CMPE 281 | SJSU
  2. 2. WHAT IS MONGODB? ● HYBRID, INDEXABLE, DOCUMENT-ORIENTED ● REPLICATION, AUTO-SHARDING, MAP/REDUCE ● PARTIALLY STRUCTURED, NOT ENFORCED ● QUERY DATA, NO UNIQUE IDENTIFIER ● USES BINARY PROTOCOL Sai
  3. 3. DESIGN FEATURES ● MAXIMUM AVAILABILITY ● EVENTUAL CONSISTENCY ● STAND-ALONE (SINGLE INSTANCE) VS. “SHARDED” ● MASTER-SLAVE APPROACH ● CONFIG SERVERS (MANAGERS) ● PROXIES (GATEWAY TO DATA) Sai
  4. 4. STRUCTURE • MONGOD: STORES DATA, BASIC PROCESS (STANDALONE, SHARDED) • CONFIG-MONGOD: STORES LOCATION AND SIZE OF SHARDS • MONGOS: PROXY ACCESSED BY USER (STATELESS) Christoph
  5. 5. STRUCTURE Christoph
  6. 6. WRITE CONCERNS • 13 MODES • NORMAL: RETURN AFTER FORWARDED • SAFE: RETURN AFTER ONE STORED (RAM) • FSYNC_SAFE: RETURN AFTER ONE STORED (PERSISTENT STORAGE) • NONE: RETURN IMMEDIATELY • (IGNORE_ERROR, REPLICA_ACKNOWLEDGED, …) Christoph
  7. 7. CONSISTENCY • CONFIG SERVERS o o SYNCHRONOUS REPLICATION o • TWO-PHASE COMMIT READ-ONLY MODE IN EVENT OF FAILURE SHARDS o REPLICATED NODES o SELF AUTO LOAD BALANCING Chi
  8. 8. SCALING ● ADDING SHARDING SERVERS ● ADDING CONFIG SERVERS ● ADDING PROXIES ● TUNING CONSISTENCY Chi
  9. 9. TRADE OFFS • AVAILABILITY AT THE PRICE OF CONSISTENCY • MULTIPLE NODES WITH EVENTUAL CONSISTENCY • PRE-ALLOCATION VS. FILE SYSTEM FRAGMENTATION Chi
  10. 10. TRADE OFFS Sai
  11. 11. DEMO
  12. 12. starting the service starting the prompt
  13. 13. getting info about current database showing other available databases switching to database (created if not existent)
  14. 14. inserting documents defining documents
  15. 15. performing query without criteria performing query with simple criteria using $in command
  16. 16. performing query with nested command using $in and $or updating entry matching specific criteria (adding field “age”)
  17. 17. removing entry matching criteria from database

×