Mongo gotchas

1,076 views

Published on

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,076
On SlideShare
0
From Embeds
0
Number of Embeds
296
Actions
Shares
0
Downloads
5
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Mongo gotchas

  1. 1. Mongo  Gotchas   by  Billy  Chasen  Founder,  CEO  turntable.fm   @billychasen  
  2. 2. video  www.youtube.com/watch?v=shgHA7lKJaY  
  3. 3. How  we  use  mongo  •  All  turntable  room  state  in  mongo  •  All  persistent  data  •  Logging  (use  safe  =  False)  •  Incredibly  fast,  make  sure  you  give  it  enough   RAM  
  4. 4. ConnecPons  •  The  magic  number  819   –  Depends  on  open  file  limits   –  Throws  a  vague  cannot  connect  to  primary/slave   error  
  5. 5. Threads  •  CauPon  when  using  pymongo  with  Tornado  •  Use  libraries  like  async  mongo  for  Tornado  
  6. 6. Indexes  •  Important!    Analyze  every  query  you  use  with   explain()  and  monitor  slow  query  log  
  7. 7. OpPmize  returned  data  •  If  you  have  large  objects,  request  only  needed   fields  •  It’s  like  using  SELECT  uid,name  FROM  user  
  8. 8. We’re  hiring!  •  jobs@turntable.fm  •  VP  Tech  •  Sysops  

×