Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6B6509257 for ; Sun, 26 Feb 2012 22:33:48 +0000 (UTC) Received: (qmail 68741 invoked by uid 500); 26 Feb 2012 22:33:46 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 68712 invoked by uid 500); 26 Feb 2012 22:33:46 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 68702 invoked by uid 99); 26 Feb 2012 22:33:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Feb 2012 22:33:46 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=HTML_FONT_FACE_BAD,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of michael.cherkasov@gmail.com designates 209.85.160.44 as permitted sender) Received: from [209.85.160.44] (HELO mail-pw0-f44.google.com) (209.85.160.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 26 Feb 2012 22:33:37 +0000 Received: by pbcwz17 with SMTP id wz17so64954pbc.31 for ; Sun, 26 Feb 2012 14:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of michael.cherkasov@gmail.com designates 10.68.225.33 as permitted sender) client-ip=10.68.225.33; Authentication-Results: mr.google.com; spf=pass (google.com: domain of michael.cherkasov@gmail.com designates 10.68.225.33 as permitted sender) smtp.mail=michael.cherkasov@gmail.com; dkim=pass header.i=michael.cherkasov@gmail.com Received: from mr.google.com ([10.68.225.33]) by 10.68.225.33 with SMTP id rh1mr13909392pbc.158.1330295596229 (num_hops = 1); Sun, 26 Feb 2012 14:33:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=POs+nvRj/XDXg5HWujEN9hnIwN6DxMbkdjNT66jqyK8=; b=wZPgSyuNo140aRREl7pVfjhNi3Bvlg7O2Wvaf9QTu/1sXPhG1HhqHG37/t3j9CjnVX +QNzrKWjVvaeOMoeXTX7ttfVvfAPG74yg03uFknk0BzDd7SC6eLD+OsdqsJI94PmgCMC 8B7kdHGxEm5PPz3hEfJnOgXwfkU2caqK4VTR4= Received: by 10.68.225.33 with SMTP id rh1mr12185720pbc.158.1330295596176; Sun, 26 Feb 2012 14:33:16 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.146.8 with HTTP; Sun, 26 Feb 2012 14:32:56 -0800 (PST) From: Michael Cherkasov Date: Mon, 27 Feb 2012 02:32:56 +0400 Message-ID: Subject: how to cast traditional sql schema to nosql To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b2ee00574d35704b9e59427 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b2ee00574d35704b9e59427 Content-Type: text/plain; charset=ISO-8859-1 Hi all, I'm newbie in nosql and can't understand how to create nosql style schema. First, I what describe my problem: I need to store results of tests. Each test consists of a list of parameters(if tests have the same list of parameters that means, two tests belong to the same testcase), tag or tags, and test result, For exmaple: Test1 : params: -user_role:admin -miss_captcha:true -test_name:login_test -locales:en,es,fr -- as you can see, parameter can be the list. testcase: testcase_1_id -- test case id formed as md5 of params. tags: -aaa_site_test -smoke result: -passed -some_other_results_stuff( logs, errors' codes and so on ) start_time: 1330287048 ( time stamp) Test2 : params: -user_role:admin -miss_captcha:true -test_name:login_test -locales:en,es,fr -- as you can see, parameter can be the list. testcase: testcase_1_id -- test case id formed as md5 of params. tags: -aaa_site_test -function_tests result: -failed -some_other_results_stuff( logs, errors' codes and so on ) start_time: 1330290648 Test3 : params: -user_role:user -miss_captcha:true -test_name:change_password -locales:en testcase: testcase_2_id -- test case id formed as md5 of params. tags: -bbb_site_test -function_tests result: -failed -some_other_results_stuff( logs, errors' codes and so on ) start_time: 1330290648 So, above you can see 3 tests, the first two belong to the same testcase, but test 1 and test 2 are different test runs, also they have different tags. Test 3 one more test case. Usually I will need to execute the following queries: 1)Get latest result for specific tag/tags, for exmale: Get latest result for aaa_site. Result should be: Test2 result, because test 1 and test 2 is the same test case, but test 2 is newer. 2)Or get latest result for locale == es, result is test 2. 3)Get the latest results for each test case, result is: test 2, test 3. 4)Get get history for test case 1, result: test 1 and test 2. I create the following schema: TestRuns: *test run id(key) | test case id | start_time | result id* test_1_id | testcase_1_id | 1330287048 | result_1 test_2_id | testcase_1_id | 1330290648 | result_2 test_3_id | testcase_2_id | 1330290648 | result_3 Result: *result id | result_value | other stuff...* result_1 | passed | ... result_2 | failed | ... result_3 | failed | ... ParamsAndTags:( for tags I put $tag for tagParamName, $ - for case if we have parameter with name 'tag' ) *key (not used, but required by cassandra)| test run id | tagParamName | value* some key |test_1_id | $tag | aaa_site_test some key |test_1_id | $tag | smoke some key |test_1_id | user_role | admin some key |test_1_id | miss_captcha | true some key |test_1_id | test_name | login_test some key |test_1_id | locales | en --- list is splited some key |test_1_id | locales | es --- list is splited some key |test_1_id | locales | fr --- list is splited and so on... But it's look very heavy to perform queries. To take latest result for tag aaa_site_test and with locale es I need perform the following steps: Fetch all rows from ParamsAndTags with tag aaa_site_test, then fetch all rows for param locale == es. Then find intersection of first and second result so I receive test runs id, but this is not the end. After that I should fetch test runs and in result find the latest results only. As you can see for that simple query I should perform 3 query to DB and a lot of work inside my application to merge results and filter latests results. I'am afraid it will work too slowly. Can someone advise more nosql solution for this task? --047d7b2ee00574d35704b9e59427 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,
I'm=A0newbie in nosql and can&#= 39;t=A0understand=A0how to create nosql style=A0schema.
First, I what describe my pro= blem:
=A0I need to store res= ults of tests. Each test=A0consists of a list of parameters(if tests have t= he same list of parameters that means, two tests belong to the same testcas= e), tag or tags, and test result,
For exmaple:
Test1 :
=A0params:=A0<= /div>
=A0 =A0-user_role:admin
=A0 =A0-miss_= captcha:true
=A0 =A0-test_name:login_test
=A0 =A0-locales:en,es,= fr =A0 =A0 =A0 -- as you can see, parameter can be the list.
testcase: testcase_1_id = -- test case id formed as md5 of params.=A0
tags:
=A0 =A0-aaa_site_test
=A0 =A0-smoke<= /font>
=A0result:
=A0 =A0-passed=
=A0 =A0-some_oth= er_results_stuff( logs, errors' codes and so on )
=A0start_time:=A013302= 87048 =A0( time stamp)
Test2 :
=A0params:=A0
=A0 =A0-user_role:admi= n
=A0 =A0-= miss_captcha:true
=A0 =A0-test_name:login_test
=A0 =A0-locales:en,es,= fr =A0 =A0 =A0 -- as you can see, parameter can be the list.
=A0testcase: testcase_1_= id -- test case id formed as md5 of params.
=A0tags:
<= div>=A0 =A0-aaa_site_test
=A0 =A0-fun= ction_tests
=A0result:
=A0 =A0-failed=
=A0 =A0-some_oth= er_results_stuff( logs, errors' codes and so on )
=A0start_time:= =A01330290648
Test3 :
=A0params:=A0
=A0 =A0-user_role:user=
=A0 =A0-m= iss_captcha:true
=A0 =A0-test_name:change_password
=A0 =A0-locales:en
=A0testcase: = testcase_2_id -- test case id formed as md5 of params.
=A0tags:<= /font>
=A0 =A0-bb= b_site_test
=A0result:
=A0 =A0-failed=
=A0 =A0-some_oth= er_results_stuff( logs, errors' codes and so on )
=A0start_time:= =A01330290648

So, above you can see 3 tests, the first two belong to the same testca= se, but test 1 and test 2 are different test runs, also they have different= tags. Test 3 one more test case.
Usually I will need to= execute the following queries:
1)Get latest result for specific tag/tags, for exmale= :=A0
Get latest result for = aaa_site. Result should be:
Test2 result, because test 1 and test 2 is the same test = case, but test 2 is newer.
2)Or get l= atest result for locale =3D=3D es, result is test 2.
3)Get the latest res= ults for each test case, result is: test 2, test 3.
4)Get get history for = test case 1, result: test 1 and test 2.

