Cassandra row ordering best practice I have a column family that store articles.
I'll need to get those articles from the most recent to the oldest, getting them from Country, and of course the ability to limit the number of fetched articles.

I though about another ColumnFamily "ArticlesByDateAndCountry" with dynamic columns

The Key would a mix from the 2 Char country Code (ISO 3166-1), and the articles day's date
so something like : US-20150118 or FR-20141230 -- (XX-YYYYMMDD)

In those Row, the column name would be the timeuuid of the article, and the value is the article's ID.

It would probably get a thousand of articles per day for each country.

Let's say I want to show only 100 of the newer articles, I'll get the today's articles, and if it does not fill the request (too few articles), I'll check the day before that, etc...

Is that the best practice, or does someone has a better idea for this purpose ?
I thought about another ColumnFamily "ArticlesByDateAndCountry" dynamic columns.


You're on the right track with this thought, but I'd stay away from dynamic columns.  Currently, there isn't a way to really manage column families with dynamic columns in CQL3.  So, the only real solution is to go the route of creating it in the cassandra-cli, which is being deprecated.  Sticking with CQL tables gives you a much easier path to data access, and that in itself (IMO) makes it worth it.  Besides, all the latest drivers work with CQL, so you're really backing yourself into a corner by choosing a path that can't be managed by it.

While it may not be readily apparent, there is a way to solve your current problem to adequately serve your queries.  I would build a (CQL) table, like this:

CREATE TABLE ArticlesByDateAndCountry (
 countrycode text,
 articledate timestamp,
 field1 text,
 field2 text,
 PRIMARY KEY ((countrycode),articledate))
WITH CLUSTERING ORDER BY (articledate DESC);


Note: I have created two sample payload fields, field1 and field2.  I'm sure your payload fields will vary.  Also, I have opted to use a timestamp instead of a timeuuid, as it makes the example easier. 

Essentially, this will group your data by countrycode.  And within each countrycode, your data will be sorted by articledate.

SELECT articledate, field1, field2
FROM ArticlesByDateAndCountry 
WHERE countrycode='US' 
AND articledate &gt;= '2015-01-23 00:00:00' AND articledate &lt; '2015-01-24 00:00:00';


You should read Patrick McFadin's article Getting started with Cassandra time series data modeling.  It has several examples that are quite similar to what you are doing here.  While I have demonstrated this with the timestamp type, you could very easily make this work with time UUIDs instead.  Here is a link to DataStax's documentation on Cassandra's timeuuid functions that I am sure you will find useful.