Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Apache Cassandra
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Apache Cassandra

Learning Apache Cassandra

By : Brown
4.4 (13)
close
close
Learning Apache Cassandra

Learning Apache Cassandra

4.4 (13)
By: Brown

Overview of this book

If you're an application developer familiar with SQL databases such as MySQL or Postgres, and you want to explore distributed databases such as Cassandra, this is the perfect guide for you. Even if you've never worked with a distributed database before, Cassandra's intuitive programming interface coupled with the step-by-step examples in this book will have you building highly scalable persistence layers for your applications in no time.
Table of Contents (14 chapters)
close
close
13
Index

Recording analytics observations


At this point, we've explored structuring both discrete and aggregate analytics data, and looked at accessing that data. However, to have interesting data aggregates to access, we first need to record our observations.

Updating a counter column

The daily_status_update_views table introduces a new type of column: the counter column. Counter columns store integer values, just like int and bigint columns; however, unlike a normal data column, counter columns are always incremented or decremented, rather than having a value set directly.

We've currently got two tables to store usage data: status_update_views to store raw view observations, and daily_status_update_views to store views by day. We'd like to record that one of alice's status updates was viewed on the web on October 5, 2014 at 3:12 P.M. EDT:

INSERT INTO "status_update_views" (
  "status_update_username", "status_update_id",
  "observed_at", "client_type"
) VALUES (
  'alice', 76e7a4d0-e796-11e3-90ce-5f98e903bf02...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY