# Datastore Configuration Options This document describes the different possible values for the `Datastore.Spec` field in the ipfs configuration file. ## flatfs Stores each key value pair as a file on the filesystem. The shardFunc is prefixed with `/repo/flatfs/shard/v1` then followed by a descriptor of the sharding strategy. Some example values are: - `/repo/flatfs/shard/v1/next-to-last/2` - Shards on the two next to last characters of the key - `/repo/flatfs/shard/v1/prefix/2` - Shards based on the two character prefix of the key ```json { "type": "flatfs", "path": "", "shardFunc": "", "sync": true|false } ``` NOTE: flatfs should only be used as a block store (mounted at `/blocks`) as the current implementation is not complete. ## levelds Uses a leveldb database to store key value pairs. ```json { "type": "levelds", "path": "", "compression": "none" | "snappy", } ``` ## badgerds Uses [badger](https://github.com/dgraph-io/badger) as a key value store. * `syncWrites`: Synchronize every write to disk. * `truncate`: Truncate the DB if a corrupted sector is found (otherwise Badger won't start). This option is always set to `true` in Windows if `syncWrites` is set. ```json { "type": "badgerds", "path": "