粗看WASP :Alibaba的海量数据分布式数据库探索
Email:colorant at 163.com BLOG:http://blog.csdn.net/colorant/ == 是什么 == Wasp 是阿里集团开发的基于 HBase 的一个数据库方案,其根本出发点是仿效 Google 的 Megastore ,“在HBase系统上不牺牲线性拓展能力的同时又能提供跨行事务、索引、SQL的功
Email:colorant at 163.com
BLOG:http://blog.csdn.net/colorant/
== 是什么 ==
Wasp是阿里集团开发的基于HBase的一个数据库方案,其根本出发点是仿效Google的Megastore,“在HBase系统上不牺牲线性拓展能力的同时又能提供跨行事务、索引、SQL的功能”
== 架构原理 ==
其设计原理可以参考Megastore的相关论文,Wasp自己的相关设计使用文档可以在下面两个地方找到
https://github.com/alibaba/wasp/wiki/Chinese
http://wenku.baidu.com/view/c85f50d984254b35eefd345c.html
Megastore框架的核心思想是将数据分割成不同的EntityGroup,EntityGroup的数据备份是跨Datacenter存放的,在EntityGroup内部提供完整的ACID支持,保证数据写操作在所有数据中心的同步备份。
从具体实现上来看,Wasp并没有实现Megastore在跨Data Center方面的相关设计思想,仅仅只是采用了Entity Groups这样的方案来划分和管理数据。
Megastore在很多设计上都是围绕超大规模的数据的并发这样一个核心思想,比如Entity Groups的跨地域备份,读数据时非主从式的平等节点由Paxos动态选主的思想等等,都是为了保证读操作时的去中心化,以提高性能,而Wasp的架构方案更像HBase自身的方案,存在FMaster节点和FServer节点,通过Zookeeper确定当前FMaster,每个FServer管理若干Entity Groups,基本还是固定的主从中心式的。在Entity Group的使用上,Wasp则基本保留了Megastore的原始设计,通过RedoLog / MVCC / 跨Entity两阶段提交等方式解决并发读写的一致性问题
== 具体实现 ==
Wasp使用Alibaba自己的Druid项目实现SQL语法的解析,采用Netty和Protobuf构建服务器内部通讯协议框架。
Wasp的数据主要映射为HBase上的4类表,全局的 _FMETA_ 表记录所有Wasp表的meta信息,每个wasp表数据对应的entity表,相同Entitygroup Key管辖下所有表对应的Redolog表,以及索引表。
目前Wasp对SQL的语法支持还很简陋,以Query为例,仅支持Equal condition和索引上的Compare类Range condition。对Int等数据结构的支持,在比较操作中也存在bug,其它稍微复杂一点的SQL语法,如UDF,limit, having, group by, join, order by 等等操作目前都是没有的,当然这可能也取决于wasp的具体应用场合,或许只需要最简单的Equal和特定字段上的Range condition类的查询。
此外从SQL Plan实现的角度来看,似乎目前只是简单的转换为Get/Put/Delete等HBase操作,以HBase的角度来看是纯粹的客户端应用程序,没有使用任何Hbase RS端的能力,如filter,coprocessor等等加以优化,因此如果要实现Aggregation类的功能,在性能上大概会受到比较大的影响。
== 总结 ==
总体看来,Wasp并不能提供一个海量数据跨数据中心的解决方案,其规模受单个Hbase cluster所限,因此一定程度上来说和MegaStore所解决的目标问题还是有很大差距的,Wasp更多的是在HBase之上提供一个增强的方案,提供简单的SQL接口,和跨行事务的支持。如果光从SQLon HBase的角度上看,与SaleForce的Phoenix有很大的差距。但在跨行事务支持方面还是优于Phoenix的(Phoenix的在事务方面的支持几乎完全取决于HBase自身的能力),代码功能等目前看来还不成熟,还要看将来的发展情况。当然,从代码框架,设计模式等方面上看,作者的编程功力还是很不错的,要学习。
我只是快速的了解了一下Wasp的实现,自身能力有限,所以不保证以上看法的准确性,如有偏差还请指正。

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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics











Last week, amid the internal wave of resignations and external criticism, OpenAI was plagued by internal and external troubles: - The infringement of the widow sister sparked global heated discussions - Employees signing "overlord clauses" were exposed one after another - Netizens listed Ultraman's "seven deadly sins" Rumors refuting: According to leaked information and documents obtained by Vox, OpenAI’s senior leadership, including Altman, was well aware of these equity recovery provisions and signed off on them. In addition, there is a serious and urgent issue facing OpenAI - AI safety. The recent departures of five security-related employees, including two of its most prominent employees, and the dissolution of the "Super Alignment" team have once again put OpenAI's security issues in the spotlight. Fortune magazine reported that OpenA

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.

70B model, 1000 tokens can be generated in seconds, which translates into nearly 4000 characters! The researchers fine-tuned Llama3 and introduced an acceleration algorithm. Compared with the native version, the speed is 13 times faster! Not only is it fast, its performance on code rewriting tasks even surpasses GPT-4o. This achievement comes from anysphere, the team behind the popular AI programming artifact Cursor, and OpenAI also participated in the investment. You must know that on Groq, a well-known fast inference acceleration framework, the inference speed of 70BLlama3 is only more than 300 tokens per second. With the speed of Cursor, it can be said that it achieves near-instant complete code file editing. Some people call it a good guy, if you put Curs

According to news on June 26, at the opening ceremony of the 2024 World Mobile Communications Conference Shanghai (MWC Shanghai), China Mobile Chairman Yang Jie delivered a speech. He said that currently, human society is entering the fourth industrial revolution, which is dominated by information and deeply integrated with information and energy, that is, the "digital intelligence revolution", and the formation of new productive forces is accelerating. Yang Jie believes that from the "mechanization revolution" driven by steam engines, to the "electrification revolution" driven by electricity, internal combustion engines, etc., to the "information revolution" driven by computers and the Internet, each round of industrial revolution is based on "information and "Energy" is the main line, bringing productivity development

Using the database callback function in Golang can achieve: executing custom code after the specified database operation is completed. Add custom behavior through separate functions without writing additional code. Callback functions are available for insert, update, delete, and query operations. You must use the sql.Exec, sql.QueryRow, or sql.Query function to use the callback function.

JSON data can be saved into a MySQL database by using the gjson library or the json.Unmarshal function. The gjson library provides convenience methods to parse JSON fields, and the json.Unmarshal function requires a target type pointer to unmarshal JSON data. Both methods require preparing SQL statements and performing insert operations to persist the data into the database.
