Reputation: 67
i just installed mongodb 32 bit version, this is the message which prints in my terminal when i start mongodb
Server has startup warnings:
Wed Jul 16 09:53:43.759 [initandlisten]
Wed Jul 16 09:53:43.759 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Wed Jul 16 09:53:43.759 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
Wed Jul 16 09:53:43.759 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
Wed Jul 16 09:53:43.759 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Wed Jul 16 09:53:43.759 [initandlisten]
>
From here i noticed or understood 2 things, my mongodb database is limited to storage of less than 2gb database
it is non journalized,
Journalizing makes the space decrease much further
I was wondering
what is this journal/non-journal mongodb database
what is the advantage of journal database over nonjournal database or vice versa?
Is it necessary to journal my database?
Please help me in this
Thanks
Upvotes: 1
Views: 1253
Reputation: 8692
In MongoDB it uses write ahead logging to check whether a write
operation is performed or to write a crash report
this called journaling
If there is no journaling
say you work on millions of transaction . if some transaction may be crashed or incompletely terminated . there will be no trace for you to know the issue. so how can one find the where does the issue occurred and recover it
other situations are like if db has exists unexpectedly you will not able to know the reason
From docs it clearly states that
Without a journal, if mongod exits unexpectedly, you must assume your data is in an inconsistent state, and you must run either repair or, preferably, resync from a clean member of the replica set. With journaling enabled, if mongod stops unexpectedly, the program can recover everything written to the journal, and the data remains in a consistent state. By default, the greatest extent of lost writes, i.e., those not made to the journal, are those made in the last 100 milliseconds. See commitIntervalMs for more information on the default.
Upvotes: 3
Reputation: 1636
Journaling is a concept where you take a backup, before you write your data in your data files.
The reason we do this is for durability. And journaling is highly recommended in production environment.
The advantage of using journal is when there is dirty shutdown or crash, you may loose your data entry operations in general you may loose your data.
Without Journaling
When a write operation happens your data is written to data drive every 60 seconds from your memory mapped shared view.
With Journaling
Your write operations are first written to journal files every 100- 200 ms. and after journal commit it is copied to shared view and from there after 60 seconds data is flushed to your actual data drive.
What do we get here? So what happens here is
Upvotes: 1