<?xml version="1.0" encoding="utf-8"?>
<!-- 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
-->
<?xml-stylesheet type="text/xsl" href="https://rollerweblogger.org/roller-ui/styles/rss.xsl" media="screen"?><rss version="2.0" 
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
  <title>Blogging Roller</title>
  <link>https://rollerweblogger.org/roller/</link>
    <atom:link rel="self" type="application/rss+xml" href="https://rollerweblogger.org/roller/feed/entries/rss?tags=wayin" />
  <description>Dave Johnson on open web technologies, social software and software development</description>
  <language>en-us</language>
  <copyright>Copyright 2026</copyright>
  <lastBuildDate>Tue, 28 Apr 2026 07:02:22 +0000</lastBuildDate>
  <generator>Apache Roller 6.1.5</generator>
  <item>
    <guid isPermaLink="true">https://rollerweblogger.org/roller/entry/how_wayin_does_orchestration</guid>
    <title>How Wayin does Cloud Orchestration</title>
    <dc:creator>Dave Johnson</dc:creator>
    <link>https://rollerweblogger.org/roller/entry/how_wayin_does_orchestration</link>
    <pubDate>Tue, 18 Jun 2013 16:16:34 +0000</pubDate>
    <category>Web Development</category>
    <category>asf</category>
    <category>aws</category>
    <category>cloud</category>
    <category>devops</category>
    <category>orchestration</category>
    <category>wayin</category>
<description>&lt;p&gt;I&amp;#39;ve already mentioned this on Twitter and LinkedIn, but just in case you missed it: I&amp;#39;ll be speaking tomorrow night at the &lt;a href=&quot;http://www.meetup.com/Triangle-DevOps/events/121662952&quot;&gt;Triangle AWS and Triangle DevOps&lt;/a&gt; joint meetup at &lt;a href=&quot;http://argylesocial.com/&quot;&gt;Argyle Social&lt;/a&gt; in Durham, NC. I&amp;#39;ll give a quick overview of cloud orchestration and &lt;a href=&quot;http://wayinhub.com&quot;&gt;Wayin Hub&lt;/a&gt;. Then I&amp;#39;ll dive into the details of how we automate deployment, scaling and backups for Wayin Hub using AWS and AWS Cloud Formation.&lt;/p&gt;

&lt;p&gt;As a little teaser, here&amp;#39;s a GIF animation of my automated deployment slide:&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;

&lt;p&gt;For more information check the &lt;a href=&quot;http://www.meetup.com/Triangle-DevOps/events/121662952&quot;&gt;Triangle DevOps page&lt;/a&gt; for the event.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;UPDATE: &lt;/b&gt; slide are now on &lt;a href=&quot;http://www.slideshare.net/snoopdave/wayin-devops2013&quot;&gt;SlideShare&lt;/a&gt;.&lt;/p&gt;

</description>  </item>
  <item>
    <guid isPermaLink="true">https://rollerweblogger.org/roller/entry/composite_keys_in_cassandra</guid>
    <title>Composite Keys in Apache Cassandra</title>
    <dc:creator>Dave Johnson</dc:creator>
    <link>https://rollerweblogger.org/roller/entry/composite_keys_in_cassandra</link>
    <pubDate>Thu, 23 May 2013 17:56:49 +0000</pubDate>
    <category>Open Source</category>
    <category>asf</category>
    <category>bigdata</category>
    <category>cassandra</category>
    <category>wayin</category>
    <category>wayinhub</category>
<atom:summary type="html">&lt;p&gt;Newer versions of &lt;a href=&quot;http://cassandra.apache.org&quot;&gt;Apache Cassandra&lt;/a&gt; include &lt;a href=&quot;http://cassandra.apache.org/doc/cql3/CQL.html&quot;&gt;CQL&lt;/a&gt;, an SQL-like query language that supports both query, update and delete statements as well as the Data Definition Language (DDL) statements like create and alter for tables and indexes. You can create tables (known as column families in Cassandra lingo) just like you can in a relational database, but there are some caveats.&lt;/p&gt;</atom:summary><description>&lt;p&gt;Newer versions of &lt;a href=&quot;http://cassandra.apache.org&quot;&gt;Apache Cassandra&lt;/a&gt; include &lt;a href=&quot;http://cassandra.apache.org/doc/cql3/CQL.html&quot;&gt;CQL&lt;/a&gt;, an SQL-like query language that supports both query, update and delete statements as well as the Data Definition Language (DDL) statements like create and alter for tables and indexes.&lt;/p&gt;

