// 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.

== Profile Configuration

Each Ignite storage engine can have several storage profiles. Each profile has the following properties:

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

|engine|| The name of the storage engine.
|sizeBytes|`256 * 1024 * 1024`| Sets the space allocated to the storage profile, in bytes.
|writeBufferSizeBytes|`64 * 1024 * 1024`| Size of rocksdb write buffer.
|numShardBits|`-1`| The cache is sharded to 2^numShardBits shards, by hash of the key.
|===


== Configuration Example

In Ignite 3, you can create and maintain configuration in either HOCON or JSON. The configuration file has a single root "node," called `ignite`. All configuration sections are children, grandchildren, etc., of that node. The example below shows how to configure a storage profile with RocksDB storage:

[source, json]
----
{
  "ignite" : {
    "storage" : {
      "profiles" : [
        {
          "name" : "rocks_profile",
          "engine" : "rocksDb",
          "size" : 2560000                
        }
      ]
    }
  }
}
----

You can then use the profile (in this case, `rocks_profile`) in your distribution zone configuration.
