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 EE008200C31 for ; Wed, 8 Mar 2017 19:13:22 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EC9F6160B83; Wed, 8 Mar 2017 18:13:22 +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 19F18160B73 for ; Wed, 8 Mar 2017 19:13:21 +0100 (CET) Received: (qmail 51554 invoked by uid 500); 8 Mar 2017 18:13:21 -0000 Mailing-List: contact dev-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list dev@asterixdb.apache.org Received: (qmail 51536 invoked by uid 99); 8 Mar 2017 18:13:21 -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; Wed, 08 Mar 2017 18:13:21 +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 923FE1806A5 for ; Wed, 8 Mar 2017 18:13:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.379 X-Spam-Level: ** X-Spam-Status: No, score=2.379 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, RCVD_IN_SORBS_SPAM=0.5, 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 vbTwxlm9A9Ue for ; Wed, 8 Mar 2017 18:13:18 +0000 (UTC) Received: from mail-ot0-f176.google.com (mail-ot0-f176.google.com [74.125.82.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 89C3D5F297 for ; Wed, 8 Mar 2017 18:13:17 +0000 (UTC) Received: by mail-ot0-f176.google.com with SMTP id o24so37958333otb.1 for ; Wed, 08 Mar 2017 10:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=76vYiu+pDaas5yJqGyc8vM1ZUuGbZUtLk7P6rb71seM=; b=vA0ny5El98lvVrM/FvKfJOc34ECecW0ZlKp1TMleWPX2izu8PddUv1L3Qxa9dt+/hC 2MdzCzzpdvrJP1NxOTqAim3ew6KXIzTrGhPkR/X/PuCC+DHSclCbThWI8GzTjv4x/tij bfVAFIiv8/x4QFKLIR27xFzsZvDViuhsb/PUbdSHIFIAS5YlOurtjcByugwKzAPO1Jpm rDLkaNblVRVtwPnq+VtysbzeSSrr3bIwEFd3FB6OshGlvRPgTFElcg+UGvOAnAYmZqK1 uNe25gCuMdh1KizLl4JasJx/4WisE0Q8Q8ULsxk0o2yC8wIbGgI1D+QT6tJT+ABIYiNE Aahw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=76vYiu+pDaas5yJqGyc8vM1ZUuGbZUtLk7P6rb71seM=; b=LKHPbVReDGTJY//6lRFTefSu/09ARFvVTPERH/5EI0gSRyrH56BR0Hbf2D0OPcrWbM 5HkdzG827V4GdPZsurIh2DfkK5M4/wjiGPBYdsB5fAWaoZcd90whAT30YlKnawpY83ej UWo7LF3FRZU11iq9FeKGYv27Cg5iKPkA3uJdl8Ey9k4e9xwuI6/5aPHT58s+ith9XeMJ JDtud7KpycfFYL5SZuQbIoYeS7y8KLxwpQ758pkHIpaeKwHssrR2/mfYQRpILtSs1oug JYMULIBvVkkqxX/OhR8Yop+kszUO689K5ohoEcE0W+M0g0RcCs6jRt0oZNrWNL+Ek+Ev At0w== X-Gm-Message-State: AFeK/H25I6yJffm9x2Z9nOKB0hUkDzK6XntzK1sc+5cLyeycloXXUucGwxPniARGynzP2A== X-Received: by 10.157.4.141 with SMTP id 13mr4769511otm.142.1488996795997; Wed, 08 Mar 2017 10:13:15 -0800 (PST) Received: from mikejcarey.local ([2600:8802:4500:fc:5ad:9596:68e4:768f]) by smtp.googlemail.com with ESMTPSA id j61sm1792484otc.22.2017.03.08.10.13.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Mar 2017 10:13:15 -0800 (PST) Subject: Re: JDBC Driver for AsterixDB and how other NoSQL dbs did it To: dev@asterixdb.apache.org References: From: Mike Carey Message-ID: <13468fb8-5056-3dee-5459-fd3d4ff2b1c6@gmail.com> Date: Wed, 8 Mar 2017 10:13:14 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------5EE53FA68056B6E69D7C5D26" archived-at: Wed, 08 Mar 2017 18:13:23 -0000 --------------5EE53FA68056B6E69D7C5D26 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cameron, Siddesh, et al: One more thought: One thing that could be Very Cool about a JDBC driver would be that it would enable the use of AsterixDB from BI reporting tools. It would be restrictive - it could insist that the queries return flat/regular results (like when we export data results in CSV form) - but it would be really enabling from a reporting tool users standpoint. AsterixDB developers/analysts could then create views (CREATE FUNCTION myview ( ) AS ...) whose results are flat and which could be queried from the tool. There are basically two potential target audiences for Java/AsterixDB - app developers who want to write Java apps with an AsterixDB backend - hence perhaps JPA - or analysts who want to hook AsterixDB up to their favorite reporting tools - hence JDBC. (For the latter, the SQL++ query language would have to be the target, and we'd have to see if the SQL issued from them passes SQL++ muster.) Cheers, Mike On 3/8/17 7:08 AM, Cameron Samak wrote: > Hi Siddhesh, > > Maybe others have a different opinion on this, but I'm not convinced that > implementing an actual JDBC driver would be a good first Java client as it > would be quite restrictive. Once a more generic client exists, then > creating a JDBC driver might be useful to integrate with tooling that > expects one. > > The other two options you suggested don't seem mutually exclusive to me. > Something that allows JPA/JDO access could reuse much of a thin HTTP API > wrapper in its implementation. Since a thin wrapper would be very useful by > itself, I think it's best to start with that and then reuse parts of it to > build something like JPA/JDO support. > > > Thanks, > Cameron > > > > On Wed, Mar 8, 2017 at 12:25 AM, wrote: > >> Greetings, >> Currently AsterixDB does not provide any standard database access solution >> for Java such as JDBC/JPA. This issue was discussed in the mailing list and >> the JIRA issue is available at https://issues.apache.org/ >> jira/browse/ASTERIXDB-1369 (https://issues.apache.org/ >> jira/browse/ASTERIXDB-1369). A lot of enterprise Java software uses or is >> built on top of JDBC so its definitely important for AsterixDB to have some >> form of JDBC connectivity to be considered for such applications. >> Since JDBC is meant for RDBMS, making a driver for a semi-structured >> database like AsterixDB wont be straight forward. >> >> Lets see how other NoSQL databases have done it >> * Cassandra, HBase and MongoDB provide a custom Java client >> library which provides either custom data types or ORM facilities. It is >> not JDBC compliant >> * HBase provides JDBC connectivity via Apache Phoenix ( >> http://phoenix.apache.org/#SQL_Support (http://phoenix.apache.org/# >> SQL_Support)) >> * MongoDB provides JPA/JDO through DataNucleus and Hibernate OGM ( >> https://docs.mongodb.com/ecosystem/drivers/java/ ( >> https://docs.mongodb.com/ecosystem/drivers/java/)) >> >> For AsterixDB here are some possible solutions in increasing order of >> difficulty >> * Make a custom client library which is a thin wrapper that makes >> HTTP requests to the REST API, gets back data as JSON and then uses Jackson >> (or Gson) for mapping JSON to POJO. Use only standard Java Collections >> * Provide a JDBC driver that again makes HTTP requests to REST API >> and receives results in CSV and maps that to columns in RowSet. We may >> choose to drop any extra fields that come up in open data types or put them >> in the last column as JSON string. Also when I tested the CSV output mode >> of AsterixDB webapp it wasnt working well >> * Create a plugin for another JPA/JDO framework like DataNucleus >> or HibernateOGM (or Spring Data? i haven't gone in depth on that one). >> These frameworks are popular with devs and provide a lot of other >> functionality. >> >> I need the community's feedback on what approach they think would be >> right. >> I'm willing to work on this issue as part of GSOC so if any potential >> mentors are interested, please reply. >> >> Regards >> Siddhesh Rane >> --------------5EE53FA68056B6E69D7C5D26--