2. mongoDB {name: “mongo”, type: “DB”} Got it name from? humongous (very big, [= enormous]) Document-oriented storage ? JSON-style documents.(BSON) Dynamic schemas. Scalable, High availability. mongos: automatic sharding replica set: automatic failover Open source GNU Affero General Public License Full Index Support Compound Keys Indexes Background Index Building
4. Try mongoDB: A Simple Way Using Tiny mongoDB Brower Shell Visit www.mongodb.org => TRY IT OUT
5. Try mongoDB: Shell Example MongoDB browser shell version: 0.1.0 connecting to random database type "help" for help type "tutorial" to start the tutorial > a = {name: "mongo", type: "DB"} { "name" : "mongo", "type" : "DB" } > db.mycollection.save(a); "ok" > db.mycollection.update({name: "mongo"}, {$set: {license: "AGPL"}}); "ok" > db.mycollection.find();[ { "name" : "mongo", "license" : "AGPL", "type" : "DB", "_id" : { "$oid" : "4c665f61cc937415bd001308" } }] >
6. Use mongoDB: Strong Side Schemaless No need to backup SQL script Available when started Full Index Support RDBMS-style indexes Background index building High Performance Cache disk file
7. Use mongoDB: Feature Comparatively Consumptive Memory (BSON) Bandwidth (BSON) Disk (BSON) No Transaction Support Consistency cannot be achieved No transaction isolation
8. Use mongoDB: BSON in Brief {“hello”: “world”} 16000000 length 02 property type hello00 property name 06000000world00 property value 00 a EOF
11. Use mongoDB: Attention Manipulation result not returned Get last error after every operation Server-side cursor If used, read till the last record of a query result or kill the cursor. Take whole control of cursor.
12. Your mongoDB: Capacity Planning How about the performance of your server? (memorypuandwidthisk…) The size of your record? (not your origin object size, but the BSON object size) How much records do you want to hold on single server? (now? future?) TPS under different operations? (insertelect…)
13. Your mongoDB: Code Tuning Learn to use several tools (SConstructS2010macs…). Analyze source code. Debug it. Find the bottleneck and the codes related. Modify as less as possible. Recompile and retest.
14. Your mongoDB: Amoeba for mongoDB mongos’ssharding is based on chunk. A chunk represent a range of records. In most cases, IDs cannot be sharded horizontally in this way. 8298701 149809762 1987093 0 4032987 7298610 11098726 DB1 DB2 DB3
15. Your mongoDB: Amoeba for mongoDB Like Amoeba for MySQL, Amoeba for mongoDB will provide full control of sharding rules.(by hashangeunction… horizontallyvertically) Better failover. Write multiple copy of data to several nodes. (instead of replication)