Return-Path: X-Original-To: apmail-zookeeper-user-archive@www.apache.org Delivered-To: apmail-zookeeper-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 71DC6105B2 for ; Wed, 31 Jul 2013 22:48:31 +0000 (UTC) Received: (qmail 5786 invoked by uid 500); 31 Jul 2013 22:48:30 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 5755 invoked by uid 500); 31 Jul 2013 22:48:30 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 5747 invoked by uid 99); 31 Jul 2013 22:48:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 22:48:30 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of baskar.duraikannu@outlook.com designates 65.54.190.155 as permitted sender) Received: from [65.54.190.155] (HELO bay0-omc3-s17.bay0.hotmail.com) (65.54.190.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 22:48:26 +0000 Received: from BAY169-W99 ([65.54.190.187]) by bay0-omc3-s17.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 31 Jul 2013 15:48:05 -0700 X-TMN: [kSDEmRkXbxEDfgNoWvRXc8p4Kq6vpfNu] X-Originating-Email: [baskar.duraikannu@outlook.com] Message-ID: Content-Type: multipart/alternative; boundary="_924ce822-5614-4665-a501-12d1961f2e8b_" From: Baskar Duraikannu To: "user@zookeeper.apache.org" Subject: RE: Zookeeper performance Date: Wed, 31 Jul 2013 18:48:05 -0400 Importance: Normal In-Reply-To: References: , MIME-Version: 1.0 X-OriginalArrivalTime: 31 Jul 2013 22:48:05.0526 (UTC) FILETIME=[051E8360:01CE8E40] X-Virus-Checked: Checked by ClamAV on apache.org --_924ce822-5614-4665-a501-12d1961f2e8b_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable We are using optimistic concurrency similar to one explained in http://en.w= ikipedia.org/wiki/Optimistic_concurrency_control I went through the "version" concept in zookeeper. I do not understand how = that could be used for "concurrency control". Are you suggesting that all w= rites go to zookeeper first before making it to the database.=20 We are trying to do it differently... For example=2C let us say we are tryi= ng to update rowKey 1 of Person table=2C 1. Create a ephemeral node /locks/Person/rowkey12. Zookeeper may create a n= ode called /locks/Person/rowKey1-0000 (This means that we got lock)3. If we= got=2C /locks/Person/rowKey1-0001 =2C we decrement and keep checking child= nodes of /locks/Person until /locks/Person/rowKey1-0001 becomes the first= one in the list.=20 Pls help/=20 > From: phunt@apache.org > Date: Wed=2C 31 Jul 2013 08:47:01 -0700 > Subject: Re: Zookeeper performance > To: user@zookeeper.apache.org >=20 > On Wed=2C Jul 31=2C 2013 at 4:16 AM=2C Baskar Duraikannu > wrote: > > > > We are looking to use zookeeper for optimistic concurrency. Basically w= hen the user saves data on a screen=2C we need to lock=2C read to ensure t= hat no one else has changed the row while user is editing data=2C persist d= ata and unlock znode. > > >=20 > Why not use the built in optimistic locking that ZK provides? See the > "version" parameter here: > http://zookeeper.apache.org/doc/r3.4.5/api/org/apache/zookeeper/ZooKeeper= .html#getData(java.lang.String=2C > boolean=2C org.apache.zookeeper.AsyncCallback.DataCallback=2C > java.lang.Object) > http://zookeeper.apache.org/doc/r3.4.5/api/org/apache/zookeeper/ZooKeeper= .html#setData(java.lang.String=2C > byte[]=2C int=2C org.apache.zookeeper.AsyncCallback.StatCallback=2C > java.lang.Object) >=20 > > If the app/thread does not get a lock=2C we may set a watch so that pol= ling is avoided. > > > > Our application is write intensive certain times of the day. We may get= about 100k requests per second. Can zookeeper handle this volume? >=20 > Unlikely you'll see this level of performance: > http://zookeeper.apache.org/doc/r3.4.5/zookeeperOver.html#Performance >=20 > Patrick = --_924ce822-5614-4665-a501-12d1961f2e8b_--