123
 123

Tip: 看不到本站引用 Flickr 的图片? 下载 Firefox Access Flickr 插件 | AD: 订阅 DBA notes --

2010-06-14 Mon

17:47 Notes on Learning MySQL (as an Oracle DBA) (5921 Bytes) » The Pythian Blog

I spent some time last month getting up to speed on MySQL. One of the nice perks of working at Pythian is the ability to study during the workday. They could have easily said “You are an Oracle DBA, you don’t need to know MySQL. We have enough REAL MySQL experts”, but they didn’t, and I appreciate.

So how does an Oracle DBA goes about learning MySQL?
Obviously you start by reading the docs. Specifically, I looked for the MySQL equivalent of the famous Oracle “Concepts Guide”.
Unfortunately, it doesn’t exist. I couldn’t find any similar overview of the architecture and the ideas behind the database. The first chapter of “High Performance MySQL” had a high level architecture review, which was useful but being just one chapter in a book, it lacked many of the details I wanted to learn. Peter Zaitsev’s “InnoDB Architecture” presentation had the kind of information I needed – but covered just InnoDB.

Thats really too bad because I definitely feel the lack – which I can easily tell you what Oracle does when you connect to a database, run a select, an update, commit or rollback – I can’t say the same about MySQL. So far I managed without this knowledge, but I have a constant worry that this will come back and bite me later.

Lacking a concepts guide, I read the documentation I had access to: Sheeri has nice presentations available for Pythian employees (and probably customers too. I’m not sure if she ever released them to the whole world). The official documentation is not bad either – it covers syntax without obvious errors and serves as a decent “how do I do X?” guide.

But reading docs is only half the battle. The easier half too. So I installed MySQL 5.1 on my Ubuntu from ready packages. Then I installed MySQL 5.5 from the tarball – which was not nearly as much fun, but by the time this worked I know much more about where everything is located and the various ways one can mis-configure MySQL.

Once the installation was successfull, I played a bit with users, schemas and databases. MySQL is weird – Schemas are called databases, users have many-to-many relation with databases. If a user logs in from a differnet IP, it is almost like a different user. If you delete all the data files and restart MySQL – it will create new empty data files instead. You can easily start a new MySQL server on the same physical box by modifying one file and creating few directories.

MySQL docs make a very big deal about storage engines. There are only 2 things that are important to rememeber though: MyISAM is non-transactional and is used for mysql schema (the data dictionary), it doesn’t have foreign keys or row level locks. InnoDB is transactional, has row level locks and is used everywhere else.

There are a confusing bunch of tools for backing up MySQL. MySQLDump is the MySQL equivalent of Export. Except that it creates a file full of the SQL commands required to recreate the database. These files can grow huge very fast, but it is very easy to restore from them, restore any parts of the schema or even modifying the data or schema before restoring.
XTRABackup is a tool for consistent backups of InnoDB schema (remember that in MyISAM there are no transactions so consistent backups is rather meaningless). It is easy to use – one command to backup, two commands to restore. You can do PITR of sorts with it, and you can restore specific data files. It doesn’t try to manage the backup policies for you the way RMAN does – so cleaning old backups is your responsibility.

Replication is considered a basic skill, not an advanced skill like in the Oracle world. Indeed once you know how to restore from a backup, setting up replication is trivial. It took me about 2 hours to configure my first replication in MySQL. I think in Oracle Streams it took me few days, and that was on top of years of other Oracle experience.

Having access to experienced colleagues who are happy to spend time teaching a newbie is priceless. I already mentioned Sheeri’s docs. Chris Schneider volunteered around 2 hours of his time to introduce me to various important configuration parameters, innoDB secrets and replication tips and tricks. Raj Thukral helped me by providing step by step installation and replication guidance and helping debug my work. I’m so happy to work with such awesome folks.

To my shock and horror, at that point I felt like I was done. I learned almost everything important there was to know about MySQL. It took a month. As an Oracle DBA, after two years I still felt like a complete newbie, and even today there are many areas I wish I had better expertise. I’m sure it is partially because I don’t know how much I don’t know, but MySQL really is a rather simple DB – there is less to tweak, less to configure, fewer components, less tools to learn.

Jonathan Lewis once said that he was lucky to learn Oracle with version 6, because back then it was still relatively simple to learn, but the concepts didn’t change much since so what he learned back then is still relevant today. Maybe in 10 years I’ll be saying the same about MySQL.

