由于是英文文档,不做笔记过一阵就忘了,现在把关键点记录到这,开发的时候使用。

具体wiki地址:https://github.com/facebook/rocksdb/wiki

1)Column Faimilies 意味着可以将写入的key进行逻辑分组存储,不影响读取,若未指定则使用default;

2)MemTable 在内存中存储的数据,当达到一定的条件时会flush到文件;

  • memtable_factory: The factory object of memtable. By specifying factory object user can change the underlying implementation of memtable, and provide implementation specific options.
  • write_buffer_size: Size of a single memtable.
  • db_write_buffer_size: Total size of memtables across column families. This can be used to manage the total memory used by memtables.
  • write_buffer_manager: Instead of specifying a total size of memtables, user can provide their own write buffer manager to control the overall memtable memory usage. Overrides db_write_buffer_size.
  • max_write_buffer_number: The maximum number of memtables build up in memory, before they flush to SST files.

3)Write Ahead Log 每次写操作都会记录这个操作,主要用于故障、重启等时恢复MemTable的状态(和redis机制有点像);

DBOptions::wal_dir

DBOptions::wal_dir sets the directory where RocksDB stores write-ahead log files, which allows WALs to be stored in a separate directory from the actual data.

DBOptions::WAL_ttl_seconds, DBOptions::WAL_size_limit_MB

These two fields affect how quickly archived WALs will be deleted. Nonzero values indicate the time and disk space threshold to trigger archived WAL deletion. See options.h for detailed explanation.

DBOptions::max_total_wal_size

In order to limit the size of WALs, RocksDB uses DBOptions::max_total_wal_size as the trigger of column family flush. Once WALs exceed this size, RocksDB will start forcing the flush of column families to allow deletion of some oldest WALs. This config can be useful when column families are updated at non-uniform frequencies. If there's no size limit, users may need to keep really old WALs when the infrequently-updated column families hasn't flushed for a while.

DBOptions::avoid_flush_during_recovery

This config is self explanatory.

DBOptions::manual_wal_flush

DBOptions::manual_wal_flush determines whether WAL flush will be automatic after every write or purely manual (user must invoke FlushWAL to trigger a WAL flush).

DBOptions::wal_filter

Through DBOptions::wal_filter, users can provide a filter object to be invoked while processing WALs during recovery. Note: Not supported in ROCKSDB_LITE mode

WriteOptions::disableWAL

WriteOptions::disableWAL is useful when users rely on other logging or don't care about data loss.

4)Cache 相当于在MemTable之上又做了一层cache(有LRUCache和ClockCache两类),其实索引和过滤相关也可以cache,具体可以看文档,可以更好的控制内存使用;

#include "rocksdb/cache.h"
rocksdb::BlockBasedTableOptions table_options;
table_options.block_cache = rocksdb::NewLRUCache( * ); // 100MB uncompressed cache rocksdb::Options options;
options.table_factory.reset(rocksdb::NewBlockBasedTableFactory(table_options));
ocksdb::DB* db;
rocksdb::DB::Open(options, name, &db);
... use the db ...
delete db

5)支持前缀查询,默认即使这样的行为,无需其它特定设置:

https://github.com/facebook/rocksdb/wiki/Prefix-Seek-API-Changes

6)TTL机制 可对插入数据设置过期时间,但是使用有限制;

必须要是用下面的API:

static Status DBWithTTL::Open(const Options& options, const std::string& name, StackableDB** dbptr, int32_t ttl = 0, bool read_only = false);

7)讲解了两阶段提交的实现:

https://github.com/facebook/rocksdb/wiki/Two-Phase-Commit-Implementation

