Does MongoDB fail silently if I don't check error codes? -


i'm wondering if persistence failure go undetected if don't check error codes? if so, what's right way write fast (asynchronously) while still detecting errors?

if don't check errors, update fireandforget. you'll indeed miss errors arise. please see mongodb writeconcerns available write modes in mongodb (sorry fail find official, non driver related documentation, should bookmark it).
normal you'll @ least connectivity errors, none no exceptions @ all. if want informed of exceptions have use 1 of other modes, differ in persistence guarantee give you.
can't detect errors when running asynchronous, against intention. connection sent write operation, may closed or reused, can't sent through connection. further more actual code knows if fails. mongodb doesn't offer remote procedure call asynchronous inform of updates you'll have wait until write finished given stage.
fastest, unrelieable safe, write happened memory. journal gives security written @ least disk. fsync you'll have changes persisted on db on disk. replica least 2 replicas have written it, , majority more half of replicas have written it(by 3 replicas should default doesn't differ).

the chance see have asynchronous, have separate thread performing write operations synchronous. thread handle actual update class called in case of failure perform needed operations handle failure. don't think application design.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -