WiredTiger and growing documents

488 views
Skip to first unread message

Alex Sergeyev

unread,
Feb 26, 2015, 4:36:15 PM2/26/15
to mongod...@googlegroups.com
Hi, 

My current pattern for mongodb usage is to store timeseries with one minute resolution in one document per day.  To avoid document relocation for mongo < 3.0 I need to pad each document on creation with nil values for all timestamps for this day. How WiredTiger will work with growing documents? Do I need also to pad empty values or can just add values to same document?

MARK CALLAGHAN

unread,
Feb 26, 2015, 5:04:08 PM2/26/15
to mongod...@googlegroups.com
The WiredTiger b-tree is copy-on-write so it isn't constrained by a
fixed page size. I assume that means there is less concern about
growing or shrinking documents and no need for client-side padding.
But this is one more question for the WT experts to answer in the
pending WT performance guide.
> --
> You received this message because you are subscribed to the Google Groups
> "mongodb-user"
> group.
>
> For other MongoDB technical support options, see:
> http://www.mongodb.org/about/support/.
> ---
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongodb-user...@googlegroups.com.
> To post to this group, send email to mongod...@googlegroups.com.
> Visit this group at http://groups.google.com/group/mongodb-user.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/mongodb-user/19495431-d85b-4de4-8df1-2d07c0775711%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Mark Callaghan
mdca...@gmail.com

Stephen Steneker

unread,
Feb 26, 2015, 7:51:08 PM2/26/15
to mongod...@googlegroups.com
On Friday, 27 February 2015 08:36:15 UTC+11, Alex Sergeyev wrote:
My current pattern for mongodb usage is to store timeseries with one minute resolution in one document per day.  To avoid document relocation for mongo < 3.0 I need to pad each document on creation with nil values for all timestamps for this day. How WiredTiger will work with growing documents? Do I need also to pad empty values or can just add values to same document?

Hi Alex,

WiredTiger doesn't do in-place updates; padding is only applicable to mmap storage. You'll want to remove any manual padding if you change to WiredTiger, and just add/update values as required.

As with any major database upgrade, I would encourage you to thoroughly test to see how the performance differs for your use case.

Regards,
Stephen
Reply all
Reply to author
Forward
0 new messages