41955

MongoDB Journaling : Is the journal file used when the client request a non journal write and journa

Question:

I try to uderstand how journaling is exactly working : is that correct ?

When no journaling is activated on the server side (mongod --nojournal) :

<ol><li>(a) If the client request a journaled write it will output an error (from 2.6, before it was ignored),</li> <li>(b) If the client request a non journaled write, journaling will not be used so I guess change will be made on RAM, then the OS will flush changes to data file evry 60s.</li> </ol>

When journaling is activated on Mongod (mongod --journal (default on 64 bits version):

<ol><li>(a) If the client request a journaled write, mongoDB will acknowledge write in the master node only after commiting data into journal, also so as to make the client not to take too much time to perfrom the write, Mongod will reduce the commit interval. </li> <li>(b) If the client request a non journaled write, mongoDB will use the journal and acknowledge write from the master node without waiting the data to be committed to the journal.</li> </ol>

I actually did not find anything in the official documentation about case 2(b), could someone confirm if journal is used when j is false on the client side but journaling is activated on the mongod ?

Answer1:

Your assertions are all correct. I think the language you are using is confusing and may be confusing you a little bit, however. Clients don't request writes that are journaled or non-journaled. If journaling is on, writes will be journaled, regardless of what the client does. What the client includes is a <a href="http://docs.mongodb.org/manual/reference/write-concern/" rel="nofollow">write concern</a> that requires a certain level of data replication (the w parameter) and/or journaling (the j parameter) before the server responds that the write is a success. What you mean by a non-journaled write is j = 0, which means the server will respond with success without waiting for the write to be committed to the journal; j = 1 means the server will not respond to the write until it has been committed to the journal.

The w parameter controls the level of replication of the data necessary for a successful response. There's more detail in the link above.

Recommend

  • Jquery slow reaction time
  • Number of connections to MongoDB server
  • Initiate MongoDB replica set in docker swarm
  • Where can I find documentation for publishing data to perfmon in C++?
  • Solr DataImportHandler doesn't work with XML Files
  • replace observableArray with new data
  • How to loop list value of a specific column in pandas?
  • How to delete an old version of mongodb and install the new one in cloud9 IDE?
  • MongoDB: \\lib\\server.js:235 process.nextTick getaddrinfo ENOTFOUND error
  • Eclipse won't start
  • How to make a local git repository that mirrors an upstream repository?
  • Slowly changing dimension - What is Pure type 6 implementation
  • Program crashes when run outside IDE
  • How to work with Master Page that is attached to the page via the page's basepage?
  • Can a variable be stored within an image or div tag?
  • Launch powershell script from UWP app with FullTrustProcessLauncher class
  • Copying rows in a database when rows have children
  • SSIS Designer is running VERY slowly
  • How to Save JSON data to SQL server database in C#?
  • Mixing WebForms and MVC: What should I do with the MasterPage?
  • How to get links to open in the native browser in iOS Meteor apps?
  • Is there a way to do normal logging with EureakLog?
  • PHP buffered output depending on server setting?
  • Ajax Loaded meta Tags
  • JavaScriptCore crash on iOS9
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • How do I rollback to a specific git commit
  • Traverse Array and Display in markup
  • Transpose CSV data with awk (pivot transformation)
  • Cannot Parse HTML Data Using Android / JSOUP
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Why can't I rebase on to an ancestor of source changesets if on a different branch?
  • How do you join a server to an Active Directory (domain)?
  • Understanding cpu registers
  • coudnt use logback because of log4j
  • embed rChart in Markdown
  • How to get NHibernate ISession to cache entity not retrieved by primary key
  • How can I use `wmic` in a Windows PE script?
  • Unable to use reactive element in my shiny app