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

Summary

In this chapter, we were introduced to the concept of compound primary keys and learned that a primary key consists of one or more partition keys and, optionally, one or more clustering columns. We saw how partition keys—the only type of key we had previously encountered—can group related rows together and how clustering columns provide an order for these rows within each partition.

Compound primary keys allow us to build a table containing users' status updates because they expose two important structures: grouping of related rows and ordering of rows. In the user_status_updates table, we encoded the relationship between users and their status updates implicitly in the structure of the primary key; the partition key refers to the parent row in the users table. We also explored the use of static columns to make this relationship explicit, storing all the information about users and their status updates in a single table.

In Chapter 4, Beyond Key-Value Lookup, we will pe into new ways of interacting with data that is organized using compound primary keys, allowing us to build functionality in our application for viewing users' timelines in a variety of interesting ways.

主站蜘蛛池模板: 巍山| 秭归县| 宣恩县| 图木舒克市| 宜城市| 清丰县| 榆树市| 舞钢市| 萍乡市| 阿拉尔市| 榆社县| 岚皋县| 南皮县| 巴青县| 郓城县| 临夏县| 辽阳县| 东丰县| 邓州市| 南岸区| 中卫市| 佳木斯市| 汕尾市| 九龙县| 苗栗市| 香河县| 吴桥县| 体育| 姚安县| 固原市| 东兰县| 黔西县| 安康市| 电白县| 周口市| 庆阳市| 和硕县| 临夏市| 米泉市| 武汉市| 深州市|