Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 67D8A200BDF for ; Sun, 18 Dec 2016 17:31:36 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6678F160B30; Sun, 18 Dec 2016 16:31:36 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8C6D9160AF6 for ; Sun, 18 Dec 2016 17:31:35 +0100 (CET) Received: (qmail 38991 invoked by uid 500); 18 Dec 2016 16:31:34 -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 38981 invoked by uid 99); 18 Dec 2016 16:31:34 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 18 Dec 2016 16:31:34 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id AA7981865E6 for ; Sun, 18 Dec 2016 16:31:33 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.879 X-Spam-Level: * X-Spam-Status: No, score=1.879 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id uI4hvj29j4Vw for ; Sun, 18 Dec 2016 16:31:29 +0000 (UTC) Received: from mail-ua0-f181.google.com (mail-ua0-f181.google.com [209.85.217.181]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D3E155F19B for ; Sun, 18 Dec 2016 16:31:28 +0000 (UTC) Received: by mail-ua0-f181.google.com with SMTP id 3so66851938uaz.3 for ; Sun, 18 Dec 2016 08:31:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=WO8V3KTquqTf+352YRxKparuw6KZ/3a+At2kQ6D/L5c=; b=jbyIYvo9vVaaA1fbmLkJ1M2MvFltALLwjVfTQ7kH3USW+jg5L/m+R9McvI1w03x7eX rxEI6ioXFrrJQX5BQupCZSI+dl1T4Hld+Snwtkt5T6JPYjzbjbIXyl6p9mq/t9O8pYwW PKGlPo2ZdxVb9cfi5V/cDqQGSVX8/cpTILlGQWka9luVlo6T8jHXU1TrE/XFPzqHjJJ5 Y1FSIQ7Fq5Ml7U01p9ysgs31XidNtEHEEe60+tQMBHMmEypnveWXNLRP4kJkqSFNzk9S gzrqaMFPifcL+/o7W5GKO6es0hU7kNjPw2IvynMoRSASBgieYllO2i+RKbYqUUsdPWbL STcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=WO8V3KTquqTf+352YRxKparuw6KZ/3a+At2kQ6D/L5c=; b=MWGEPRymZBOgGH7PWnANxt1Kpi03+i0bPaitNL8ilN/PakJZTY0LRVyYJ/Z4Fy7idD E+XRtGgyg2ZXlQ9r4bpDXgAuJFTrUCQ+8+qXVk9E4T63P7ZExiWe/Qsyc4rN8u2hYEsE ndi4eazDhXLLqSkSJrjtNgRZVxu4rNbG3b0pV7Xx58Wg+7rxs6/Q2bds35k33O+rssov 4Mscip6zFn3yOCgV5KcS1q0q+GVQ5f91AqOugfNM/8skUxJ0XJcpAhdSPlFjc2Hf8Azx 8WhvSpxbZmgzGYssa0q82p03ePp6DCyN1kb8LdOe1FI4kgLrKumvIa0dA/W1Q3oGn/SV vCxA== X-Gm-Message-State: AIkVDXJavAl61f71VDVSUVCAzts4iBZSalAamAmWSvq25SxhMf0C5EnobiEsju2+DFpmGtEfZjm6cIRJqqDIEw== X-Received: by 10.159.33.97 with SMTP id 88mr10192456uab.156.1482078681687; Sun, 18 Dec 2016 08:31:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.121.82 with HTTP; Sun, 18 Dec 2016 08:31:01 -0800 (PST) In-Reply-To: References: From: Alain RODRIGUEZ Date: Sun, 18 Dec 2016 17:31:01 +0100 Message-ID: Subject: Re: Schema help required To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=94eb2c0b321a59eb580543f155bc archived-at: Sun, 18 Dec 2016 16:31:36 -0000 --94eb2c0b321a59eb580543f155bc Content-Type: text/plain; charset=UTF-8 Hi Sagar, > But this is a known anti pattern to not use Cassandra as a queue causing > tombstones etc. > But I could not think of any other way. Does anyone have any other > suggestion so as to not delete after a pair is created I believe you could try using a fixed TTL (defined at the table level for example), then use a TWCS compaction strategy and compactions options that would efficiently manage tombstones. A colleague at The Last Pickle just wrote an article about TWCS: http://thelastpickle.com/blog/2016/12/08/TWCS-part1.html, and there is a lot more information around, including a talk this year at the summit from Jeff who contributed with TWCS to Apache Cassandra: https://www.youtube.com/watch?v=PWtekUWCIaw. Also using a time buckets in the partition key could help making sure tombstones will be correctly removed and are not being scanned when requesting new data. Yet do not use *only* a time bucket in the partition key as it would lead to hotspots. For a given date, only one node (+ replicas) would handle the write / read load. So using "day + something else" as a partition key and "TWCS + Fixed TTLs" *could* be a good way to move forward. I would give it a try with the cassandra-stress tool that is shipped alongside Apache Cassandra and allows the use of a user defined schema. C*heers, Alain 2016-12-17 21:02 GMT+01:00 Sagar Jambhulkar : > Hi, > Needed a suggestion for a schema query. I want to build a reconciliation > using Cassandra. Basically two or more systems send message to a > reconciliation process. The reconciliation process first does a level one > match of id's and than does complete comparison of messages. > > The best I could think of is a like a queue table with id's. My consumer > thread/s would, poll this table, create a pair and would have to delete > from this table. But this is a known anti pattern to not use Cassandra as a > queue causing tombstones etc. > But I could not think of any other way. Does anyone have any other > suggestion so as to not delete after a pair is created. Is Cassandra not > the correct technology for a recon process? > > Thanks, > Sagar > --94eb2c0b321a59eb580543f155bc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Sagar,
=C2=A0
But this is a known anti pattern to not use Ca= ssandra as a queue causing tombstones etc.
But I could not think of any = other way. Does anyone have any other suggestion so as to not delete after = a pair is created

I believe you could try u= sing a fixed TTL (defined at the table level for example), then use a TWCS = compaction strategy and compactions options that would efficiently manage t= ombstones. A colleague at The Last Pickle just wrote an article about TWCS:= =C2=A0= http://thelastpickle.com/blog/2016/12/08/TWCS-part1.html, and there is = a lot more information around, including a talk this year at the summit fro= m Jeff who contributed with TWCS to Apache Cassandra:=C2=A0https://www.youtube.com/watch?v= =3DPWtekUWCIaw.

Also using a time buckets in t= he partition key could help making sure tombstones will be correctly remove= d and are not being scanned when requesting new data. Yet do not use onl= y=C2=A0a time bucket in the partition key as it would lead to=C2=A0hots= pots. For a given date, only one node (+ replicas) would handle the write /= read load.

So using "day + something else&qu= ot; as a partition key and "TWCS + Fixed TTLs" could be a = good way to move forward.

I would give it a try wi= th the cassandra-stress tool that is shipped alongside Apache Cassandra and= allows the use of a user defined schema.

C*heers,=

Alain

<= div class=3D"gmail_quote">2016-12-17 21:02 GMT+01:00 Sagar Jambhulkar <sagar.jambhulkar@gmail.com>:
Hi,
Needed a suggestion for a schema query. I want t= o build a reconciliation using Cassandra. Basically two or more systems sen= d message to a reconciliation process. The reconciliation process first doe= s a level one match of id's and than does complete comparison of messag= es.

The best I could think of is a like a queue table with id's.= My consumer thread/s would, poll this table, create a pair and would have = to delete from this table. But this is a known anti pattern to not use Cass= andra as a queue causing tombstones etc.
But I could not think of any othe= r way. Does anyone have any other suggestion so as to not delete after a pa= ir is created. Is Cassandra not the correct technology for a recon process?=

Thanks,
Sagar

--94eb2c0b321a59eb580543f155bc--