title: How to implement ColumnFamilies in RocksDB in Java?
body: <p>I am trying to use column families in RocksDB through java binding.</p>
  <pre><code>RocksDB.loadLibrary();
          String threat = &quot;threat_data&quot;;
          String ipRange = &quot;ip_range&quot;;
          options = new DBOptions();
          options.setCreateIfMissing(true);
          options.setCreateMissingColumnFamilies(true);
          ColumnFamilyOptions cfOpts = new ColumnFamilyOptions().optimizeUniversalStyleCompaction();
          List cfDescriptors = Arrays.asList(
                  new ColumnFamilyDescriptor(RocksDB.DEFAULT_COLUMN_FAMILY, cfOpts),
                  new ColumnFamilyDescriptor(threat.getBytes(), cfOpts),
                  new ColumnFamilyDescriptor(ipRange.getBytes(),cfOpts)
          );
          List&lt;ColumnFamilyHandle&gt; cfHandles = new ArrayList&lt;&gt;();
          rocksDb = RocksDB.open(options, new File(&quot;/tmp/benchmark&quot;, &quot;rockdb-threat-detection.db&quot;).getAbsolutePath(),cfDescriptors,cfHandles);
          
          cfHandleThreat = (ColumnFamilyHandle) ((List) cfHandles.stream().filter(x -&gt; {
              try {
                  return (new String(x.getName())).equals(threat);
              } catch (RocksDBException e) {
                  e.printStackTrace();
              }
              return false;
          }).collect(Collectors.toList())).get(0);
          
          cfHandleIp = (ColumnFamilyHandle) ((List) cfHandles.stream().filter(x -&gt; {
              try {
                  return (new String(x.getName())).equals(ipRange);
              } catch (RocksDBException e) {
                  e.printStackTrace();
              }
              return false;
          }).collect(Collectors.toList())).get(0);
  </code></pre>
  <p>I am creating 2 column families threat_data and ip_range. But if trying to read from using get() function, the performance hits low.</p>
  <pre><code>mapThreat.get(ipToLong(&quot;157.49.194.173&quot;))
  </code></pre>
  <p>The performance between using columnfamilies and not using them changes drastically. Is there anything I am doing wrong or How should I improve performance?</p>