Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-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 9E9A61860A for ; Wed, 10 Feb 2016 20:22:23 +0000 (UTC) Received: (qmail 40529 invoked by uid 500); 10 Feb 2016 20:22:20 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 40491 invoked by uid 500); 10 Feb 2016 20:22:20 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 40481 invoked by uid 99); 10 Feb 2016 20:22:20 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Feb 2016 20:22:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 2741BC1171 for ; Wed, 10 Feb 2016 20:22:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.299 X-Spam-Level: * X-Spam-Status: No, score=1.299 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=jonhaddad-com.20150623.gappssmtp.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id pdru0uOJSz8l for ; Wed, 10 Feb 2016 20:22:19 +0000 (UTC) Received: from mail-ob0-f171.google.com (mail-ob0-f171.google.com [209.85.214.171]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id B64B820549 for ; Wed, 10 Feb 2016 20:22:18 +0000 (UTC) Received: by mail-ob0-f171.google.com with SMTP id is5so44594752obc.0 for ; Wed, 10 Feb 2016 12:22:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jonhaddad-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-type; bh=Yf7vIdFs7V+6ytq7wMMe21SOeQdK2JKmz7RTWCnXZAs=; b=ORA3pWuKtopOqiXJoBgoVa0PlS8lWYlE6uk99g8PBTDWlMkcwrQA+ihN5X65U9mMzj Ve/AJ/xl/Kmx1IIySPa6p8zsqLhBZR+jil8qApRXs1ZJkAyIkaxmZ6INKouoOqn9uevi r7hbsXZTrUwJvHYAYEgHyFsHGKzin8+3BgEU8jO6T6e0GyoaMSz0wAU0KdUFc1Li2M+r Sn+6JJ7yyqYghvi9dRbucztHXSEJnM9w51kBERzw1a4ZQ1InYyr+8uTXSJb+auwJ/pZz ZCb1Di6v7mIsg2m/sQ1PoYbieNn2kQN5mpsubdZpKTe4lv5ekgL0qw/wffX8p3qJehLN sNiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; bh=Yf7vIdFs7V+6ytq7wMMe21SOeQdK2JKmz7RTWCnXZAs=; b=aOue4EwV1dGVri3aj9QWrcue3JQnx+YDFA+kYIKNh6AfDtYM4E7N++gVbF+sg6upRJ y++OwYmnmX/ZqG+8m5JHDeEnTV6EB+gc13GphppnviYWTfhcFDGA1ppY7oZAzeDG2ftl 1pz0FEU2AjTuIBkT+7W5khHhCar7h4VvxH1rVnl9ZD3hB4rQDcUmCy4XaGhoRoM7OEBe 84age4b55V153GTe7KwMFOqXIuuTU9wV4eDyanAN+NtzVZ2LExUT7EGPx5vvTydfQ9xL ccPc9AArh2gwkt8JITa3jZMCI3ss04JT7/XWViTkCiwpfccos39uTwqBbotLTfRxkv7X 5UwA== X-Gm-Message-State: AG10YORVf9AAQ5vfQBORjDufxSS8BennvT1Wcf41Q5YFGLN4smRakLPQ10qf8AGKhjoAd6Dz1PKNeqU7dvwa9A== X-Received: by 10.182.186.105 with SMTP id fj9mr15117309obc.17.1455135731935; Wed, 10 Feb 2016 12:22:11 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Haddad Date: Wed, 10 Feb 2016 20:22:01 +0000 Message-ID: Subject: Re: Schema Versioning To: "user@cassandra.apache.org" Content-Type: multipart/alternative; boundary=089e0149544666f62d052b7030c4 --089e0149544666f62d052b7030c4 Content-Type: text/plain; charset=UTF-8 I wrote most of the cqlengine keyspace & table management pieces of the Python driver to solve this exact problem. Instead of working with a series of statements for creating tables & managing columns, we simply created classes in Python and sync'ed them to the DB. It automatically figured out what was needed and took care of it. DB Models: https://datastax.github.io/python-driver/api/cassandra/cqlengine/models.html Syncing to DB: https://datastax.github.io/python-driver/api/cassandra/cqlengine/management.html#cassandra.cqlengine.management.sync_table If you're not using Python, I'm not sure what options you have, I'm not much help there. On Wed, Feb 10, 2016 at 12:05 PM Joe Bako wrote: > Hi all, > > I am curious what techniques are used by others to manage schema changes > over time in Cassandra. > > Modern RDBMS tools can compare schemas between DDL object definitions and > live databases and generate change scripts accordingly. Older techniques > included maintaining a version and script table in the database, storing > schema change scripts in a sequential fashion on disk, and iterating over > them to apply them against the target database based on whether they had > been run previously or not (indicated in the script table). > > The former allows you to easily see schema changes over time in your SCM > history, the latter keeps a history of actual DDL applied against the > database objects. What options are available for C* and what are people > using? > > Joe Bako > Software Architect > Gracenote, Inc. > http://www.gracenote.com/ > > --089e0149544666f62d052b7030c4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I wrote most of the cqlengine keyspace & table managem= ent pieces of the Python driver to solve this exact problem.=C2=A0 Instead = of working with a series of statements for creating tables & managing c= olumns, we simply created classes in Python and sync'ed them to the DB.= =C2=A0 It automatically figured out what was needed and took care of it. = =C2=A0


If you're not using Python, I'm not sure what options you have, = I'm not much help there.

On Wed, Feb 10, 2016 at 12:05 PM Joe Bako <jbako@gracenote.com> wrote:
Hi all,

I am curious what techniques are used by others to manage schema changes ov= er time in Cassandra.

Modern RDBMS tools can compare schemas between DDL object definitions and l= ive databases and generate change scripts accordingly.=C2=A0 Older techniqu= es included maintaining a version and script table in the database, storing= schema change scripts in a sequential fashion on disk, and iterating over = them to apply them against the target database based on whether they had be= en run previously or not (indicated in the script table).

The former allows you to easily see schema changes over time in your SCM hi= story, the latter keeps a history of actual DDL applied against the databas= e objects.=C2=A0 What options are available for C* and what are people usin= g?

Joe Bako
Software Architect
Gracenote, Inc.
= http://www.gracenote.com/

--089e0149544666f62d052b7030c4--