官术网_书友最值得收藏!

Write optimization

Traditional relational and document databases are optimized for read performance. Writing data to a relational database will typically involve making in - place updates to complicated data structures on disk, in order to maintain a data structure that can be read efficiently and flexibly. Updating these data structures is a very expensive operation from a standpoint of disk I/O, which is often the limiting factor for database performance. Since writes are more expensive than reads, you'll typically avoid any unnecessary updates to a relational database, even at the expense of extra read operations.

Cassandra, on the other hand, is highly optimized for write throughput and, in fact, never modifies data on disk; it only appends to existing files or creates new ones. This is much easier on disk I/O and means that Cassandra can provide astonishingly high write throughput. Since both writing data to Cassandra and storing data in Cassandra are inexpensive, denormalization carries little cost and is a good way to ensure that data can be efficiently read in various access scenarios.

Because Cassandra is optimized for write volume, you shouldn't shy away from writing data to the database. In fact, it's most efficient to write without reading whenever possible, even if doing so might result in redundant updates.

Just because Cassandra is optimized for writes doesn't make it bad at reads; in fact, a well-designed Cassandra database can handle very heavy read loads with no problem. We'll cover the topic of efficient data modeling in great depth in the next few chapters.

主站蜘蛛池模板: 娄底市| 常宁市| 乌鲁木齐县| 个旧市| 府谷县| 昌江| 佛教| 万荣县| 读书| 若羌县| 康马县| 青龙| 会泽县| 巧家县| 平江县| 孝昌县| 上饶市| 金门县| 舒兰市| 浦北县| 肇东市| 密云县| 化德县| 万盛区| 宝山区| 遵义市| 厦门市| 大新县| 海南省| 来宾市| 万山特区| 保定市| 宝清县| 宿松县| 商都县| 霞浦县| 许昌县| 隆子县| 托克逊县| 涟水县| 神池县|