&lt;p&gt;You can create tables (known as column families in Cassandra lingo) just like you can in a relational database, but there are some caveats. One caveat is this: if you want to sort and use ORDER BY in queries on a table, then you will have to use composite-key in that table and that composite key must include the field that you wish to sort on. You have to decide which fields you wish to sort on when you design your data model, not when you formulate queries. Another caveat is that, with Cassandra 1.1, there is no support for secondary indexes on composite-keyed tables. That means you can only query on the fields in the composite-key and in certain specific ways. More on that later.&lt;/p&gt;

&lt;p&gt;In version 1.1, Cassandra supports (at least) two different models for storing data. You can use a single primary key in your table, or you can use a composite key. Cassandra stores your data differently for these two cases and the queries that you can perform on these two types of tables vary as well. &lt;/p&gt;

&lt;p&gt;I&#146;ll explain how simple-keyed and composite-keyed differ with some examples. The example is the Bite table, which holds a chunk of data identified by an ID and sorted by an integer score value. I don&#146;t want to get into details, but in the product I&amp;#39;m working on, &lt;a href=&quot;http://www.wayin.com/products/wayin-hub&quot;&gt;Wayin Hub&lt;/a&gt;, a Site contains Feeds and Feeds contain Bites, which might represent Tweets, RSS items or other social network activities. Hopefully, that will be enough background for you to understand the examples below.

&lt;h3&gt;Single-keyed Table&lt;/h3&gt;

&lt;p&gt;With a single keyed table you have a row for each entity that you store and a column in that row for each field of the entity. For example, to represent the Bite table as a single-keyed table it would be defined like so:&lt;/p&gt;

&lt;pre&gt;

   create table bite (
	id varchar PRIMARY KEY,
	feedid varchar,
	score bigint,
	data varchar
   );

   create index bite_feedid on bite (feedid);
   create index bite_score on bite (score);

&lt;/pre&gt;

&lt;p&gt;We need those id, feedid and score fields so we can look up bites by those values. The data field is used to store a JSON representation of other data we associate with each Bite. For example, if you only have three Bites in the table, here&#146;s what the results of a select * from bite might look like:&lt;/p&gt;

&lt;pre&gt;

 id   |  feedid  |  score  | data
