Path: csiph.com!usenet.pasdenom.info!gegeweb.org!newsfeed.kamp.net!newsfeed.kamp.net!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.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.059 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'subject:file': 0.07; 'cc:addr:python-list': 0.11; 'thread': 0.14; '6:56': 0.16; 'agree.': 0.16; 'be:': 0.16; 'enough.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'processes.': 0.16; 'simpson': 0.16; 'subject: \n ': 0.16; 'files.': 0.16; 'wrote:': 0.18; 'file,': 0.19; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'file.': 0.24; '---': 0.24; 'cc:2**0': 0.24; 'updating': 0.26; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'correct': 0.29; 'chris': 0.29; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; 'that.': 0.31; 'bad.': 0.31; 'crash': 0.31; 'obliged': 0.31; 'option.': 0.31; 'maybe': 0.34; 'etc': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'wrong': 0.37; 'performance': 0.37; 'depends': 0.38; 'pm,': 0.38; 'either': 0.39; 'how': 0.40; "you're": 0.61; 'costs': 0.63; 'subject:more': 0.64; 'here': 0.66; 'between': 0.67; 'sharing': 0.69; 'integrity': 0.74; 'protect': 0.79; 'bang': 0.84; 'provisions.': 0.84; 'subject:read': 0.84; 'to:none': 0.92; 'state.': 0.95; '2013': 0.98 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=+dqTOHvkz7qZGXaJEhpV5We8+3o5L5nvE+A4lwENIz0=; b=BMVu4jxQtsi8pOwyzMSIjrzAevH6YIsg8hRsz9/O26WxJhgnbD7mMLeatHRt64nXFH uUvF24ub8wi9lYx4DHa6BIZ3PUhlb8GRKsxbq5cthLjDMywK949+B9Ad8pI7PaESo4Ns 9r4e6TDGJk70X8ErXQMxonNtKChebN7nxWSL+HhK3lAhtBbbLgtZPG7ENATBKDrWKaYp dNC3OWIjFtTxHiTMjURJToEebCkKlGfgxHo+TVY5Jp/+93eC/0SJOwcN/eb9zuEv1Yfq L/MTqekJ+LUjWia2MZ9MjSNBGTGz7pAmxQI4Q5sDXM3pp9v9cfEms7N1sRKidx5ASD+m RJUA== MIME-Version: 1.0 X-Received: by 10.66.102.39 with SMTP id fl7mr145554pab.43.1387441124944; Thu, 19 Dec 2013 00:18:44 -0800 (PST) In-Reply-To: <20131219075642.GA11967@cskk.homeip.net> References: <20131219075642.GA11967@cskk.homeip.net> Date: Thu, 19 Dec 2013 19:18:44 +1100 Subject: Re: Is it more CPU-efficient to read/write config file or read/write sqlite database? From: Chris Angelico Cc: "python-list@python.org" 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: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387441128 news.xs4all.nl 2931 [2001:888:2000:d::a6]:44735 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62386 On Thu, Dec 19, 2013 at 6:56 PM, Cameron Simpson wrote: > On 18Dec2013 21:50, Chris Angelico wrote: >> It's fundamentally about crash recovery, [...] >> Databases protect against that. If you want that protection, use a >> database. If you don't, use a file. There's nothing wrong with either >> option. > > Look, broadly I agree. But this thread was about sharing access to > configs etc between processes. And it segued into suggesting sqlite. > Which is good and bad. > > My point here is that here we were discussing cooperative access > to some shared state. And a "database" is tossed into the mix, with > its -- for this purpose --- overkill data integrity provisions. > > So I feel obliged to point out the performance costs associated > with using a sledgehammer to bang in a tack. Fair enough. So the correct decision in this instance may well be: Use a file, because you don't want a database. On the flip side, maybe the data integrity guarantees *are* what you want. Depends how often you're updating those files. ChrisA