// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements.  See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not use this file except in compliance with
// the License.  You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

= RocksDB Storage

RocksDB is a persistent storage engine based on LSM tree. It is best used in environments with a large number of write requests.

When the link:config/data-region[data region] is configured to use it, Ignite stores all the data on disk, and loads as much data as it can into RAM for processing.


== Configuration Properties


Below is the list of properties for link:https://rocksdb.org/[RocksDB,window=_blank] data regions:

[cols="1,1,3",opts="header", stripes=none]
|===
|Property|Default|Description

|name|| The name of the data region.
|size| `256 * 1024 * 1024` | Size of the offheap cache.
|writeBufferSize | `64 * 1024 * 1024` | Size of the write buffer.
|cache| `lru` | The type of the cache to use. Currently only lru is supported. Using `clock` cache is not recommended.
|flushDelayMillis |100| The delay before handling RocksDB flush events.
|===


== Configuration Example

The example below shows how to configure a data region with RocksDB storage:

----
ignite config set --type cluster \
"{
    rocksdb.regions: [{
        name: lsm_region,
        size: 256000000,
        cache: lru
    }]
}"
----
