Case Study 1: Delicious clone

Our first case study is an example of how one would structure the schema for a Delicious clone. We'll also provide some examples of 'insert'ing and 'get'ing data.

Here's our schema:

<Keyspace Name="DeliciousClone">
  <KeysCachedFraction>0.01</KeysCachedFraction>
  <ColumnFamily CompareWith="UTF8Type" Name="Users"/>
  <ColumnFamily CompareWith="UTF8Type" Name="Bookmarks"/>
  <ColumnFamily CompareWith="UTF8Type" Name="Tags"/>
  <ColumnFamily CompareWith="UTF8Type" Name="UserTags"/>
  <ColumnFamily CompareWith="UTF8Type" CompareSubcolumnsWith="TimeUUIDType" ColumnType="Super" Name="UserBookmarks"/>
</Keyspace>

Case Study 2: Twitter clone

Our schema:

<Keyspace Name="TwitterClone">
  <KeysCachedFraction>0.01</KeysCachedFraction>
  <ColumnFamily CompareWith="UTF8Type" Name="Users" />
  <ColumnFamily CompareWith="UTF8Type" Name="UserAudits" />
  <ColumnFamily CompareWith="UTF8Type" CompareSubcolumnsWith="TimeUUIDType" ColumnType="Super" Name="UserRelationships" />
  <ColumnFamily CompareWith="UTF8Type" Name="Usernames" />
  <ColumnFamily CompareWith="UTF8Type" Name="Statuses" />
  <ColumnFamily CompareWith="UTF8Type" Name="StatusAudits" />
  <ColumnFamily CompareWith="UTF8Type" CompareSubcolumnsWith="TimeUUIDType" ColumnType="Super" Name="StatusRelationships" />
</Keyspace>

Taken from Evan Weaver's Ruby Cassandra client: http://github.com/fauna/cassandra/

More to come

https://c.statcounter.com/9397521/0/fe557aad/1/|stats

  • No labels