关系型数据库的扩展性.docx
文本预览下载声明
SQL Databases Dont Scale传统SQL数据库不具有可扩展性A question I’m often asked about Heroku is: “How do you scale the SQL database?” There’s a lot of things I can say about using caching, sharding, and other techniques to take load off the database. But the actual answer is: we don’t. SQL databases are fundamentally non-scalable, and there is no magical pixie dust that we, or anyone, can sprinkle on them to suddenly make them scale. 我经常向Heroku问一个问题:“你是如何进行扩展SQL数据库的?”。当然你可以说出许多技巧来降低数据库的负载,比如利用缓存,数据分片等等。事实上真正的回答却是:“我们做不到。”因为从根本上讲,传统SQL数据库并不具有可扩展能力。这个世界上也根本没有什么神奇的精灵之尘,可以让我们任何人突然使其获得扩展性的。What Is Scaling?什么是可扩展性?To qualify as true scaling, I believe a technique must fit the following criteria: 必须满足以下几个标准的才是真正合格的可扩展性,我认为这都是必要条件: 1. Horizontal scale: more servers creates more capacity. 1. 水平扩展能力:更多的服务器可以提供成比例更多的容量或者更高的性能。 2. Transparent to the application: the business logic of the app should be separated from concerns of scaling server resources. 2. 对应用程序透明:应用程序中蕴含的业务逻辑要和关注机器资源的扩展性相分离,做到底层对上层业务的隔离,提供透明化的扩展能力。 3. No single point of failure: there should be no one server which, if lost, causes downtime of the application. 3. 没有单点故障问题:系统中不应该存在单点,就是说不能因为一个服务器的宕机或者故障而导致整个应用程序的不可用。As an example from the hardware world, a RAID5 disk array offers true scaling: 在硬件世界里,RAID5磁盘阵列提供了一个很好的可扩展性的例子: 1. Horizontal scale: you can run a RAID5 with 4 disks, or 12, or 20; more disks gives you more drive space and (generally) better performance. 1. 水平扩展:我们可以在4块,12块,甚至20块盘上应用RAID5,磁盘越多可用的空间越大,性能也越好; 2. Transparent to the application: applications using the RAID as a single device. My text editor doesn’t care that the file it is saving or loading is split across many disks. 2. 对应用程序透明:应用程序会将RAID作为一个整体,我的文本编辑器才不会关心它加载或者保存的文件是要读写多个磁盘的。 3. No single point of failure: you can pop out a drive and the array will continue to function (albeit with a performance hit, known as “degraded mode”). Replace the drive and it will rebuild itself. All of this happens without the applications using the RAID being aware any in
显示全部