Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MongoDB Indexing

Sridhar Nanjundeswaran
February 24, 2012
94

MongoDB Indexing

Presented at MongoDB Chicago - Oct 2011

Sridhar Nanjundeswaran

February 24, 2012
Tweet

Transcript

  1. MongoDB on Windows • It really works  • Server

    or client or both can be on Windows
  2. Database on Windows • Current production release is 2.0 •

    Prebuilt binaries for 32 and 64 bit • Released the same time as other OS’ • http://www.mongodb.org/downloads • 64 bit recommended and to be used in production • Windows feature set on par with other OS’
  3. Installing on windows • Unzip package • Create c:\data\db to

    use default directory or use –dbpath • Start mongod – c:\<install path>\bin\mongod.exe • Same options as in non-Windows environment
  4. Deploying • Usual mongod deployment best practices still hold •

    Always run with replica sets for HA and data safety • Run with journaling • Etc. • Run your database process as a service
  5. mongod.exe as a windows service • Inbuilt service support in

    mongod • --install (uses Local System Account) • --remove • Run as admin in Win7, Win2k8 • Other options • --serviceName • --serviceUser • --servicePassword • Ensure service user has access to dbpath
  6. mongos.exe as a windows service • No support on mongos.exe

    currently • Can run mongos.exe as a service using srvany.exe • https://github.com/sridharn/MongoWindows
  7. mongo.exe on windows • All normal options available • Tab

    completion on the mongo shell works on windows as of 2.0
  8. Monitoring on Windows • Task Manager • Quick monitoring •

    Memory shows resident not mapped • Perfmon – monitor network, disk i/o etc. • Mongostat.exe • Wireshark can be used for packet level monitoring • http://wiki.wireshark.org/Mongo
  9. Mongodb on Azure • Current POC • Single instance •

    http://www.mongodb.org/display/DOCS/MongoDB +on+Azure • blobs mounted as a cloud drive • Use different blobs for logs and data • Can safely give access to logs without data • RS and Sharding support coming
  10. Known Issues • --fork does not work • Log rotation

    does not work on windows • No inbuilt support for running mongos as a windows service
  11. Building on windows • Source at http://github.com/mongodb/mongo • Get prebuilt

    spidermonkey • https://github.com/dwight/vc2010_js • Install on the same level as mongo • Get prebuilt boost libraries • http://www.mongodb.org/pages/viewpageattachm ents.action?pageId=12157032 • Install on root – actual files are at c:\boost\boost\...
  12. Building on windows contd. • Build using Visual Studio 2010

    • …\mongo\db\db_10.sln • Great for navigating source code • Build using scons • Run the right vcvars.bat • --64 – for 64 builds • Build the c++ driver • scons --mongoclient
  13. Client on Windows • Can connect to server running Windows

    or other OS’ • Drivers work on Windows (e.g.) • C# • Python • Java • Perl
  14. .Net and MongoDB • Current version is 1.2 • Full

    feature C# (.Net) driver from 10gen • Written in C# - built in ODM • Used from C#, VB, Powershell and F# • 2 dlls (Bson and Driver) • Works on Mono • Download • Zip or msi from Language Center • Nuget package available
  15. .Net and MongoDB contd • Source • www.github.com/mongodb/mongo-csharp-driver • VS2008,

    VS2010 solutions • VS2010 solution works in MonoDevelop (on Windows, Linux and OS X) • More info • http://www.mongodb.org/display/DOCS/CSharp+ Language+Center • API Docs – http://api.mongodb.org/csharp/current/
  16. Python and MongoDB • Current version is 2.0.1 • Support

    for Python 2.4, 2.5, 2.6 and 2.7 • Prebuilt installers at pypi.org for 32 and 64 bit builds • Download appropriate version • Works out of the box including C extensions
  17. Python and MongoDB contd. • Building C extensions • Need

    VS2008 for 2.6 and 2.7 • For 2.4 and 2.5 use MingW • To build 64 bit need full VS (not Express) • More info • API Docs – http://api.mongodb.org/python/current
  18. Java and MongoDB • Current version is 2.6.5 • Pure

    Java driver • ODM – Morphia • Download • 1 jar file • More info • http://www.mongodb.org/display/DOCS/Java+Lan guage+Center • API Docs – http://api.mongodb.org/java/current
  19. Perl on Windows • Current version is 0.45 • Use

    Strawberry perl • To install • cpan inc::Module::install • cpan MongoDB • More info • http://www.mongodb.org/display/DOCS/Perl+Languag e+Center • CPAN site - http://search.cpan.org/~kristina/MongoDB- 0.45/lib/MongoDB.pm
  20. Production Customers • National Archives • Migrated from SQL Server

    to MongoDB • Store asset information • Pattern Builders • Streaming analytics engine (.Net) • On Point Medical Diagnostics • Ultimate Software • HR/Payroll SaaS based (.Net) • Struq
  21. @mongodb © Copyright 2010 10gen Inc. conferences, appearances, and meetups

    http://www.10gen.com/events http://bit.ly/mongofb Facebook | Twitter | LinkedIn http://linkd.in/joinmongo download at mongodb.org We’re Hiring ! [email protected] @snanjund