title: Cassandra lookup table for vanity urls and Base64 encoded UUIDs
body: <p><strong>The scenario</strong></p>
  
  <p>A large, high performance, scalable, distributed site about cats.</p>
  
  <p><strong>The details</strong></p>
  
  <ul>
  <li>Each cat has it's own page containing some details such as average sleep hours, favourite food and worst enemies.</li>
  <li>Pages can be accessed either via a vanity-url when set (ie. cats.com/terminator-cat) or a Base64Url representation of it's UUID (ie. cats.com/w4rTb789mmN0c...) </li>
  <li>There is an API aswell, which accepts only the Base64 form.</li>
  <li>The UUID is hidden from public for url friendliness purposes.</li>
  <li>The site uses Cassandra 2 as it's main db.</li>
  <li>Extra details to consider, there will also be other queries in the form of: find cats with X favourite food, Y enemies, ... this is however not what is being asked.</li>
  </ul>
  
  <p><strong>Questions</strong></p>
  
  <p>Knowing the data to be stored and how it will be queried, what would be the correct way to model it?</p>
  
  <p>I had in mind a cat table, where each entry key is the UUID. And two separate lookup tables, one for the Base64 encoded strings and the other for the custom names.</p>
  
  <p>The page controller would look if the url parameter is a Base64 String, if so first query the loookup table to get the UUID and then query the data table. If it's not, query the name lookup table and then the data. If not found in the lookup or data tables return 404.</p>
  
  <p>Is there any problem with this approach? What should I consider? What other ways would you  recommend?</p>
  
  <p>I must say I'm new to Cassandra, any tips will help.</p>