Tablespace

222 views
Skip to first unread message

Luis Lobo

unread,
Nov 22, 2013, 6:44:05 AM11/22/13
to mongod...@googlegroups.com
Hi!

Is there any way to use separate storage for different databases in the
same mongodb instance, something on the line of tablespaces in postgres
(for instance)?

The idea would be to place high write/read (eventually smaller)
collections in an SSD and lower priority (bigger) ones in a larger HDD
volume (lvm for instance).

Thanks in advance,
LL

Derick Rethans

unread,
Nov 22, 2013, 6:53:40 AM11/22/13
to mongod...@googlegroups.com
Hi,
mongod has an option "--directoryperdb" which will make newly created
databases use a directory of their own. Because it's a directory you
should be able to symlink that to a directory on your SSD partition.

However, you can only do this *per database* and not per collection, but
you can of course split certain collections out into a database of their
own.

cheers,
Derick

--
{
website: [ "http://mongodb.org", "http://derickrethans.nl" ],
twitter: [ "@derickr", "@mongodb" ]
}

Luis Lobo

unread,
Nov 22, 2013, 9:57:05 AM11/22/13
to mongod...@googlegroups.com
Thanks for your answer.

I'm thinking about starting a totally separate instance of mongodb on
another port in the same machine with the data directory pointing to the
(hdd) lvm. This way things will probably be 'cleaner' and if I need to
implement sharding in the future, I won't run into troubles.

I am using the Java Driver so a second db object will not pose a problem.

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