[DOCS-8390] "How to write resilient applications" Created: 20/Jul/16  Updated: 30/Oct/23  Resolved: 22/Aug/17

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Major - P3
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Won't Fix Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 6 years, 25 weeks, 1 day ago

 Description   

Adapt this material, from my MongoDB World talk and my article, into a guide in the Manual:

https://emptysqua.re/blog/how-to-write-resilient-mongodb-applications/

The first two thirds of my article is just setup, the actual guide would be much shorter. It would recommend that application developers write code that:

  • Uses idempotent operations for all high-value writes
  • Catches all network errors and retries idempotent writes once
  • Does not retry other errors

... and there can be a short justification of why this is a smart strategy.

Put it in, or link it from, https://docs.mongodb.com/manual/core/crud/ section.



 Comments   
Comment by Michael Poremba [ 22/Aug/17 ]

Jesse, the new retry_writes option goes a long way in improving reliability of writes for many applications. Remaining problem around education for engineers writing "resilient applications" will be:

  • Remember to enable the flag as a best practice.
    • I expect the retry_writes option is not enabled by default, correct? That means developers will need to get into the good habit of enabling the flag. Similar to how they learn to buckle the seat belt when riding in a car, or regularly washing their hands to manage hygiene.
  • Understand any remaining edge cases with using retry_writes that require proper exception handling.
  • Understand any possible side effects of using retry_writes.
    • E.g. Is there a performance cost associated with this feature, WRT session management?
Comment by A. Jesse Jiryu Davis [ 22/Aug/17 ]

I'm no longer committed to writing this. The retryable writes / retryable reads specs for 3.6 will make an article like this much different and simpler, if anyone ever does write it.

Generated at Thu Feb 08 07:56:12 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.