『 读书笔记 』 50 Tips and Tricks for MongoDB Developers

2014-11-09 litaotao 更多博文 » 博客 » GitHub »

原文链接 https://litaotao.github.io/50-tips-and-tricks-for-mongodb-developer
注:以下为加速网络访问所做的原文缓存,经过重新格式化,可能存在格式方面的问题,或偶有遗漏信息,请以原文为准。


写在前面

  book 开头的文章都是记录我个人的读书记录的,里面分情况会记录下面这些东西:目录,读书感想,技术分享和推荐等。如果只是写下目录,那大多是留给自己以后看的。我不会把书长篇大论地翻译成中文,只会写下能对我个人以后真正有用的东西。   这是一本讲mongodb实践的经验书籍,就66页,除去前面目录什么的,也就50来页,对我个人还是挺有用的,所以我写下其目录,供以后复习时用。没必要写什么读书笔记,毕竟大脑才是最好用的u盘。

目录

  1. Duplicate data for speed, reference data for integrity
  2. Normalize if you need to future-proof
  3. data
  4. Try to fetech data in a single query
  5. Embed dependent fields
  6. Embed "point-in-time" data
  7. Do not embed fields that have unbound growth
  8. Pre-populate anything you can
  9. Preallocate space, whenever possible
  10. Store embedded information in arrays for anonymous access
  11. Desigin documents to be self-sufficient
  12. Prefer $-operators to JavaScript
  13. Compute aggregations as you go
  14. Write code to handle data integrity issues
  15. Use the correct types
  16. Override _id when you have your own simple, unique id
  17. Avoid using a document for _id
  18. Do not use database references
  19. Don't use GridFS for small binary data
  20. Handle "seamless" failover
  21. Handle replica set failure and failover
  22. Minimize disk access
  23. Use indexes to do more with less memory
  24. Don't always use an index
  25. Create indexes that cover your queries
  26. Use compound indexes to make multiple queries fast
  27. Create hierarchical documents for faster scans
  28. AND-queries should match as little as possible as fast as possible
  29. OR-queries should match as much as possible as soon as possible
  30. Write to the journal for single server, replicas for multiserver
  31. Always use replication, journaling, or both
  32. Do not depend on repair to recover data
  33. Understand getlasterror
  34. Always use safe writes in development
  35. Use w with replication
  36. Always use wtimeout with w
  37. Don's use fsync on every write
  38. Start up normally after a crash
  39. Take instant-in-time backups of durable servers
  40. Manually clean up your chunks collections
  41. Compact database with repair
  42. Don't change the number of votes for members of a replic set
  43. Replica sets can be reconfigured without a master up
  44. --shardsvr and --configsvr aren't required
  45. Only use --notablescan in development
  46. Learn some JavaScript
  47. Manage all of your servers and databases from one shell
  48. Get "help" for any function
  49. Create startup files
  50. Add your own functions
  51. Use a single connection to read your own writes

推荐资料

中文翻译

扫一扫

2014-11-09-50-tips-and-tricks-for-mongodb-developer.md