基于MongoDB和Hadoop的分布式系统

  • 潘瓒【飞龙】
  • 数空科技 · 有理数科技
  • panzan@bigdata-x.com
  • 2017-09-17

数据库排名

数据库排名 https://db-engines.com/en/ranking

MongoDB特色

动态文档模型
BSON
高可用性
Replica Set
水平扩展
Sharding
复合索引
高性能读写
聚合框架
部分索引
多存储引擎
MapReduce
全文搜索
地理位置查询
GridFS

MongoDB简介

SQL MongoDB
database database
table collection
row document
column field
primary key _id

性能测试

Update测试 Insert测试
Update测试 Update configured测试
Table大小测试 Index大小测试

GridFS简介

fs.files
{
  "_id": <ObjectId>,
  "length": <num>,
  "chunkSize": <num>,
  "uploadDate": <timestamp>,
  "md5": <hash>,
  "filename": <string>,
  "contentType": <string>,
  "aliases": <string array>,
  "metadata": <any>
}
fs.chunks
{
  "_id": <ObjectId>,
  "files_id": <ObjectId>,
  "n": <num>,
  "data": <binary>
}
mongofiles

mongofiles -d records put foo.txt
mongofiles -d records get foo.txt

Hadoop vs Spark

MongoDB & Hadoop

MongoDB & Hadoop