从分布式存储设计到自动化运维
以下内容由[五四陈科学院]提供 http://www.infoq.com/cn/articles/nosql-dynamo 三年前在infoq发表的一篇关于两种特别有代表性的分布式存储的设计思路解析,三年过去了,今天再来总结看看这几年的变化。 实际上,这三年,还是两个东西,一直没有冒出来更牛B

以下内容由[五四陈科学院]提供

http://www.infoq.com/cn/articles/nosql-dynamo 三年前在infoq发表的一篇关于两种特别有代表性的分布式存储的设计思路解析,三年过去了,今天再来总结看看这几年的变化。
实际上,这三年,还是两个东西,一直没有冒出来更牛B的东西。
一、dynamo代表作riak特点
早几年以cassandra为代表此类项目,固定特点为:水平扩展、无中心节点、多备份、最终一致性、性能一般、适合海量数据。因为cassandra在业界的使用失败案例太多,让大家避而远之。这两年,以erlang开发的riak又冒出水面。
1.1 erlang
这作为riak的最大特点一点也不为过,因为语言在分布式领域的独特能力,使得riak的源代码十分简洁干净。不过一万多行的代码,在第一次读到它的代码时,我也感叹,几年前,傻希希的用java代码堆了十几万行的nuclear代码,真是太笨了。
1.2 完整的dynamo实现
在cassandra的年代,许多东西不方便实现,版本控制的向量时钟使用了timestamp代替,vnode在cassandra上是非常大的区块,在进行负载均衡时有很大可能不均匀。到了riak的时代,所有的特点,在erlang的支持下,完成了各种细节。并且增加了:1.http存取的支持。2.双向索引。3.搜索支持。4.m/r支持。
二、bigtable代表作hbase特点
与dynamo对应的解决方案bigtable的历史更加悠久一些,开源项目也进行了很多年,hbase社区也正在不断地完善。
1.1 偷懒地依赖hdfs
严格说来hbase的实现,只主要关心了regionServer(中心节点所在,用来分配数据所在位置),所以说偷懒地在底下使用了hdfs完成备份工作。
1.2 列簇
在借用hdfs之后,在其上实现的存储格式让hbase可以满足各式各样的需求,当然了,这么复杂的交互,最好还是使用ssd之类的高速度的存储介质。
三、发展方向及特点
在回顾了两大阵营的各自特点之后,再来看看未来。
3.1 mysql时代
招一堆的mysql dba,指哪打哪,哪坏修哪。工作得很好!
3.2 nosql时代
开发工程师了解了dba的苦逼,以及老板招不到dba的苦逼,决定将数据结构化,简化代码的数据结构。
典型的代表key-value系统。
再基于这些单一的结构,做一堆的自动加机器自动转数据的功能。riak在此列。hbase略高于此。
3.3 未来时代
不仅是存储,整个运维工作,都应该是自动化演进,你可以想象:一个晴朗的下午,工程师带着耳机听着歌,将需求模型输入之后,一个红按钮一按,代码已经写好,test自动开始,AB test,staging,一切OK,自动分发到了各处。上线五分钟,某处开始报警,中央自动判断如何添加机器,执行添加。
--写在32位服务器已经过时了的日子,纪念一下,中国都应该记住。
想快点找到作者也可以到Twitter上留言: @54chen
或者你懒得带梯子上墙,请到新浪微博:@54chen
原文地址:从分布式存储设计到自动化运维, 感谢原作者分享。
Explain the role of InnoDB redo logs and undo logs.Apr 15, 2025 am 12:16 AMInnoDB uses redologs and undologs to ensure data consistency and reliability. 1.redologs record data page modification to ensure crash recovery and transaction persistence. 2.undologs records the original data value and supports transaction rollback and MVCC.
What are the key metrics to look for in an EXPLAIN output (type, key, rows, Extra)?Apr 15, 2025 am 12:15 AMKey metrics for EXPLAIN commands include type, key, rows, and Extra. 1) The type reflects the access type of the query. The higher the value, the higher the efficiency, such as const is better than ALL. 2) The key displays the index used, and NULL indicates no index. 3) rows estimates the number of scanned rows, affecting query performance. 4) Extra provides additional information, such as Usingfilesort prompts that it needs to be optimized.
What is the Using temporary status in EXPLAIN and how to avoid it?Apr 15, 2025 am 12:14 AMUsingtemporary indicates that the need to create temporary tables in MySQL queries, which are commonly found in ORDERBY using DISTINCT, GROUPBY, or non-indexed columns. You can avoid the occurrence of indexes and rewrite queries and improve query performance. Specifically, when Usingtemporary appears in EXPLAIN output, it means that MySQL needs to create temporary tables to handle queries. This usually occurs when: 1) deduplication or grouping when using DISTINCT or GROUPBY; 2) sort when ORDERBY contains non-index columns; 3) use complex subquery or join operations. Optimization methods include: 1) ORDERBY and GROUPB
Describe the different SQL transaction isolation levels (Read Uncommitted, Read Committed, Repeatable Read, Serializable) and their implications in MySQL/InnoDB.Apr 15, 2025 am 12:11 AMMySQL/InnoDB supports four transaction isolation levels: ReadUncommitted, ReadCommitted, RepeatableRead and Serializable. 1.ReadUncommitted allows reading of uncommitted data, which may cause dirty reading. 2. ReadCommitted avoids dirty reading, but non-repeatable reading may occur. 3.RepeatableRead is the default level, avoiding dirty reading and non-repeatable reading, but phantom reading may occur. 4. Serializable avoids all concurrency problems but reduces concurrency. Choosing the appropriate isolation level requires balancing data consistency and performance requirements.
MySQL vs. Other Databases: Comparing the OptionsApr 15, 2025 am 12:08 AMMySQL is suitable for web applications and content management systems and is popular for its open source, high performance and ease of use. 1) Compared with PostgreSQL, MySQL performs better in simple queries and high concurrent read operations. 2) Compared with Oracle, MySQL is more popular among small and medium-sized enterprises because of its open source and low cost. 3) Compared with Microsoft SQL Server, MySQL is more suitable for cross-platform applications. 4) Unlike MongoDB, MySQL is more suitable for structured data and transaction processing.
How does MySQL index cardinality affect query performance?Apr 14, 2025 am 12:18 AMMySQL index cardinality has a significant impact on query performance: 1. High cardinality index can more effectively narrow the data range and improve query efficiency; 2. Low cardinality index may lead to full table scanning and reduce query performance; 3. In joint index, high cardinality sequences should be placed in front to optimize query.
MySQL: Resources and Tutorials for New UsersApr 14, 2025 am 12:16 AMThe MySQL learning path includes basic knowledge, core concepts, usage examples, and optimization techniques. 1) Understand basic concepts such as tables, rows, columns, and SQL queries. 2) Learn the definition, working principles and advantages of MySQL. 3) Master basic CRUD operations and advanced usage, such as indexes and stored procedures. 4) Familiar with common error debugging and performance optimization suggestions, such as rational use of indexes and optimization queries. Through these steps, you will have a full grasp of the use and optimization of MySQL.
Real-World MySQL: Examples and Use CasesApr 14, 2025 am 12:15 AMMySQL's real-world applications include basic database design and complex query optimization. 1) Basic usage: used to store and manage user data, such as inserting, querying, updating and deleting user information. 2) Advanced usage: Handle complex business logic, such as order and inventory management of e-commerce platforms. 3) Performance optimization: Improve performance by rationally using indexes, partition tables and query caches.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools






