tarantool

How to minimize HDD usage in tarantool


I have installed tarantool on a Raspberry Pi 7inch and would like to minimize its interaction with the HDD (sd card). Are there any simple ways to do this. What will be the real usage of hdd?


Solution

  • It's a broad topic and answer would depend on tasks your application are solving. There are memtx and vinyl engines in tarantool. Each serves different goals and has own configuration options. Both suitable for production use.

    But I'll assume you just playing around and want to minimize disk usage as possible. For this tarantool has temporary spaces, which has no persistence, which means, all data are stored in memory without saving to disk.

    Also, there is wal_mode configuration option, which disables wal logging for an entire instance. Here is a simple example how it may be used:

    box.cfg({ wal_mode = 'none' }) -- do not write wal logs 
    box.schema.create_space('test', {temporary = true}) -- do not persist its data to disk
    box.space.test:create_index('primary')
    box.space.test:insert({1})
    box.space.test:insert({2})
    box.space.test:select()
    

    There are lots of other options, you may use to tune disk usage. Check it out in documentation.