rocksdb wiki文档阅读笔记的更多相关文章

  1. Keras 文档阅读笔记(不定期更新)

    目录 Keras 文档阅读笔记(不定期更新) 模型 Sequential 模型方法 Model 类(函数式 API) 方法 层 关于 Keras 网络层 核心层 卷积层 池化层 循环层 融合层 高级激 ...

  2. Resin文档阅读笔记

    阅读文档对应的版本为Resin4.0,且基本只关注Standard版本的功能. 1.Resin可以注册为服务: To install the service, use C:/> resin-3. ...

  3. KVM内核文档阅读笔记

    KVM在内核中有丰富的文档,位置在Documentation/virtual/kvm/. 00-INDEX:整个目录的索引及介绍文档. api.txt:KVM用户空间API,所谓的API主要是通过io ...

  4. webDriver文档阅读笔记

    一些雷 浏览器版本和对应的Driver的版本是一一对应的,有时候跑不起来,主要是因为driver和浏览器版本对不上. e.g: chrome和driver版本映射表:https://blog.csdn ...

  5. elasticsearch 文档阅读笔记(三)

    文档 elasticsearch是通过document的形式存储数据的,个人理解文档就是一条数据一个对象 我们添加索引文档中不仅包含了数据还包含了元数据 比如我们为一个数据添加索引 文档中不仅有jso ...

  6. mongodb官网文档阅读笔记:与写性能相关的几个因素

    Indexes 和全部db一样,索引肯定都会引起写性能的下降,mongodb也没啥特别的,相对索引对读性能的提示,这些消耗通常是能够接受的,所以该加入的索引还是要加入.当然须要慎重一些.扯点远的,以前 ...

  7. Mybatis文档阅读笔记(明日继续更新...)

    今天在编写mybatis的mapper.xml时,发现对sql的配置还不是很熟,有很多一坨一坨的东西,其实是可以抽取成服用的.不过良好的组织代码,还是更重要的.

  8. Qt文档阅读笔记-QGraphicsItem::paint中QStyleOptionGraphicsItem *option的进一步认识

    官方解析 painter : 此参数用于绘图;option : 提供了item的风格,比如item的状态,曝光度以及详细的信息:widget : 想画到哪个widget上,如果要画在缓存区上,这个参数 ...

  9. vue文档阅读笔记——计算属性和侦听器

    页面链接:https://cn.vuejs.org/v2/guide/computed.html 注意点 计算属性用于 替代模板内的表达式. 如果计算属性所依赖的属性未更新,会返回自身的缓存. 侦听器 ...

随机推荐

  1. Spring Boot 跨域访问

    如何在 Spring Boot 中配置跨域访问呢? Spring Boot 提供了对 CORS 的支持,您可以实现WebMvcConfigurer 接口,重写addCorsMappings 方法来添加 ...

  2. Codeforces Round #591 (Div. 2, based on Technocup 2020 Elimination Round 1) D. Sequence Sorting

    链接: https://codeforces.com/contest/1241/problem/D 题意: You are given a sequence a1,a2,-,an, consistin ...

  3. 和PHP相关的Linux命令

    Linux服务器上怎么找到php.ini php -ini #输出一堆信息,里面有loaded configuration file => /etc/php/7.0/cli/php.ini就是了 ...

  4. 在一个非默认的位置包含头文件stdafx.h

    如果stdafx.h和你当前的工程不在一个文件夹下,当你在代码中第一行写下#include "stdafx.h"时,VC编译器会根据编译规则(相关的规则请查看MSDN)来区别std ...

  5. spring boot+idea实现程序热部署

    pring为开发者提供了一个名为spring-boot-devtools的模块来使Spring Boot应用支持热部署,提高开发者的开发效率,无需手动重启Spring Boot应用. devtools ...

  6. vmware中桥接模式和NAT的区别

    桥接模式 在桥接模式下,VMWare虚拟出来的操作系统就像是局域网中的一台独立的主机(主机和虚拟机处于对等地 位),它可以访问网内任何一台机器.在桥接模式下,我们往往需要为虚拟主机配置IP地址.子网掩 ...

  7. Mybatis源码学习之事务管理(八)

    简述 在实际开发中,数据库事务的控制是一件非常重要的工作,本文将学习Mybatis对事务的管理机制.在Mybatis中基于接口 Transaction 将事务分为两种,一种是JdbcTransacti ...

  8. 记一次maxwell报错:Couldn't find table 'violation_info' in database och_evcard_data

    往常maxwell是正常跑的,但是突然今天报错: Couldn't find table 'violation_info' in database och_evcard_data 而且这个库和这个表, ...

  9. JavaWeb_(Hibernate框架)Hibernate中数据查询语句SQL基本用法

    本文展示三种在Hibernate中使用SQL语句进行数据查询基本用法 1.基本查询 2.条件查询 3.分页查询 package com.Gary.dao; import java.util.List; ...

  10. ACM之路(15)—— 字典树入门练习

    刷的一套字典树的题目链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=120748#overview 个人喜欢指针的字典树写法,但是大力 ...