Note that there are some explanatory texts on larger screens.

plurals
  1. POMigrating from Mysql to Cassandra
    primarykey
    data
    text
    <p>Previously I was using the class found <a href="http://kevin.vanzonneveld.net/techblog/article/create_short_ids_with_php_like_youtube_or_tinyurl/" rel="nofollow">here</a> to convert userID to some random string.</p> <p>From his blog:</p> <p>Running:</p> <pre><code>alphaID(9007199254740989); </code></pre> <p>will return 'PpQXn7COf' and:</p> <pre><code>alphaID('PpQXn7COf', true); </code></pre> <p>will return '9007199254740989'</p> <p>So the idea was that users could do www.mysite.com/user/PpQXn7COf and i convert that to a normal integer so i could do in mysql </p> <pre><code>"Select * from Users where userID=".alphaID('PpQXn7COf', true) </code></pre> <p>Now i'm just started working with Cassandra an i'm looking for some replacement.</p> <ol> <li>I want url like www.mysite.com/user/PpQXn7COf not like www.mysite.com/user/username1</li> <li>The "PpQXn7COf" uuid must be as short as possible.</li> </ol> <p>In the Twissandra example explained here: <a href="http://www.rackspace.com/cloud/blog/2010/05/12/cassandra-by-example/" rel="nofollow">http://www.rackspace.com/cloud/blog/2010/05/12/cassandra-by-example/</a></p> <p>They create some long uuid (i guess it is so long because then its almost 100 percent sure its random).</p> <p>In mysql i just had a userID column with auto increasement so when i used the alphaID() function i always got a very short random string.</p> <p>Anyone an idea how to solve this as clean as possible?</p> <hr> <p><strong>Edit:</strong></p> <p>It is used for a social media site so it must be persistent. Thats also why i don't want to use usernames/realnames in urls, user cant remain google undetected if they need.</p> <p>I just got a simple idea, however i don't know how scalable it is</p> <pre><code>&lt;?php //createUUID() makes +- 14 char string with A-Z a-z 1-0 based on micro/milli/nanoseconds while(get_count(createUUID()) &gt; 0){//uuid is unique //insert username pass, uuid etc into cassandra if($result == "1"){ header('Location: http://www.mysite.com/usercenter'); }else{ echo "error"; } } ?&gt; </code></pre> <p>When this gets the size of lets say twitter/facebook:</p> <ol> <li>Will it execute in acceptable time?</li> <li>Will it still generate unique uuid fast enough so if 10000 users/second are registering it isnt cluttering up?</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload