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

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.

主站蜘蛛池模板: 北流市| 苏尼特左旗| 沙雅县| 屯门区| 比如县| 拉萨市| 雷波县| 驻马店市| 漾濞| 肃南| 明水县| 永平县| 湟中县| 织金县| 德保县| 静宁县| 九台市| 四川省| 乳源| 文成县| 平远县| 乃东县| 独山县| 白朗县| 疏附县| 怀仁县| 喀喇沁旗| 吴桥县| 白城市| 祁阳县| 新田县| 翁源县| 漳州市| 潢川县| 华安县| 永和县| SHOW| 宣化县| 清水县| 大竹县| 惠州市|