Reputation: 5
I have been exploring using Cassandra for our embedded platform and would prefer to not have it use the disk at all. In my research, I haven't been able to find any config option to turn off the disk usage. I understand the downside of not having the commit logs on disk and so no write durability.
In short, have Cassandra run completely in-memory DB with enough RAM dedicated to it to accommodate all the data it will hold natively (based on the partitioner used) and some more for cached data plus other metadata used by Cassandra. With the assumption that if the local cache grows beyond the available RAM, it will use some kind of LIFO semantics to flush out old data cached from other nodes.
Any options/libs to have Cassandra operate completely in-memory without a disk?
Thanks. RG
Upvotes: 0
Views: 301
Reputation: 4361
If you are using mariadb you can swap out Cassandra for another data backend. I doubt there is a specific 'dismissed option as this isn't its intended usage.
I wouldn't use tmpfs or similar as your RAM requirements will basically double. You'll have the in-memory cache that the database stores and the copy on 'disk'. Using a database backend specifically designed for memory-only operations is your best bet. If you must use tmpfs for some reason, drop your caches to a minimum to avoid storing two copies. tmpfs IS the buffer cache, so storing there is no slower than pulling it from Linux disk cache and the upper cache layers designed to avoid hitting a spinning disk are wasting ram.
Upvotes: 0
Reputation: 65445
One option is to mount a filesystem backed by RAM. You can use tmpfs
or a RAM disk. One difference between them is that tmpfs
is a filesystem already but if you use a raw RAM disk, you only get a block device and so you will have to format it separately with a filesystem.
Upvotes: 1