05:06 NoSQL Ecosystem News & Links 2010-06-14 (2110 Bytes) » myNoSQL
03:21 Redis UDP Protocol (1482 Bytes) » myNoSQL
Redis UDP Protocol:

Salvatore Sanfilippo:

The default and usually the preferred way for a client to chat with a Redis server is using the TCP protocol described in the Protocol Specification. In some environments the trade off of switching to a less reliable and not feature complete protocol running over UDP in order to improve latency is a good idea, so starting from Redis 2.2 there is support for a binary UDP protocol.

Based on a recent ☞ tweet it looks like the new Redis UDP protocol is already delivering some good results:

There are advantages (200k req/sec) but not so big as reported

2010-06-13 Sun

09:00 满天都是大鲸鱼 (4020 Bytes) » 知道分子

不知是否世界杯的缘故,最近 Twitter 心神不宁,天天冒出大鲸鱼。两天前,Twitter 运维团队发表了博客《完美风暴之鲸鱼篇》,描述他们初步找到的几个症结,以及相关补救措施。

直接原因是某个内部子网拥塞,导致网站性能问题。Twitter 运维团队此前将两个快速增长、吞吐量较高的组件放在一个网段内,但是没有对该网段的容量作较完善的监控,而且某处配置还不小心搞错了。补救措施很简单,网络扩容、完善监控、调整布局、均衡负载。

据接近 Google 和 Facebook 的一位朋友说,这两家全球排名数一数二的网站,近来也颇为内部网络拥塞问题挠头。服务器性能越来越强,数据吞吐量越来越大,加之内部应用组件/服务间的数据交换日趋错综复杂,在数据处理单元尚未达到峰值之前,数据传输单元却往往率先达到瓶颈,从而触发雪崩。

但从今天的状况来看,大鲸鱼依然不时浮现,可见这个问题尚未得到根本解决。如何驯服难以预估的流量怪兽,还得想一些办法。比如,当请求-反馈路径上的任何一个环节容量占用超过 90% 时,系统应自动进入戒备状态,按预定义的优先级列表依次推迟或关闭非关键的后台任务、内部应用,屏蔽爬虫来访,暂停访问量大的第三方应用,以腾出容量应付真正的客户访问需求。待利用率回落至 70% 以下,才解除警戒,陆续自动恢复上述被推迟、关闭、屏蔽、暂停的访问。

大多数网站对于自己的访问量构成、利用率状况、请求-反馈路径都没有作认真统计分析整理,自然也不会有关停优先级列表这种东西出来,更遑论自动调整。什么都重要,就是什么都不重要,什么都要保,于是什么都保不住。突发事件一来,大家一起死。

相信 Twitter 团队的聪明人会找到解决问题的有效方法,毕竟吃互联网这碗饭,可用性就是下锅的米。
04:52 Oracle数据库性能模型 (1726 Bytes) » Hello DBA

建立数据库性能模型,这是我最近一直在思考的一个问题。这个命题还是非常有意义的,因为我们在很多情况下都需要对数据库做性能评估,容量规划和风险预测。很多DBA的优化经验都局限在一个很小的数据库技术领域内,而对整个系统的性能容量并不十分了解。我希望能够给大家一些简单的模型和经验数据,帮助大家对系统的整体性能有一个更深层次的了解。

这篇PPT可能还达不到模型的理论高度,甚至很多数据还不是十分准确,只是我个人思考的一个结果,希望能抛砖引玉,大家一起思考和进步。

2010-06-12 Sat

18:00 支付宝升级数字证书 采用短信校验码提升灵活性 (2156 Bytes) » 支付宝官方 Blog - 支付志

您的支付宝账户还在裸奔吗?或者您还在为安装数字证书而烦恼吗?

6月2日数字证书全面升级

1.   无需备份、无需导入,只要一部手机就能轻松搞定安装(接收短信校验码)
2.   即时安装即时保护账户,免去了电脑重装后证书不可用、非本机操作时无法进行账户操作等烦恼
3.   新增email+安全保护问题的安装方式,多一种选择多一重账户保护方式

安装步骤

l  体验中若有碰到问题,觉得爽和不爽的地方都统统告诉我们吧(问题收集邮箱:aq_szzs@alipay.com )

No related posts.