ShakeProof

「2014-2-6」TokuMX and MongoDB related materials collection

简介参考 TokuMXMongoDB 各自的官方站点。

 image     image

## 
Tokutek 最重要的特点和 marketing word 是所谓 fractal tree indexing technology,相关链接:

image

1. 由于 per-node buffer 的引入所导致的 ACID 里的 Durability 问题应对方式(通过更合理的规划物理机器布局、增加单事务数据量等方式来分摊 fsync 开销;更「松弛」的持久化处理,即不要求每次 operation 都做持久化、而是「延迟容忍」的持久化机制)。
http://www.tokutek.com/2010/01/high-insertion-rates-into-a-tokudb-table-with-durable-transactions/

2. 微博上 fractal tree 相关的链接

## 
MongoDB 的一条融资新闻,觉得在 community 运作和开发模式(开源社区和公司运营相结合,所有的 issue 和 bug fix 都是可公开访问的,有很高的透明度)上,MongoDB 做的很棒。简单初步看了一下,记录在此,不一定准确和全面。

1. 数据建模的基本策略,embedded data & references 两种最基本的类型:前者直接在 document 里嵌入 sub-document 形成从属和绑定的关系,好处是能够以更少的读操作,从 collection 里获取数据,并且对原子写入支持更好(写操作的 atomicity 是建立在 document 基础上);后者通过 reference 引用其他 collection 里的 document,好处是能够降低 duplicate data fields(类似于用指针代替物理拷贝),对存储空间更友好,坏处则是对业务逻辑上的某个 record 做操作可能意味着对多个 documents 做操作。
基本介绍,如何建模 relationship between documents(有别于简单 key-value 数据库的地方),设计数据模型时必要的一些考量(such as lifecycle management, indexing, atomicity, horizontal scalability, and document growth)。

2. 同 SQL 常见术语和概念的对照表。如,行和列分别对应于 BSON documentfield,主键(primary key)术语一致但稍有不同(MongoDB 里制定了 BSON ObjectID _id 做为主键);值得注意的是,table join 的对应项是 embedded documents and linking,这挺有趣的,基于目前极其有限的了解,我的猜测是,MongoDB 尽管是 schema free No-SQL 数据库,但它可能对早期的 data modeling 提出了更高的要求。

3. FAQ 里对于「Do MongoDB databases have schemas?」的回答,最有价值的一点,可能就在于「simplifies and facilitates iterative software development with MongoDB」。

4. 关于 MongoDB 的典型应用场景是否支持事务的 FAQ。

MongoDB has a general-purpose design, making it appropriate for a large number of use cases. Examples include content management systems, mobile applications, gaming, e-commerce, analytics, archiving, and logging.
Do NOT use MongoDB for systems that require SQL, joins, and multi-object transactions.

5. 数据持久性方面的问题《Are writes written to disk immediately, or lazily?》。

Writes are physically written to the journal within 100 milliseconds, by default. At that point, the write is _durable_ in the sense that after a pull-plug-from-wall event, the data will still be recoverable after a hard restart.

Jounaling mechanism - http://docs.mongodb.org/manual/core/journaling/。注意 private view / shared view / data files 三者在不同操作下的 memory view 映射。

##
其他相关的链接:

1. 《main rules of efficient SQL》,其中也提到了 Oracle 数据库 table join 的三种机制如 hash join 等等。

2. 《What do Clustered and Non clustered index actually mean?

Regarding multiple indexes. You can have only one clustered index per table because this defines how the data is physically arranged. If you wish an analogy, imagine a big room with many tables in it. You can either put these tables to form several rows or pull them all together to form a big conference table, but not both ways at the same time. A table can have other indexes, they will then point to the entries in the clustered index which in its turn will finally say where to find the actual data.

3. 《How does database indexing work?》,以及一个相关的问题,数据库里的 cardinality 含义。

Also given the nature of a binary search, the cardinality or uniqueness of the data is important. Indexing on a field with a cardinality of 2 would split the data in half, whereas a cardinality of 1,000 would return approximately 1,000 records. With such a low cardinality the effectiveness is reduced to a linear sort, and the query optimizer will avoid using the index if the cardinality is less than 30% of the record number, effectively making the index a waste of space.

4. 《关于 MongoDB 你需要知道的几件事》《千万别用 MongoDB ?真的吗?》。

posted on 2014-02-07 02:31  mirrorwheel  阅读(392)  评论(0编辑  收藏  举报

导航