cql - How many tables/Column Families are created in cassandra for this example -


I'm reading it on the schema in CASADADRA.

The author creates two tables:

  Create a tablet tweet (Twitter_ID UUID primary key, author negotiation, body behavior); Create table timeline (user_id varchar, tweet_id uuid, author varchar, body varchar, primary key (user_id, tweet_id)); Note: For the tables are worried, they do not know that both tables can be "joined" on tweet_id in each table, tweet_id is seen as a unique column name of the UUID type. goes.  

If I have my understanding of my post, then the author says that no two pillar families have a physically produced table. This is just a large table that contains information for both the logical column family.

But when I think that is selected from where tweets_id = "xxx" (there is an internal marker for determining the column is for tweets) < / P>

Please look at this post, because the author shows up with good examples.

My question is how does the table timeline should be aware that in table tweets, "join" with tweet_id should be.

No, this is not made as a pillar family Both columns families were created separately And work independently from each other. What the author is saying is the non-relational data modeling aspect, which involves denormalizing your data and adding tables that match your query pattern.

When someone is "tweeted", then the application should have two different column families designed to store data about tweets. Once this tweets column family , And then the entry for the Timeline column family for each follower is basically the data about a particular tweet for the tweets column family Repeat once, and Once for each follower who belongs to the author.

How does the tweet in the table timeline know that it should "join" in tweets tweets in "tweets".

Simple, it does not know that Cassandra does not allow to join, and a properly designed application supported by Cassandra will not be included in the client-side, Each column family is designed in anticipation of each query that can be run. Sometimes, the app might want to query a specific tweet by tweet_id , and for this it will use the tweets column family, on the other hand, the post has been mentioned. The use of the application to ask about the 20 most recent tweets of a particular user is a matter, "In that situation, the timeline column family is designed to handle it. / P> < P> Summary:

  • Two LAM families are being defined.
  • Each column family is designed to manage a specific query.
  • No one is included; Database or client-side. Data is denormalized (duplicated), so that it can query the application data as quickly as possible.

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -