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 E61F710021 for ; Wed, 9 Oct 2013 17:49:30 +0000 (UTC) Received: (qmail 50159 invoked by uid 500); 9 Oct 2013 17:49:28 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 50025 invoked by uid 500); 9 Oct 2013 17:49:27 -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 50017 invoked by uid 99); 9 Oct 2013 17:49:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2013 17:49:26 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [207.46.163.242] (HELO na01-by2-obe.outbound.protection.outlook.com) (207.46.163.242) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2013 17:49:21 +0000 Received: from CO1PR07CA011.namprd07.prod.outlook.com (10.141.49.41) by BY2PR07MB012.namprd07.prod.outlook.com (10.255.241.38) with Microsoft SMTP Server (TLS) id 15.0.785.10; Wed, 9 Oct 2013 17:48:58 +0000 Received: from BL2FFO11FD032.protection.gbl (2a01:111:f400:7c09::136) by CO1PR07CA011.outlook.office365.com (2a01:111:e400:102f::41) with Microsoft SMTP Server (TLS) id 15.0.785.10 via Frontend Transport; Wed, 9 Oct 2013 17:48:58 +0000 Received: from XEDGEA.nrel.gov (192.174.58.134) by BL2FFO11FD032.mail.protection.outlook.com (10.173.160.73) with Microsoft SMTP Server (TLS) id 15.0.795.6 via Frontend Transport; Wed, 9 Oct 2013 17:48:58 +0000 Received: from XHUBB.nrel.gov (10.20.4.59) by XEDGEA.nrel.gov (192.174.58.134) with Microsoft SMTP Server (TLS) id 8.3.298.1; Wed, 9 Oct 2013 11:48:43 -0600 Received: from MAILBOX2.nrel.gov ([fe80::48b0:b121:8465:5e5]) by XHUBB.nrel.gov ([::1]) with mapi; Wed, 9 Oct 2013 11:48:57 -0600 From: "Hiller, Dean" To: "user@cassandra.apache.org" , "cbertu81@libero.it" Date: Wed, 9 Oct 2013 11:48:51 -0600 Subject: Re: Online shop with Cassandra Thread-Topic: Online shop with Cassandra Thread-Index: Ac7FF9MnOXfNcg5fS2a1wYP4nanE1A== Message-ID: In-Reply-To: <1435867409.3411971381334399415.JavaMail.defaultUser@defaultHost> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.7.130812 acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Forefront-Antispam-Report: CIP:192.174.58.134;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(199002)(189002)(54094003)(51704005)(377454003)(479174003)(24454002)(53754006)(74502001)(74662001)(36756003)(56776001)(77096001)(56816003)(74366001)(69226001)(81686001)(76482001)(47446002)(85306002)(54316002)(79102001)(50466002)(76786001)(76796001)(51856001)(20776003)(47776003)(76176001)(81816001)(83506001)(16796002)(31966008)(59766001)(77982001)(46102001)(74706001)(63696002)(54356001)(53806001)(81342001)(74876001)(81542001)(65816001)(6806004)(53416003)(83072001)(50986001)(49866001)(47736001)(4396001)(47976001)(80022001)(19580405001)(80976001)(19580395003)(23746002)(83322001)(44976005);DIR:OUT;SFP:;SCL:1;SRVR:BY2PR07MB012;H:XEDGEA.nrel.gov;CLIP:192.174.58.134;FPR:;RD:xedgea.nrel.gov;A:1;MX:1;LANG:en; X-Forefront-PRVS: 0994F5E0C5 X-OriginatorOrg: nrel.gov X-Virus-Checked: Checked by ClamAV on apache.org Read the paper "Building on Quicksand" especially the section where he describes what they do at Amazon=8Athe apology model=8Aie. Allow overbookin= g and apologize but limit overbooking=8A.That is one way to go and stay scalable. You may want to analyze the percentage change that overbooking can be as well=8A..the paper may give you other ideas. Another idea is atomic row update and leveraging that which I think is in 2.0 such that the first person wins. Later, Dean On 10/9/13 9:59 AM, "cbertu81@libero.it" wrote: >Hi all, >for an online shop owned by my company I would like to remove MySQL for >everything concerning the frontend and use Cassandra instead. >The site has more than a million visit each day but what we need to know >is > >Products (deals) are divided for cities >Each product can stay online for X time and sell a max number of Y items > > CREATE TABLE deals ( > city string, > deal_id timeuuid, > availability int, > deal_info string, > PRIMARY KEY ((city, deal_id)) > ); > >The only problem I see in this model is how to guarantee the >"availability" of=20 >a deal and don't "overbook" -- How to solve the problem of "remaining >items" in=20 >real time?=20 > >I have many idea how to solve it on the web-application but I wonder if >there=20 >is nothing ready on Cassandra that might help. > >Kindest regards, >Carlo >