------+----------+---------+----------------------
bite2 |  feed0   |   101   | { &#147;status&#148; : &#147;APPROVED&#148;, ... 
bite3 |  feed0   |   102   | { &#147;status&#148; : &#147;DENIED&#148;, ...
bite1 |  feed0   |   100   | { &#147;status&#148; : &#147;APPROVED&#148;, ...  

&lt;/pre&gt;

&lt;p&gt;The way the data is stored in Cassandra would look about the same, as illustrated in the diagram below. Each table row corresponds to a Row in Cassandra, the id of the table row is the Cassandra Row Key for the row. Each value in the row is a Cassandra Column with a key and a value. If you add more table rows, you get more Cassandra Rows.&lt;/p&gt;

&lt;img src=&quot;http://rollerweblogger.org/roller/mediaresource/fcac32c5-6a8d-4be9-acfa-1e56389c6c4c&quot;&gt;

&lt;p&gt;Now let&#146;s get back to the topic of this post and that caveat that I mentioned earlier.&lt;/p&gt;

&lt;h3&gt;Composite-keyed Table &lt;/h3&gt;

&lt;p&gt;If we want to sort data in a table, then we need to use a composite-keyed table.  With a composite-keyed table you define a composite-key made up of multiple fields from the table. The first key is known as the partition-key. To sort by score we also include the score in the composite key. And since it is possible for two Bites with the same partition key to occur at the very same time, we also include varchar ID to ensure uniqueness.&lt;p&gt;

&lt;p&gt;Here&#146;s how the Bite table is defined. The composite-key is the list of three fields in PRIMARY KEY parentheses.&lt;/p&gt;

&lt;pre&gt;

   create table Bite (
	 partkey varchar,
	 score bigint,
	 id varchar,
	 data varchar,
	 PRIMARY KEY (partkey, score, id)
   ) with clustering order by (score desc);

&lt;/pre&gt;

&lt;p&gt;And if you had three Bites in the table the query select * from bite would return this:&lt;/p&gt;

&lt;pre&gt;

 partkey  |  score  |  id   |  data
----------+---------+-------+----------------------
  feed0   |   102   | bite3 | { &#147;id&#148; : &#147;bite2&#148;, ... 
  feed0   |   101   | bite2 | { &#147;id&#148; : &#147;bite3&#148;, ...
  feed0   |   100   | bite1 | { &#147;id&#148; : &#147;bite1&#148;, ...  

&lt;/pre&gt;

&lt;p&gt;The surprise is how this table is stored in Cassandra. Instead of storing a Cassandra Row for each table row, the data is stored as one row. The more Bites you add to the table, the more Cassandra Columns are added to that Row. The diagram below illustrates how this works for the three Bites of data above. There is one Row with key of feed0. And there is one Column for each table row of data. Each Column uses a key that combines the score and id plus a string that indicates what field is stored in the Column Value, which in our case is only the data field.&lt;/p&gt;

&lt;img src=&quot;http://rollerweblogger.org/roller/mediaresource/255341b2-0705-47b1-9d3b-9725cb140566&quot;&gt;

&lt;h3&gt;Querying a Composite-keyed Table&lt;/h3&gt;

&lt;p&gt;With Cassandra 1.1, if you want to select a single Bite, you must know all of the composite-keys. Here&#146;s an example query that selects a single Bite:&lt;/p&gt;

&lt;pre&gt;

   select data from bite where partkey=&#146;feed0&#146; and score=101 and id=&#146;bite2&#146;

&lt;/pre&gt;

&lt;p&gt;To get latest Bites in a Site&#146;s Feed, you specify only the partition-key and ask for ordering by score, like so:&lt;/p&gt;

&lt;pre&gt;

   select data from bite where partkey=&#146;feed0&#146; order by score desc limit 20

&lt;/pre&gt;

&lt;p&gt;If you try to query without specifying the partition key and the score, you will get an error message. For example, this query:&lt;/p&gt;

&lt;pre&gt;

   select data from bite where id=&#146;bite2&#146; limit 20

&lt;/pre&gt;

&lt;p&gt;Would give you this error message:&lt;/p&gt;

   &lt;pre&gt;

   Bad Request: PRIMARY KEY part id cannot be restricted (preceding
   part score is either not restricted or by a non-EQ relation)

   &lt;/pre&gt;

&lt;p&gt;That means we can&#146;t look up Bites by a single ID. That&#146;s not very convenient but that&#146;s the way it is with Cassandra 1.1 which does not allow additional indexes on composite-key tables.. If you really want to lookup Bites by id, you have to create an entirely new simple-keyed table with Bite id as the primary key and use that table to look up the a Bite&#146;s partKey and score. This problem is fixed in Cassandra 1.2 because it allows secondary indexes on fields in composite-key table. Let&#146;s talk about that.&lt;/p&gt;

&lt;h3&gt;Secondary Indexes&lt;/h3&gt;

&lt;p&gt;Cassandra 1.2 comes with support for secondary indexes on composite-keyed tables, but you cannot create a secondary index on keys that are already part of the composite-key. So, if we want to be able to look-up Bites by ID, then we must add a second and redundant biteid field like so:&lt;/p&gt;

   &lt;pre&gt;

   alter table Bite add biteId varchar;
   create index Bite_biteId on Bite (biteId); 

   &lt;/pre&gt;

&lt;p&gt;Inside Cassandra, the the data would look like this, a new field in the table means a new Column in the row, as show below:&lt;/p&gt;

&lt;img src=&quot;http://rollerweblogger.org/roller/mediaresource/8215a60a-add0-4f38-9849-c4097bc25331&quot;&gt;

&lt;p&gt;And with that secondary index we can support queries like this:&lt;/p&gt;

   &lt;pre&gt;

   select data from bite where biteid=&#146;bite2&#146;

   &lt;/pre&gt;

&lt;h3&gt;Cassandra 1.2&lt;/h3&gt;

&lt;p&gt;In the DataStax Cassandra 1.2 docs, it says &#147;CQL3 transposes data partitions (sometimes called &amp;quot;wide rows&amp;quot;) into familiar row-based result sets, dramatically simplifying data modeling. &lt;/p&gt;

&lt;p&gt;I believe that means that all tables are stored the way that composite-keyed tables are stored. According to the docs, legacy tables from Cassandra 1.1 are supported in 1.2 and, if you want, you can still create Cassandra 1.1 style tables by using the &#147;compact storage&#148; attribute. For example, to create the Bite table with a the Cassandra 1.1 table model and a single primary key you&#146;d do this: &lt;/p&gt;

&lt;pre&gt;

   create table bite (
	id varchar PRIMARY KEY,
	feedid varchar,
	score bigint,
	data varchar
   ) with compact storage;

&lt;/pre&gt;

&lt;p&gt;And that&#146;s all I&#146;ve got on this topic.&lt;/p&gt;

&lt;h3&gt;Wrapping up...&lt;/h3&gt;

&lt;p&gt;I wrote this up to help myself understand how composite-keyed tables work in Cassandra, so I&#146;d love any feedback you might have and especially if you think I&#146;ve got concepts or terminology wrong. Thanks for reading.&lt;/p&gt;


&lt;p&gt;You can read more about Cassandra 1.1 tables on the Datastax site:&lt;br&gt;
&lt;a href=&quot;http://www.datastax.com/docs/1.1/ddl/column_family&quot;&gt;http://www.datastax.com/docs/1.1/ddl/column_family&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;More about Cassandra 1.2 tables:&lt;br&gt;
&lt;a href=&quot;http://www.datastax.com/docs/1.2/ddl/table&quot;&gt;http://www.datastax.com/docs/1.2/ddl/table&lt;/a&gt;&lt;p&gt;

&lt;p&gt;More about Cassandra 1.1 legacy tables in Cassandra 1.2&lt;br&gt;
&lt;a href=&quot;http://www.datastax.com/docs/1.2/ddl/legacy_table&quot;&gt;http://www.datastax.com/docs/1.2/ddl/legacy_table&lt;/a&gt;&lt;p&gt;

&lt;p&gt;Also, I found these posts by Brian O&#146;Neill very helpful:&lt;br&gt;
http://brianoneill.blogspot.com/2012/09/composite-keys-connecting-dots-between.html &lt;br&gt;
http://brianoneill.blogspot.com/2012/10/cql-astyanax-and-compoundcomposite-keys.html&lt;/p&gt;

&lt;br&gt;
&lt;p&gt;
   &lt;a href=&quot;http://wayin.com&quot;&gt;
      &lt;img src=&quot;http://rollerweblogger.org/roller/mediaresource/f624dfcd-2f04-406b-a2b2-f2bc1fa1afbe&quot;&gt;
   &lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;And, if you want to build an engaging site for your customers, fans or constituents based on live tweets, photos and videos check out &lt;a href=&quot;http://www.wayin.com/products/wayin-hub&quot;&gt;Wayin Hub&lt;/a&gt; and follow &lt;a href=&quot;https://twitter.com/wayinhub&quot;&gt;@wayinhub&lt;/a&gt; on Twitter.&lt;/p&gt;

&lt;br&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;</description>  </item>
  <item>
    <guid isPermaLink="true">https://rollerweblogger.org/roller/entry/scott_mcnealy_s_wayin_weighs</guid>
    <title>Scott McNealy&amp;#39;s Wayin weighs in on the election</title>
    <dc:creator>Dave Johnson</dc:creator>
    <link>https://rollerweblogger.org/roller/entry/scott_mcnealy_s_wayin_weighs</link>
    <pubDate>Thu, 26 Jan 2012 08:12:58 +0000</pubDate>
    <category>Social Software</category>
    <category>wayin</category>
<description>&lt;p&gt;Nice coverage of Wayin in CNN Money:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Scott McNealy&amp;#39;s Wayin weighs in on the election - Fortune Tech: Nearly 30 years after he co-founded Sun, and two years after the company sold to Oracle (ORCL), one of the tech industry&amp;#39;s most outspoken and colorful executives is back. Only instead of selling servers and software to businesses, he&amp;#39;s trying to get consumers, sports teams, and corporations -- and politicians -- to embrace a social media tool that&amp;#39;s a little hard to define: It is part polling app, part interactive media tool (think Twitter), and part enterprise service.&lt;/p&gt;

&lt;p&gt;The polling software at the heart of Wayin is super easy to use. It allows you to create basic questionnaires, on the web or using a mobile app, by selecting an image and asking a question. Pick a photo of the Fab Four, ask Who is your favorite Beatle?, and bingo, the answers from your followers will start trickling in immediately.&lt;/p&gt;&lt;/blockquote&gt;</description>  </item>
  <item>
    <guid isPermaLink="true">https://rollerweblogger.org/roller/entry/latest_links48</guid>
    <title>Latest Links - August 1, 2011</title>
    <dc:creator>Dave Johnson</dc:creator>
    <link>https://rollerweblogger.org/roller/entry/latest_links48</link>
    <pubDate>Sun, 31 Jul 2011 15:00:01 +0000</pubDate>
    <category>Links</category>
    <category>identity</category>
    <category>roller</category>
    <category>wayin</category>
<description>&lt;p&gt;Latest links, favorites and photos shared elsewhere:&lt;/p&gt;
    &lt;p style=&quot;margin-left:2em;text-indent:-1em;&quot;&gt;
            &lt;img src=&quot;http://rollerweblogger.org/roller/mediaresource/0f4c0070-b26e-4bf9-91bf-1ed071fbc9d5&quot;&gt;
            &lt;a href=&quot;http://twitter.com/snoopdave/statuses/98069278300975104&quot;&gt;snoopdave&lt;/a&gt; RT @mraible: Happy 9th Blogiversary to &lt;a href=&quot;http://raibledesigns.com&quot;&gt;http://raibledesigns.com&lt;/a&gt;: 3045 entries, 13,269 comments. Thanks for keeping all my memories Apach ... &lt;span&gt;12:35:12 PM 01 Aug 2011&lt;/span&gt;
            &lt;/p&gt;

            &lt;p style=&quot;margin-left:2em;text-indent:-1em;&quot;&gt;
            &lt;img src=&quot;http://rollerweblogger.org/roller/mediaresource/1b58fb4b-7ebe-4a5e-8b84-983cc356c325&quot;&gt;
            &lt;a href=&quot;http://twitter.com/mgile/statuses/98037589663154176&quot;&gt;mgile&lt;/a&gt; First day at the new, new office. Obligatory empty startup office pic:  &lt;a href=&quot;http://t.co/7oVDQjk&quot;&gt;http://t.co/7oVDQjk&lt;/a&gt; &lt;span&gt;10:29:17 AM 01 Aug 2011&lt;/span&gt;
            &lt;/p&gt;

            &lt;p style=&quot;margin-left:2em;text-indent:-1em;&quot;&gt;
            &lt;img src=&quot;http://rollerweblogger.org/roller/mediaresource/7473d1b1-7fde-4520-aad2-437e11a222a3&quot;&gt;
            &lt;a href=&quot;http://twitter.com/snoopdave/statuses/98025192042934272&quot;&gt;snoopdave&lt;/a&gt; Shared: Million Persona March on Google, Labor Day? &lt;a href=&quot;http://bit.ly/qmAR5y&quot;&gt;http://bit.ly/qmAR5y&lt;/a&gt; #fb &lt;span&gt;09:40:01 AM 01 Aug 2011&lt;/span&gt;
            &lt;/p&gt;

            </description>  </item>
</channel>
</rss>