ClickHouse/docs/zh/introduction/distinctive_features.md

65 lines
4.2 KiB
Markdown
Raw Normal View History

# ClickHouse的独特功能
## 真正的列式数据库管理系统
在一个真正的列式数据库管理系统中除了数据本身外不应该存在其他额外的数据。这意味着为了避免在值旁边存储它们的长度“number”你必须支持固定长度数值类型。例如10亿个UInt8类型的数据在未压缩的情况下大约消耗1GB左右的空间如果不是这样的话这将对CPU的使用产生强烈影响。即使是在未压缩的情况下紧凑的存储数据也是非常重要的因为解压缩的速度主要取决于未压缩数据的大小。
这是非常值得注意的,因为在一些其他系统中也可以将不同的列分别进行存储,但由于对其他场景进行的优化,使其无法有效的处理分析查询。例如: HBaseBigTableCassandraHyperTable。在这些系统中你可以得到每秒数十万的吞吐能力但是无法得到每秒几亿行的吞吐能力。
需要说明的是ClickHouse不单单是一个数据库 它是一个数据库管理系统。因为它允许在运行时创建表和数据库、加载数据和运行查询,而无需重新配置或重启服务。
## 数据压缩
在一些列式数据库管理系统中(例如InfiniDB CE and MonetDB) 不是用数据压缩。但是, 数据压缩在实现优异的存储系统中确实起着关键的作用。
## 数据的磁盘存储
许多的列式数据库(如 SAP HANA, Google PowerDrill)只能在内存中工作这种方式会造成比实际更多的设备预算。ClickHouse被设计用于工作在传统磁盘上的系统它提供每GB更低的存储成本但如果有可以使用SSD和内存它也会合理的利用这些资源。
## 多核心并行处理
大型查询可以以很自然的方式在ClickHouse中进行并行化处理以此来使用当前服务器上可用的所有资源。
## 多服务器分布式处理
上面提到的列式数据库管理系统中,几乎没有一个支持分布式的查询处理。
在ClickHouse中数据可以保存在不同的shard上每一个shard都由一组用于容错的replica组成查询可以并行的在所有shard上进行处理。这些对用户来说是透明的
## 支持SQL
ClickHouse支持基于SQL的查询语言该语言大部分情况下是与SQL标准兼容的。
支持的查询包括 GROUP BYORDER BYINJOIN以及非相关子查询。
不支持窗口函数和相关子查询。
## 向量引擎
为了高效的使用CPU数据不仅仅按列存储同时还按向量(列的一部分)进行处理。
## 实时的数据更新
ClickHouse支持在表中定义主键。为了使查询能够快速在主键中进行范围查找数据总是以增量的方式有序的存储在MergeTree中。因此数据可以持续不断高效的写入到表中并且写入的过程中不会存在任何加锁的行为。
## 索引
按照主键对数据进行排序这将帮助ClickHouse以几十毫秒的低延迟对数据进行特定值查找或范围查找。
## 适合在线查询
在线查询意味着在没有对数据做任何预处理的情况下以极低的延迟处理查询并将结果加载到用户的页面中。
## 支持近似计算
ClickHouse提供各种各样在允许牺牲数据精度的情况下对查询进行加速的方法
1. 用于近似计算的各类聚合函数distinct values, medians, quantiles
2. 基于数据的部分样本进行近似查询。这时,仅会从磁盘检索少部分比例的数据。
3. 不使用全部的聚合条件,通过随机选择有限个数据聚合条件进行聚合。这在数据聚合条件满足某些分布条件下,在提供相当准确的聚合结果的同时降低了计算资源的使用。
## 支持数据复制和数据完整性
ClickHouse使用异步的多主复制技术。当数据被写入任何一个可用副本后系统会在后台将数据分发给其他副本以保证系统在不同副本上保持相同的数据。在大多数情况下ClickHouse能在故障后自动恢复在一些复杂的情况下需要少量的手动恢复。
WIP on docs (#3813) * CLICKHOUSE-4063: less manual html @ index.md * CLICKHOUSE-4063: recommend markdown="1" in README.md * CLICKHOUSE-4003: manually purge custom.css for now * CLICKHOUSE-4064: expand <details> before any print (including to pdf) * CLICKHOUSE-3927: rearrange interfaces/formats.md a bit * CLICKHOUSE-3306: add few http headers * Remove copy-paste introduced in #3392 * Hopefully better chinese fonts #3392 * get rid of tabs @ custom.css * Apply comments and patch from #3384 * Add jdbc.md to ToC and some translation, though it still looks badly incomplete * minor punctuation * Add some backlinks to official website from mirrors that just blindly take markdown sources * Do not make fonts extra light * find . -name '*.md' -type f | xargs -I{} perl -pi -e 's//g' {} * find . -name '*.md' -type f | xargs -I{} perl -pi -e 's/ sql/g' {} * Remove outdated stuff from roadmap.md * Not so light font on front page too * Refactor Chinese formats.md to match recent changes in other languages * Update some links on front page * Remove some outdated comment * Add twitter link to front page * More front page links tuning * Add Amsterdam meetup link * Smaller font to avoid second line * Add Amsterdam link to README.md * Proper docs nav translation * Back to 300 font-weight except Chinese * fix docs build * Update Amsterdam link * remove symlinks * more zh punctuation * apply lost comment by @zhang2014 * Apply comments by @zhang2014 from #3417 * Remove Beijing link * rm incorrect symlink * restore content of docs/zh/operations/table_engines/index.md * CLICKHOUSE-3751: stem terms while searching docs * CLICKHOUSE-3751: use English stemmer in non-English docs too * CLICKHOUSE-4135 fix * Remove past meetup link * Add blog link to top nav * Add ContentSquare article link * Add form link to front page + refactor some texts * couple markup fixes * minor * Introduce basic ODBC driver page in docs * More verbose 3rd party libs disclaimer * Put third-party stuff into a separate folder * Separate third-party stuff in ToC too * Update links * Move stuff that is not really (only) a client library into a separate page * Add clickhouse-hdfs-loader link * Some introduction for "interfaces" section * Rewrite tcp.md * http_interface.md -> http.md * fix link * Remove unconvenient error for now * try to guess anchor instead of failing * remove symlink * Remove outdated info from introduction * remove ru roadmap.md * replace ru roadmap.md with symlink * Update roadmap.md * lost file * Title case in toc_en.yml * Sync "Functions" ToC section with en * Remove reference to pretty old ClickHouse release from docs * couple lost symlinks in fa * Close quote in proper place * Rewrite en/getting_started/index.md * Sync en<>ru getting_started/index.md * minor changes * Some gui.md refactoring * Translate DataGrip section to ru * Translate DataGrip section to zh * Translate DataGrip section to fa * Translate DBeaver section to fa * Translate DBeaver section to zh * Split third-party GUI to open-source and commercial * Mention some RDBMS integrations + ad-hoc translation fixes * Add rel="external nofollow" to outgoing links from docs * Lost blank lines * Fix class name * More rel="external nofollow" * Apply suggestions by @sundy-li * Mobile version of front page improvements * test * test 2 * test 3 * Update LICENSE * minor docs fix * Highlight current article as suggested by @sundy-li * fix link destination * Introduce backup.md (only "en" for now) * Mention INSERT+SELECT in backup.md * Some improvements for replication.md * Add backup.md to toc * Mention clickhouse-backup tool * Mention LightHouse in third-party GUI list * Introduce interfaces/third-party/proxy.md * Add clickhouse-bulk to proxy.md * Major extension of integrations.md contents * fix link target * remove unneeded file * better toc item name * fix markdown * better ru punctuation * Add yet another possible backup approach * Simplify copying permalinks to headers * Support non-eng link anchors in docs + update some deps * Generate anchors for single-page mode automatically * Remove anchors to top of pages * Remove anchors that nobody links to * build fixes * fix few links * restore css * fix some links * restore gifs * fix lost words * more docs fixes * docs fixes * NULL anchor * update urllib3 dependency * more fixes
2018-12-12 17:28:00 +00:00
更多信息,参见[数据复制](../operations/table_engines/replication.md)。
[来源文章](https://clickhouse.yandex/docs/en/introduction/distinctive_features/) <!--hide-->