- Learning Apache Cassandra(Second Edition)
- Sandeep Yarabarla
- 153字
- 2021-07-03 00:19:36
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.
- 嵌入式系統(tǒng)應(yīng)用
- Mastercam 2017數(shù)控加工自動編程經(jīng)典實例(第4版)
- Practical Data Wrangling
- Windows內(nèi)核原理與實現(xiàn)
- 機器人編程實戰(zhàn)
- Ceph:Designing and Implementing Scalable Storage Systems
- 完全掌握AutoCAD 2008中文版:機械篇
- 21天學(xué)通C語言
- 網(wǎng)絡(luò)安全與防護
- 運動控制系統(tǒng)
- 基于Xilinx ISE的FPAG/CPLD設(shè)計與應(yīng)用
- Applied Data Visualization with R and ggplot2
- 電腦日常使用與維護322問
- 奇點將至
- Introduction to R for Business Intelligence