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 4B4BA200BC0 for ; Tue, 15 Nov 2016 21:22:17 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 49EDD160B03; Tue, 15 Nov 2016 20:22:17 +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 6C277160AF2 for ; Tue, 15 Nov 2016 21:22:16 +0100 (CET) Received: (qmail 67849 invoked by uid 500); 15 Nov 2016 20:22:15 -0000 Mailing-List: contact user-help@avro.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@avro.apache.org Delivered-To: mailing list user@avro.apache.org Received: (qmail 67839 invoked by uid 99); 15 Nov 2016 20:22:15 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Nov 2016 20:22:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 0FC821A04D7 for ; Tue, 15 Nov 2016 20:22:15 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.63 X-Spam-Level: ** X-Spam-Status: No, score=2.63 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, 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, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-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 (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id IzASVF69xpIT for ; Tue, 15 Nov 2016 20:22:13 +0000 (UTC) Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id DC7F65F472 for ; Tue, 15 Nov 2016 20:22:12 +0000 (UTC) Received: by mail-it0-f52.google.com with SMTP id o1so20345816ito.1 for ; Tue, 15 Nov 2016 12:22:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=DTqFYJ5AFeYAcHLyIvGCO1S9y4cc9jMkB4expYeOF74=; b=HQ8ssbbCbUdQCn0OApWtDaZFaqEaGid3FiQNw4Evy/JB7C9ZZOE9eM2JDNqxrTAVIr CBVmVbmRzWm6t3mF8NOq7qwOBx+Fq11G/hE+EbKmBHLxxeoYSa4/ygZLFHMP4KjpqK4L cKRNYu+OxWOQS2iMj2jvlPaTTzmIZECMa8Xxl/aiHsirQ4kfgkctTY+MEejMPqv2hEup jPv1snQpLNm0pPAwS6OWfxq0eyFDe5KlQMOO2/9+b7lDA52duYAtLCtWPV35fqdiJI+T zKbJhbW0yGly4zv4EBtYseFjPBEFmJBWLYr5Tj5mMWWPBLy6EIvSlJdXa08fxkHiP2O2 F2hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=DTqFYJ5AFeYAcHLyIvGCO1S9y4cc9jMkB4expYeOF74=; b=HVgNUX/a5YYBchRKCDQxdARJr/G4sA6hpYEH9m7S5LFADoSL+JwW3LaHeSBws08SDW 1GClKiDBIJj5QI+3AxkaB6dL4OIcwIHkySRI0O/IGr3ywpk2qu0O3DcbT1wAxJ58zFv8 klbNoblvwwmr63mxhY7ALcQPas9KDWJCsa5Szya/+9EaQom2vGnFXnmmOZ1fIDJe6sTA RRiZsAg9qDe1zezpNbAFc7uSOpYQd8tclSYkGXHkoeYIWKYuw4B+wYvNxnqYFH5GNSN3 5MdMCO9TMnPrTx5e6B6ZRFSqIF+e/vN8CCuUfosdx1drkVUOIPBMbbGRrI9KWXub7y9j 49/g== X-Gm-Message-State: ABUngvdbTCzI2nXPLUU2ierxzTFZ+SVB0OA+6GvGgDRDDxuZB5R/MAOlDy9PTQaj9zGdFP9usT3bQVwa1KehVw== X-Received: by 10.36.81.145 with SMTP id s139mr4736755ita.73.1479241331386; Tue, 15 Nov 2016 12:22:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.4.67 with HTTP; Tue, 15 Nov 2016 12:22:10 -0800 (PST) In-Reply-To: References: From: Josh Date: Tue, 15 Nov 2016 20:22:10 +0000 Message-ID: Subject: Re: Alternative to Avro container files for long-term Avro storage To: user@avro.apache.org Content-Type: multipart/alternative; boundary=001a1135058018f1b505415cb669 archived-at: Tue, 15 Nov 2016 20:22:17 -0000 --001a1135058018f1b505415cb669 Content-Type: text/plain; charset=UTF-8 Thanks for the replies, Originally I wanted to have a Kafka topic with multiple schema types, but Ken's approach sounds like it could work well so I will try out the single schema approach with a big union type at the root of the schema. Josh On Tue, Nov 15, 2016 at 4:44 PM, John McClean wrote: > One approach is to have separate Kafka topics per schema, which evolve > with use of a schema registry: https://github.com/ > confluentinc/schema-registry. You'd write to the topic with the schema id > in metadata. You'd write normal avro storage files, knowing when to split > them based on the changing schema id in the kafka message. > > On Tue, Nov 15, 2016 at 2:24 AM, Josh wrote: > >> Hi all, >> >> I am using a typical Avro->Kafka solution where data is serialized to >> Avro before it gets written to Kafka and each message is prepended with a >> schema ID which can be looked up in my schema repository. >> >> Now, I want to store the data in long-term storage by writing data from >> Kafka->S3. >> >> I know that the usual way to store Avro in storage is using Avro >> container files, however a container file can only contain messages encoded >> with a single Avro schema. In my case, the messages may be encoded with >> difference schemas, and I need to retain the order of the messages (so that >> they can be replayed into Kafka, in order). Therefore, a single file in S3 >> needs to contain messages encoded with different schemas and so I can't use >> Avro container files. >> >> I was wondering what would be a good solution to this? What format could >> I use to store my Avro data, such that a single data file can contain >> messages encoded with different schemas? Should I store the messages with a >> prepended schema ID, similar to what I do in Kafka? In that case, how could >> I separate the messages in the file? >> >> Thanks for any advice, >> Josh >> > > --001a1135058018f1b505415cb669 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the replies,
Originally I wanted to hav= e a Kafka topic with multiple schema types, but Ken's approach sounds l= ike it could work well so I will try out the single schema approach with a = big union type at the root of the schema.

Josh

On Tue, N= ov 15, 2016 at 4:44 PM, John McClean <jmcclean@gmail.com> w= rote:
One approach is to= have separate Kafka topics per schema, which evolve with use of a schema r= egistry:=C2=A0https://github.com/confluentinc/schema-registry. = You'd write to the topic with the schema id in metadata. You'd writ= e normal avro storage files, knowing when to split them based on the changi= ng schema id in the kafka message.

On Tue, Nov = 15, 2016 at 2:24 AM, Josh <jofo90@gmail.com> wrote:
Hi all,

I am u= sing a typical Avro->Kafka solution where data is serialized to Avro bef= ore it gets written to Kafka and each message is prepended with a schema ID= which can be looked up in my schema repository.

N= ow, I want to store the data in long-term storage by writing data from Kafk= a->S3.=C2=A0

I know that the usual way to store= Avro in storage is using Avro container files, however a container file ca= n only contain messages encoded with a single Avro schema. In my case, the = messages may be encoded with difference schemas, and I need to retain the o= rder of the messages (so that they can be replayed into Kafka, in order). T= herefore, a single file in S3 needs to contain messages encoded with differ= ent schemas and so I can't use Avro container files.=C2=A0
I was wondering what would be a good solution to this? What fo= rmat could I use to store my Avro data, such that a single data file can co= ntain messages encoded with different schemas? Should I store the messages = with a prepended schema ID, similar to what I do in Kafka? In that case, ho= w could I separate the messages in the file?

Thank= s for any advice,
Josh


--001a1135058018f1b505415cb669--