Archiving capped collections - is it possible/feasible?

11 views
Skip to first unread message

Peter Bengtsson

unread,
Feb 2, 2010, 2:10:04 PM2/2/10
to mongodb-user
I like the idea of using a capped collection to store logs but what if
I want to archive them?
A cron job could periodically copy the capped collection into a non-
capped collection. (perhaps by renaming the capped collection, from
"logs_capped" to "logs_capped_to_be_archived" and create a blank one
called "logs_capped")

Are there already solutions to this problem ready made?
How do I best get on top of the size maximum so that I make sure I
archive before it reaches it's maximum?

Lastly, if having persistent logs is important to me, should I not
bother with capped collections and take the performance hit?

Eliot Horowitz

unread,
Feb 2, 2010, 2:14:42 PM2/2/10
to mongod...@googlegroups.com
I think your last statement is correct.
If you want persistent logs, then you shouldn't bother with a capped collection.
Logs in capped collections are really great if you want X days of
logs, not if you want infinite logs.

> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>

Peter Bengtsson

unread,
Feb 2, 2010, 2:47:36 PM2/2/10
to mongod...@googlegroups.com
Sounds about right. I might return to this in the optimization phase
if the project takes off. For now I'll just keep the indexes light.

--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
fun crosstips.org

Reply all
Reply to author
Forward
0 new messages