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

MongoDB: Best Practices, Performance Tricks, .NET Tips & Tricks

MongoDB: Best Practices, Performance Tricks, .NET Tips & Tricks

Presented at Devnot 2023 (Devnot Organization).

All gists which are used on the stage can be found here.

Selçuk Usta

June 08, 2023

More Decks by Selçuk Usta

Other Decks in Programming


  1. AGENDA > MongoDB - Design Patterns > What should be

    observed? > How can be observed? > Index Optimization & Best Practices > MongoDB on .NET
  2. WORKING SET most frequently accessed documents by clients + all

    indexes should fit into the RAM! (RAM - 1) * 0,5 or 256 MB WIREDTIGER STORAGE ENGINE
  3. needs to check periodically; > db.serverStatus().wiredTiger.cache[...] > db.stats().dataSize > db.stats().indexSize

    > mongostat --uri="<MONGO_URI>" --interactive --discover -o="COLUMN_1,COLUMN_2" WIREDTIGER STORAGE ENGINE WORKING SET (RAM - 1) * 0,5 or 256 MB
  4. consider using an individual read preference setting instead of the

    one provided by connection settings Tips and Tricks
  5. fine-tune “connection pooling” mechanism in order for both database and

    applications to perform expected Tips and Tricks