Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 95681107BD for ; Wed, 30 Oct 2013 10:35:37 +0000 (UTC) Received: (qmail 96552 invoked by uid 500); 30 Oct 2013 10:35:37 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 96523 invoked by uid 500); 30 Oct 2013 10:35:36 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 96515 invoked by uid 99); 30 Oct 2013 10:35:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Oct 2013 10:35:35 +0000 X-ASF-Spam-Status: No, hits=2.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FRT_ADOBE2,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of amit.j76@gmail.com designates 209.85.212.47 as permitted sender) Received: from [209.85.212.47] (HELO mail-vb0-f47.google.com) (209.85.212.47) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Oct 2013 10:35:31 +0000 Received: by mail-vb0-f47.google.com with SMTP id m10so723943vbh.20 for ; Wed, 30 Oct 2013 03:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=9XT7nbKnnKBYnaloDYcoL9xCoB6W0o+VhgPYJhSFhDs=; b=odttKR+7y0H5fSZbOM/UuTS40qbrfO74uDM2T3WbKN7fStVrc/FQO1Px9Mzj5hgZth 1baOi61JyZ7p1AJEStejhejP8L/8d0je5HLjPLmTv+IpLdrN56g9kbTt+GVsd1TcMluE X7oY85Ethdr90OIR8ahIaCz1jOM5wD+TqKGldoWNZ1chSJpMiPpNDN4q8NLWCpE6wwAH kuTx98bsw0E2nvr7VxqUd9cbGyHgYh9cetD1fWEIrrHB8gzqO9W2/yhFCUM6oJnf1/Bl NAyEbUAp5fz7aPGH5QqW+rUr14juAqSolGG3+tOSrtcLyr4xbTVJWpg43lfOo00Cmk0w JFdA== X-Received: by 10.58.29.37 with SMTP id g5mr597357veh.38.1383129310975; Wed, 30 Oct 2013 03:35:10 -0700 (PDT) MIME-Version: 1.0 Sender: amit.j76@gmail.com Received: by 10.52.167.73 with HTTP; Wed, 30 Oct 2013 03:34:50 -0700 (PDT) In-Reply-To: References: <9C0FC4C8E9C29945B01766FC7F9D389818A7DC2B82@eurmbx01.eur.adobe.com> From: Amit Jain Date: Wed, 30 Oct 2013 16:04:50 +0530 X-Google-Sender-Auth: 2a_iwCyGRiNQWKxW98NajkXXBwE Message-ID: Subject: Re: Strategies around storing blobs in Mongo To: oak-dev@jackrabbit.apache.org Content-Type: multipart/alternative; boundary=047d7b6786fe425f6604e9f2e3d4 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b6786fe425f6604e9f2e3d4 Content-Type: text/plain; charset=ISO-8859-1 >> So even adding a 2 >>MB chunk on a sharded system over remote connection would block read >>for that complete duration. So at minimum we should be avoiding that. I guess if there are read replicas in the shard replica set then, it will mitigate the effect to some extent On Wed, Oct 30, 2013 at 3:04 PM, Chetan Mehrotra wrote: > > sounds reasonable. what is the impact of such a design when it comes > > to map-reduce features? I was thinking that we could use it e.g. for > > garbage collection, but I don't know if this is still an option when data > > is spread across multiple databases. > > Would investigate that aspect further > > > connecting to a second server would add quite some complexity to > Yup. Option was just provided for completeness sake. And something > like this would probably never be required. > > > that was one of my initial thoughts as well, but I was wondering what > > the impact of such a deployment is on data store garbage collection. > > Probably we can make a shadow node for the binary in the blob > collection and keep the binary content within the DataStore itself. > Stuff like Garbage collection would be performed on the Shadow node > and logic would use results from that to perform actual deletions. > > > Chetan Mehrotra > > > On Wed, Oct 30, 2013 at 1:13 PM, Marcel Reutegger > wrote: > > Hi, > > > >> Currently we are storing blobs by breaking them into small chunks and > >> then storing those chunks in MongoDB as part of blobs collection. This > >> approach would cause issues as Mongo maintains a global exclusive > >> write locks on a per database level [1]. So even writing multiple > >> small chunks of say 2 MB each would lead to write lock contention. > > > > so far we observed high lock content primarily when there are a lot of > > updates. inserts were not that big of a problem, because you can batch > > them. it would probably be good to have a test to see how big the > > impact is when blogs come into play. > > > >> Mongo also provides GridFS[2]. However it also uses a similar strategy > >> like we are currently using and such a support is built into the > >> Driver. For server they are just collection entries. > >> > >> So to minimize contentions for write locks for uses cases where big > >> assets are being stored in Oak we can opt for following strategies > >> > >> 1. Store the blobs collection in a different database. As Mongo write > >> locks [1] are taken per db level then storing the blobs in different > >> db would allow the read/write of node data (majority usecase) to > >> continue. > > > > sounds reasonable. what is the impact of such a design when it comes > > to map-reduce features? I was thinking that we could use it e.g. for > > garbage collection, but I don't know if this is still an option when data > > is spread across multiple databases. > > > >> 2. For more asset/binary heavy usecase use a separate database server > >> itself to server the binaries. > > > > connecting to a second server would add quite some complexity to > > the system. wouldn't it be easier to just leverage standard mongodb > > sharding to distribute the load? > > > >> 3. Bring back the JR2 DataStore implementation and just save metadata > >> related to binaries in Mongo. We already have S3 based implementation > >> there and they would continue to work with Oak also > > > > that was one of my initial thoughts as well, but I was wondering what > > the impact of such a deployment is on data store garbage collection. > > > > regards > > marcel > > > >> Chetan Mehrotra > >> [1] http://docs.mongodb.org/manual/faq/concurrency/#how-granular-are- > >> locks-in-mongodb > >> [2] http://docs.mongodb.org/manual/core/gridfs/ > --047d7b6786fe425f6604e9f2e3d4--