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 2786EE8AB for ; Mon, 27 May 2013 19:42:30 +0000 (UTC) Received: (qmail 23981 invoked by uid 500); 27 May 2013 19:42:27 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 23945 invoked by uid 500); 27 May 2013 19:42:27 -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 23937 invoked by uid 99); 27 May 2013 19:42:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 May 2013 19:42:27 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 209.85.217.179 as permitted sender) Received: from [209.85.217.179] (HELO mail-lb0-f179.google.com) (209.85.217.179) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 May 2013 19:42:23 +0000 Received: by mail-lb0-f179.google.com with SMTP id r11so7073637lbv.38 for ; Mon, 27 May 2013 12:42:02 -0700 (PDT) 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 :content-type; bh=I65Fjimo8rzHdaPRhNxEXiNcBOKvGAwe9Fe4Ng0w4QM=; b=rK3cj2ACAxkpQauxdbGqQt1bX4IFHzjc/PbTAfO2JWuWik5eP5zDVTwj3j/mpB0SgD BYK6c7ORN3nb2tMOJ4Pe2X5cy3Kz3n6iPzjHj/cJ/WT5WDJbERx4Sm8ra6R+fYRiuRkq dSeZk5jXC4L7ly7GejCk718onjqNgcgFN3cL5rLDbp+Uy+XKgiadmD1S8KtUoVHNKCdQ Oe1so15522xPf/BGo1QX1dB+zzBKPZZv+V49lgHz+E4h4lFRBCj/rkHRP3soKWsxKpxC om5R4S4E2pYmEEFDeEnc9YZdlxx7KKPasiZgTtAkj5bi8/u9NTS1oxdKqv6VtTGcv3k6 nfnw== X-Received: by 10.112.167.72 with SMTP id zm8mr14957943lbb.11.1369683721930; Mon, 27 May 2013 12:42:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.67.193 with HTTP; Mon, 27 May 2013 12:41:41 -0700 (PDT) In-Reply-To: References: From: Jonathan Ellis Date: Mon, 27 May 2013 14:41:41 -0500 Message-ID: Subject: Re: Using CQL to insert a column to a row dynamically To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Mon, May 27, 2013 at 9:28 AM, Matthew Hillsborough wrote: > I am trying to understand some fundamentals in Cassandra, I was under the > impression that one of the advantages a developer can take in designing a > data model is by dynamically adding columns to a row identified by a key. > That means I can model my data so that if it makes sense, a key can be > something such as a user_id from a relational database, and I can for > example, create arbitrary amounts of columns that relate to that user. Fundamentally? No. Experience has shown that having schema to say "email column is text, and birth date column is a timestamp" is very useful as projects and teams grow. That said, if you really don't know what kinds of attributes might apply (generally because they are user-generated) you can use a Map. > Wouldn't this type of model make more sense to just stuff into a relational > database? There's nothing wrong with the relational model per se (subject to the usual explanation about needing to denormalize to scale). Cassandra is about making applications scale, not throwing the SQL baby out with the bathwater for the sake of being different. -- Jonathan Ellis Project Chair, Apache Cassandra co-founder, http://www.datastax.com @spyced