I create the following schema:
TestRuns:
=
test run id(key) | = test case id =A0| start_time | result id
test_1_id =A0 =A0 =A0 =A0| testcase_1_id= |=A0133= 0287048 | result_1
test_2_id =A0 =A0 =A0 = =A0| testcase_1_id |=A01330290648=A0| result_2
test_3_id =A0 =A0 =A0 = =A0| testcase_2_id |=A01330290648=A0=A0| result_3

= Result: =A0
result id | result_val= ue | other stuff...
result_1 =A0| =A0passe= d =A0 =A0 =A0| ...
result_2 =A0| =A0failed =A0 =A0 =A0| ...
resu= lt_3 =A0| =A0failed =A0 =A0 =A0| ...

=
ParamsAndTags:( for tags I put $tag for tagParamName, $ - for case if we= have parameter with name 'tag' =A0)
key (no= t used, but required by cassandra)| test run id | tagParamName | value<= /span>
test_1_= id =A0 =A0| $tag =A0 =A0 =A0 =A0 |=A0aaa_site_test
some key = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |test_1_id =A0 =A0|= $tag =A0 =A0 =A0 =A0 |=A0smoke
some key = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |test_1_id =A0 =A0|= user_ro= le =A0 =A0ad= min
some key = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |test_1_id =A0 =A0|= =A0miss_= captcha=A0tr= ue
some key = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |test_1_id =A0 =A0|= =A0test_= name=A0 =A0 =A0 =A0=A0|=A0login_test
some key = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |test_1_id =A0 =A0|= =A0 locales= =A0 =A0 =A0 =A0 =A0=A0|= en=A0 = =A0 =A0 =A0 =A0 =A0--- list is splited=A0
some key = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |test_1_id =A0 =A0|= =A0=A0lo= cales=A0 =A0 =A0 =A0 =A0=A0| es=A0 =A0 =A0 =A0 =A0 =A0--- list is splited=A0
some= key =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |test_1_id =A0= =A0|=A0=A0locales=A0 =A0 =A0 =A0 =A0=A0| fr=A0 =A0 =A0 =A0 =A0 =A0--- list is splited=A0
and so on...


<= div> But it's look very heav= y to perform queries.
To take latest result for tag aaa_site_test and with locale es = I need perform the following steps:
Fetch=A0all rows from = ParamsAndTags with tag aaa_site_test, then fetch all rows for param locale = =3D=3D es.
Then find intersection of first and second result so I receive test runs i= d, but this is not the end.
After that I should fe= tch test runs and in result find the=A0latest=A0results only.
<= div>As you can see for that= simple query I should perform 3 query to DB and a lot of work inside my ap= plication to merge results and filter latests results.
I'am afraid it wil= l work too slowly.
Can someone advise more nosql solution for this task?
--047d7b2ee00574d35704b9e59427--