MongoDB                   Masakazu Matsushita                           @matsukaz2011   7   28
•              @matsukaz                •                • Ameba Pico                • DevLOVE2011   7   28
2011   7   28
Ameba Pico       •       • 2010   32011   7   28
(2011   7   )       •             390    MAU 60       • 10     20       •        3:7       •2011   7   28
2011   7   28
• MongoDB                • Ameba Pico                • MongoDB2011   7   28
MongoDB2011   7   28
Document-oriented storage       •       • BSON                       (Binary JSON)                > db.users.save( { name ...
Full Index Support       •                Index       • Unique Index         Index2011   7   28
Replication       • ReplicaSet                                mongod                               Member 1               ...
Replication       • ReplicaSet                              mongod                             Member 1                   ...
Replication       • ReplicaSet                                 mongod                                Member 1             ...
Replication       • ReplicaSet                                 mongod                                Member 1             ...
Auto-Sharding       •                            Shard Key                Shard 1                 users                   ...
Auto-Sharding       •                            Shard Key                Shard 1                         Shard 2         ...
Auto-Sharding       •                            Shard Key                Shard 1                         Shard 2         ...
Auto-Sharding       •                               Shard Key                Shard 1                                  Shar...
Ameba Pico2011   7   28
2011            1                               Shard 1                                                                   ...
2011            3                               Shard 1                                                                   ...
2011            5                               Shard 1                                                                   ...
2011            7                                Shard 1                                                                  ...
MongoDB2011   7   28
2011 22011   7   28
2011   7   28
2011   7   28
mongod                Repair2011   7   28
2011   7   28
2011   7   28
2011 32011   7   28
Shard2011   7   28
2011   7   28
2011   7   28
2011   7   28
2011   7   28
http://www.flickr.com/photos/andreasmarx/190619661/2011   7   28
62011   7   28
2011 52011   7   28
Shard                22011   7   28
OFF2011   7   28
MongoDB2011   7   28
2011   7   28
2011   7   28
2011   7   28
2   Shard2011   7   28
2011   7   28
2011   7   28
2011 62011   7   28
mongos2011   7   28
2011   7   28
2011 72011   7   28
MongoDB                1.6.5 → 1.8.22011   7   28
2011   7   28
2011   7   28
chunk                    chunk2011   7   28
http://www.flickr.com/photos/madhorse5/415958992/2011   7   28
2011   7   28
4   Shard2011   7   28
2011   7   28
2011   7   28
2011   7   28
2011   7   28
2011   7   28
2011   7   28
2011   7   28
Shard 2       EC22011   7   28
30       Repair2011   7   28
2011   7   28
mongod                12011   7   28
2011   7   28
2011   7   28
2011   7   28
2011   7   28
Upcoming SlideShare
Loading in...5
×

Mongo DBを半年運用してみた

51,759

Published on

MongoDBの簡単な概要と、Ameba PicoでMongoDBを半年運用した中で発生した障害など。

Published in: Technology, Education
1 Comment
73 Likes
Statistics
Notes
No Downloads
Views
Total Views
51,759
On Slideshare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
235
Comments
1
Likes
73
Embeds 0
No embeds

No notes for slide

Mongo DBを半年運用してみた

  1. 1. MongoDB Masakazu Matsushita @matsukaz2011 7 28
  2. 2. • @matsukaz • • Ameba Pico • DevLOVE2011 7 28
  3. 3. 2011 7 28
  4. 4. Ameba Pico • • 2010 32011 7 28
  5. 5. (2011 7 ) • 390 MAU 60 • 10 20 • 3:7 •2011 7 28
  6. 6. 2011 7 28
  7. 7. • MongoDB • Ameba Pico • MongoDB2011 7 28
  8. 8. MongoDB2011 7 28
  9. 9. Document-oriented storage • • BSON (Binary JSON) > db.users.save( { name : "hoge", age : 20 } ) > db.users.save( { name : "fuga" } ) > db.users.find() { "_id" : ObjectId("4d6b7ef5934c0000000053a4"), "name" : "hoge", "age" : 20 } { "_id" : ObjectId("4d6b7f06934c0000000053a5"), "name" : "fuga" }2011 7 28
  10. 10. Full Index Support • Index • Unique Index Index2011 7 28
  11. 11. Replication • ReplicaSet mongod Member 1 (PRIMARY) mongod mongod Member 2 Member 3 (SECONDARY) (SECONDARY)2011 7 28
  12. 12. Replication • ReplicaSet mongod Member 1 (DOWN) mongod mongod Member 2 Member 3 (PRIMARY) (SECONDARY)2011 7 28
  13. 13. Replication • ReplicaSet mongod Member 1 (RECOVERING) mongod mongod Member 2 Member 3 (PRIMARY) (SECONDARY)2011 7 28
  14. 14. Replication • ReplicaSet mongod Member 1 (SECONDARY) mongod mongod Member 2 Member 3 (PRIMARY) (SECONDARY)2011 7 28
  15. 15. Auto-Sharding • Shard Key Shard 1 users name1 name2 name3 name4 name5 name6 name7 name8 name9 items item1 item2 item32011 7 28
  16. 16. Auto-Sharding • Shard Key Shard 1 Shard 2 users name1 name2 name3 name4 name5 name6 name7 name8 name9 items item1 item2 item32011 7 28
  17. 17. Auto-Sharding • Shard Key Shard 1 Shard 2 users users name1 name2 name3 name7 name8 name9 name4 name5 name6 name7 name8 name9 items item1 item2 item3 Chunk (Shard Key Range)2011 7 28
  18. 18. Auto-Sharding • Shard Key Shard 1 Shard 2 users users name1 name2 name3 name7 name8 name9 name4 name5 name6 items mongos item1 item2 item3 client client mongos mongoc Shard2011 7 28
  19. 19. Ameba Pico2011 7 28
  20. 20. 2011 1 Shard 1 mongoc mongos mongod mongod mongod Shard 2 Web Socket mongos mongoc mongod mongod mongod Shard 3 mongos mongoc mongod mongod mongod (memcached) LB ID/Point/ (HAProxy) MySQLEC2 m2.2xlarge (Mem 34.2GB / 13 EC2CU) c1.xlarge (Mem 7GB / 20 EC2CU) m1.large (Mem 7.5GB / 4 EC2CU) c1.medium (Mem 1.7GB / 5 EC2CU) m1.small (Mem 1.7GB / 1 EC2CU) EBS S3 CloudFront Elastic MapReduce2011 7 28
  21. 21. 2011 3 Shard 1 mongoc mongos mongod mongod mongod Shard 2 Web Socket mongos mongoc mongod mongod mongod Shard 3 mongos mongoc mongod mongod mongod (memcached) Shard 4 mongos mongod mongod mongod LB ID/Point/ (HAProxy) MySQLEC2 m2.2xlarge (Mem 34.2GB / 13 EC2CU) c1.xlarge (Mem 7GB / 20 EC2CU) m1.large (Mem 7.5GB / 4 EC2CU) c1.medium (Mem 1.7GB / 5 EC2CU) m1.small (Mem 1.7GB / 1 EC2CU) EBS S3 CloudFront Elastic MapReduce2011 7 28
  22. 22. 2011 5 Shard 1 mongoc mongos mongod mongod mongod Shard 2 Web Socket mongos mongoc mongod mongod mongod Shard 3 mongos mongoc mongod mongod mongod (memcached) Shard 4 mongos mongod mongod mongod LB ID/Point/ Shard 5 (HAProxy) MySQL mongod mongod mongodEC2 m2.2xlarge (Mem 34.2GB / 13 EC2CU) Shard 6 c1.xlarge (Mem 7GB / 20 EC2CU) m1.large (Mem 7.5GB / 4 EC2CU) mongod mongod mongod c1.medium (Mem 1.7GB / 5 EC2CU) m1.small (Mem 1.7GB / 1 EC2CU) EBS S3 CloudFront Elastic MapReduce2011 7 28
  23. 23. 2011 7 Shard 1 mongoc mongod mongod mongod mongos mongos Shard 2 Web Socket mongoc mongod mongod mongod Shard 3 mongos mongoc mongod mongod mongod (memcached) Shard 4 mongod mongod mongod LB ID/Point/ Shard 5 (HAProxy) MySQL mongod mongod mongodEC2 m2.2xlarge (Mem 34.2GB / 13 EC2CU) Shard 6 c1.xlarge (Mem 7GB / 20 EC2CU) m1.large (Mem 7.5GB / 4 EC2CU) mongod mongod mongod c1.medium (Mem 1.7GB / 5 EC2CU) m1.small (Mem 1.7GB / 1 EC2CU) EBS S3 CloudFront Elastic MapReduce2011 7 28
  24. 24. MongoDB2011 7 28
  25. 25. 2011 22011 7 28
  26. 26. 2011 7 28
  27. 27. 2011 7 28
  28. 28. mongod Repair2011 7 28
  29. 29. 2011 7 28
  30. 30. 2011 7 28
  31. 31. 2011 32011 7 28
  32. 32. Shard2011 7 28
  33. 33. 2011 7 28
  34. 34. 2011 7 28
  35. 35. 2011 7 28
  36. 36. 2011 7 28
  37. 37. http://www.flickr.com/photos/andreasmarx/190619661/2011 7 28
  38. 38. 62011 7 28
  39. 39. 2011 52011 7 28
  40. 40. Shard 22011 7 28
  41. 41. OFF2011 7 28
  42. 42. MongoDB2011 7 28
  43. 43. 2011 7 28
  44. 44. 2011 7 28
  45. 45. 2011 7 28
  46. 46. 2 Shard2011 7 28
  47. 47. 2011 7 28
  48. 48. 2011 7 28
  49. 49. 2011 62011 7 28
  50. 50. mongos2011 7 28
  51. 51. 2011 7 28
  52. 52. 2011 72011 7 28
  53. 53. MongoDB 1.6.5 → 1.8.22011 7 28
  54. 54. 2011 7 28
  55. 55. 2011 7 28
  56. 56. chunk chunk2011 7 28
  57. 57. http://www.flickr.com/photos/madhorse5/415958992/2011 7 28
  58. 58. 2011 7 28
  59. 59. 4 Shard2011 7 28
  60. 60. 2011 7 28
  61. 61. 2011 7 28
  62. 62. 2011 7 28
  63. 63. 2011 7 28
  64. 64. 2011 7 28
  65. 65. 2011 7 28
  66. 66. 2011 7 28
  67. 67. Shard 2 EC22011 7 28
  68. 68. 30 Repair2011 7 28
  69. 69. 2011 7 28
  70. 70. mongod 12011 7 28
  71. 71. 2011 7 28
  72. 72. 2011 7 28
  73. 73. 2011 7 28
  74. 74. 2011 7 28
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×