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

Coupling parents and children using static columns

The parent-child relationships we've encoded in our schema thus far are implicit in the structure of the primary keys but not explicit from Cassandra's standpoint. While we know that the user_status_updates.username column corresponds to the parent primary key users.username, Cassandra itself has no concept of the relationship between the two.

In a relational database, we might make the relationship explicit in the schema using foreign key constraints, but Cassandra doesn't offer anything like this. In fact, if we want to use two different tables for users and user_status_updates, there isn't anything we can do to explicitly encode their relationship in the database schema. However, there is a way to combine user profiles and status updates into a single table while still maintaining the one-to-many relationship between them. To achieve this merger, we'll use a feature of Cassandra tables that we haven't seen before—static columns.

主站蜘蛛池模板: 静海县| 乌拉特中旗| 乌兰浩特市| 定南县| 山阴县| 惠水县| 新民市| 新津县| 赫章县| 扬州市| 攀枝花市| 昌黎县| 辽阳县| 博白县| 留坝县| 互助| 伊金霍洛旗| 自贡市| 油尖旺区| 郎溪县| 会同县| 永胜县| 盐源县| 黔西县| 柳林县| 黑河市| 通州市| 宁武县| 霸州市| 谢通门县| 雷山县| 祁东县| 塔河县| 图木舒克市| 古交市| 保山市| 雷州市| 镇赉县| 长白| 临城县| 梁山县|