Return-Path: X-Original-To: apmail-hbase-dev-archive@www.apache.org Delivered-To: apmail-hbase-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CF5369B54 for ; Mon, 17 Oct 2011 18:01:01 +0000 (UTC) Received: (qmail 23669 invoked by uid 500); 17 Oct 2011 18:01:01 -0000 Delivered-To: apmail-hbase-dev-archive@hbase.apache.org Received: (qmail 23606 invoked by uid 500); 17 Oct 2011 18:01:01 -0000 Mailing-List: contact dev-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list dev@hbase.apache.org Received: (qmail 23598 invoked by uid 99); 17 Oct 2011 18:01:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2011 18:01:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yuzhihong@gmail.com designates 74.125.82.169 as permitted sender) Received: from [74.125.82.169] (HELO mail-wy0-f169.google.com) (74.125.82.169) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2011 18:00:53 +0000 Received: by wyg34 with SMTP id 34so2907864wyg.14 for ; Mon, 17 Oct 2011 11:00:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=wIk4KcK3W09T0XnDUW63DNd9fFFEtxLXtIN5bSWJL2M=; b=Tx0y6GQZ5UhqZYUcGRMLpHUlLtrPnpWiiongc3GEzqRWHkDVewx46YegPMtFRGb0pi 9WzEIIut+O4TIQ4VlLdOOkKhw+g9QkLPuiIswikV0HgjQPW7wJdCPftWetQtXQAZ3uez QOi0ZlxnxOK0IYtX+S99zn8YGBU9OtQ4puj/c= MIME-Version: 1.0 Received: by 10.216.170.204 with SMTP id p54mr4195641wel.51.1318874432635; Mon, 17 Oct 2011 11:00:32 -0700 (PDT) Received: by 10.216.17.208 with HTTP; Mon, 17 Oct 2011 11:00:32 -0700 (PDT) In-Reply-To: References: Date: Mon, 17 Oct 2011 11:00:32 -0700 Message-ID: Subject: Re: adding constraints From: Ted Yu To: dev@hbase.apache.org Content-Type: multipart/alternative; boundary=0016363ba0d40f81aa04af826264 X-Virus-Checked: Checked by ClamAV on apache.org --0016363ba0d40f81aa04af826264 Content-Type: text/plain; charset=ISO-8859-1 Jesse: This is a nice initiative. Looks like the Constraint you define below is per table. Meaning it is not cross-table referential integrity. Cheers On Mon, Oct 17, 2011 at 10:45 AM, Jesse Yates wrote: > Hey everyone, > > TL;DR Adding classic DB constraints as a system level coprocessor to help > simplify using HBase and ease adopting. > > Coprocessors are a really powerful mechanism and are incredibly useful for > a > variety of things. However, I feel like the mechanism for using them can be > very daunting and, for certain features, could do with some simplification. > > What I would like to propose is a simple interface that people can use to > implement a 'constraint' (matching the classic database definition). This > would help ease of adoption by helping HBase more easily check that box, > help minimize code duplication across organizations, and lead to easier > adoption. > > Essentially, people would implement a 'Constraint' interface for checking > keys before they are put into a table. Puts that are valid get written to > the table, but if not people can will throw an exception that gets > propagated back to the client explaining why the put was invalid. > > Constraints would be set on a per-table basis and the user would be > expected > to ensure the jars containing the constraint are present on the machines > serving that table. > > Yes, people could roll their own mechanism for doing this via coprocessors > each time, but this would make it easier to do so, so you only have to > implement a very minimal interface and not worry about the specifics. > > If people are interested, I would like to open a Jira on the feature. I've > got a basic implementation, but would like to expand it to be a more > integrated, top-level element of the code. I just don't want to waste my > time doing a full blown impl and then not have at least general concensus > on > it being a good feature. > > One of the complaints I commonly hear about HBase is that, to outsiders, it > is difficult to figure out and use (though once you do, its solid). This > would be a step to make it easier to use and adopt. > > Thanks, > Jesse Yates > --0016363ba0d40f81aa04af826264--