Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'schema': 0.05; 'affected': 0.07; 'correct.': 0.07; 'subject:code': 0.07; 'ugly': 0.07; 'bug.': 0.09; 'migration': 0.09; 'worse': 0.09; 'yeah,': 0.09; 'cc:addr:python-list': 0.11; 'bug': 0.12; 'bugs.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'perfect.': 0.16; 'roy': 0.16; 'worse.': 0.16; 'subject:python': 0.16; 'sat,': 0.16; ':-)': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'app': 0.19; 'file,': 0.19; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'password.': 0.24; 'skip': 0.24; 'cc:2**0': 0.24; 'sort': 0.25; 'possibly': 0.26; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; '(like': 0.30; 'change,': 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'consequence': 0.31; 'pickle': 0.31; 'probability': 0.31; 'another': 0.32; 'cases': 0.33; 'fri,': 0.33; 'maybe': 0.34; 'problem': 0.35; 'common': 0.35; 'problem.': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'doubt': 0.36; 'scheme': 0.36; 'handle': 0.38; 'bad': 0.39; 'structure': 0.39; 'sure': 0.39; 'how': 0.40; 'easy': 0.60; 'solve': 0.60; 'simple': 0.61; 'offer': 0.62; 'more': 0.64; 'great': 0.65; '30,': 0.65; 'smith': 0.68; 'square': 0.74; 'complexity': 0.84; 'confusion.': 0.84; 'lived': 0.84; 'persistent': 0.84; 'absolutely': 0.87; 'increases': 0.91; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=pF2Z6rUr2vl7FjvI4GMYuHN7e92cuJlTOKVkDgxJ+Wg=; b=IIZ+BRL5UYifBWBqQ/qAYFSgZgxCitXiWJt2UnzHnSv2LAhfMlnTQVUSWaU0uXK2jY JWcfxftyhtIrA72KkLTJjLctUvoZFSBpfrKariz0tCJWocIQGMNwwxBnCuGZFSjeBSe7 OsAzjkZDMI+F/9FnvYnmlgpiFOkyMPgMhHqDpKnuA02SgjWsKbd3DaYmH6UFbh7MawCY O78Qw1PaThv7UwJ1Sfcx1UY1RaXcwMg54JfGRT2dabj2Mky/yeiaX2ds8dQaH8ANKdVt 9HWrAiOO+67NT3oj20ENd9VW69wfcWwg55/Jd3dQkQOk+XQohSBzSaX5sXB+iaZdM/wE mt3Q== MIME-Version: 1.0 X-Received: by 10.51.17.2 with SMTP id ga2mr7645295igd.2.1409351514572; Fri, 29 Aug 2014 15:31:54 -0700 (PDT) In-Reply-To: References: Date: Sat, 30 Aug 2014 08:31:54 +1000 Subject: Re: Keeping python code and database in sync From: Chris Angelico Cc: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 35 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409351518 news.xs4all.nl 2881 [2001:888:2000:d::a6]:37215 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77292 On Sat, Aug 30, 2014 at 3:04 AM, Skip Montanaro wrote: > On Fri, Aug 29, 2014 at 9:54 AM, Roy Smith wrote: >> Yeah, schema migration is an ugly problem. > > It's not really any worse than any other sort of complex data > structure change, is it? If your persistent data lived in a pickle > file, it would likely be as bad or worse. Well, correct. The problem isn't because it's in a database; the problem is a consequence of persistent structured data that can get out of sync. It's easy to solve in a simple way that breaks on any sort of confusion. It takes a bit more complexity (like the scheme I suggested) to handle a few more cases. It takes a lot more complexity (like the migration tools Roy listed) to cope with lots of awkward cases (I suspect at least some of them will handle back-levelling, which my scheme doesn't). And I doubt any of them is absolutely perfect. >> ... suckitude ... > > Nice word. Let's use it more so my polly app will see it as a common > word and maybe offer it to me in a potential XKCD 936 password. :-) > > suckitude suckitude suckitude suckitude suckitude suckitude suckitude > Yeah, it's a great word. As a general rule, suckitude increases with the square of design complexity and superlinearly with number of bugs. I'm not sure how suckitude is affected by bugs, exactly; possibly O(N log N), because each bug has a small probability of affecting another bug. ChrisA