Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #65873

Re: What is the recommended python module for SQL database access?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'scripts': 0.03; 'third- party': 0.04; 'model,': 0.05; '(so': 0.07; 'postgresql': 0.07; 'versions,': 0.07; 'logic': 0.09; 'occasionally': 0.09; 'postgres': 0.09; 'read-only': 0.09; 'replication': 0.09; 'subject:module': 0.09; 'that).': 0.09; 'whatever.': 0.09; 'yeah,': 0.09; 'runs': 0.10; 'cc:addr:python-list': 0.11; 'python': 0.11; "wouldn't": 0.14; '(also': 0.16; 'clustering': 0.16; 'database).': 0.16; 'db2,': 0.16; 'dislike': 0.16; 'effect.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'master.': 0.16; 'middleware.': 0.16; 'slave': 0.16; 'subject:access': 0.16; 'subject:python': 0.16; 'weird': 0.16; 'wrote:': 0.18; 'do.': 0.18; 'looked': 0.18; 'bit': 0.19; 'app': 0.19; 'restrictions': 0.19; 'things.': 0.19; '(the': 0.22; 'feb': 0.22; 'otherwise,': 0.22; 'cc:addr:python.org': 0.22; 'closely': 0.24; 'config': 0.24; 'integrate': 0.24; 'lets': 0.24; 'merge': 0.24; 'sends': 0.24; 'decide': 0.24; 'fairly': 0.24; "haven't": 0.24; 'cc:2**0': 0.24; 'sort': 0.25; "i've": 0.25; 'script': 0.25; 'mention': 0.26; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; 'chris': 0.29; 'external': 0.29; '[1]': 0.29; 'unix': 0.29; 'streaming': 0.30; 'message-id:@mail.gmail.com': 0.30; '(which': 0.31; 'too.': 0.31; 'node': 0.31; 'this.': 0.32; 'probably': 0.32; 'option': 0.32; '(including': 0.33; 'sense': 0.34; 'subject:the': 0.34; 'could': 0.34; 'agree': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'opposed': 0.36; 'oracle': 0.36; 'tight': 0.36; 'done': 0.36; 'thanks': 0.36; 'subject:?': 0.36; 'should': 0.36; 'so,': 0.37; 'las': 0.37; 'depends': 0.38; 'issue': 0.38; 'pm,': 0.38; 'how': 0.40; 'even': 0.60; 'easy': 0.60; 'authority': 0.60; 'problems.': 0.60; 'solve': 0.60; 'most': 0.60; 'free': 0.61; 'new': 0.61; "you're": 0.61; 'advanced': 0.63; "you've": 0.63; 'kind': 0.63; 'such': 0.63; 'promotion': 0.63; 'become': 0.64; 'more': 0.64; 'different': 0.65; 'side': 0.67; 'between': 0.67; 'biggest': 0.67; 'companies,': 0.68; 'led': 0.72; 'programs,': 0.74; '100%': 0.77; '2:02': 0.84; 'bane': 0.84; 'conflicts': 0.84; 'dba': 0.84; 'etc),': 0.84; 'free),': 0.84; 'hour,': 0.84; 'subject:SQL': 0.84; 'subject:recommended': 0.84; 'absolutely': 0.87; 'thoroughly': 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=BCfOYIp+Mz3Tx18YPHCBAfqio/JgA3RhW+N5R8U4r6E=; b=dJQRNUDz3q7HXDSl2e3jG1PzGHccFg7UbpkshzIhIKnHLBVo/9jbtbXCR5UJHkCj/f LYpD7ws03JuzvXDzZjnAENQVb6f9oY2q878HPxxzJkly6uXsdDkZqh/zsBHAUU0MMTnc ywSewjv4aXs7cxpfMirvdMdDiG3306ZVNBztQH1h61ig/u9vYNsHbX8j1OK5TICGdlAU TPb7JBdeb9R2MZu0sE8VQGSxmIpzH1rAlgIqA4Q1owVLDHWwW5ibECRxi9Njcy2XtxbW lSrw4k+8n7Z4YSOgca7/WaGSKIPVsozGFWOsKc0PNar9v1wcgiYKNtKKeiEZ71EHp60C Zlog==
MIME-Version 1.0
X-Received by 10.66.26.176 with SMTP id m16mr13077353pag.142.1392089496047; Mon, 10 Feb 2014 19:31:36 -0800 (PST)
In-Reply-To <1faf45e1-e982-4a30-87c7-7b5940f12734@googlegroups.com>
References <d2aa22af-8771-4944-ba2a-1098f9b5a735@googlegroups.com> <CAFEv2m5BOdZ3PzdVfQTw-K9xJ=oWiLi5ZOUFHAkimdndDshBnQ@mail.gmail.com> <mailman.6579.1391943667.18130.python-list@python.org> <ldc3iq$d5u$1@news.albasani.net> <1faf45e1-e982-4a30-87c7-7b5940f12734@googlegroups.com>
Date Tue, 11 Feb 2014 14:31:35 +1100
Subject Re: What is the recommended python module for SQL database access?
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6646.1392089499.18130.python-list@python.org> (permalink)
Lines 60
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392089499 news.xs4all.nl 2896 [2001:888:2000:d::a6]:39621
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65873

Show key headers only | View raw


On Tue, Feb 11, 2014 at 2:02 PM, Asaf Las <roegltd@gmail.com> wrote:
> On Tuesday, February 11, 2014 4:57:30 AM UTC+2, Walter Hurry wrote:
>> Chris Angelico wrote:
>> >
>> > And definitely don't go for a non-free option (MS-SQL, DB2, etc)
>> > unless you've looked into it really closely and you are absolutely
>> > thoroughly *sure* that you need that system (which probably means you
>> > need your app to integrate with someone else's, and that other app
>> > demands one particular database).
>> >
>>
>> I agree 100% with this. And speaking as an ex Oracle and DB2 DBA -
>> not to mention MS-SQL (spit), with which I occasionally had to dabble,
>> avoid them like the plague unless circumstances dictate.
>
> What is about clustering? Do we have such option for free alternatives?
>
> Thanks

PostgreSQL has replication in-built now, which will do most forms of
clustering. With some third-party software like Slony (also free), you
can do even more (including replicating between different PostgreSQL
versions, so you can upgrade progressively without any downtime; PG's
internal replication has tight restrictions on that). I've used PG's
streaming replication to fairly good effect. You do need some kind of
system to decide when to promote a slave to master, though - my boss
had this weird idea that each node had to be a perfect peer with no
external authority [1], which led to unsolvable problems, but if you
have an external system that declares which of several slaves should
be promoted, it's pretty easy to do. I could whip you up a
proof-of-concept in an hour, probably; just needs a heartbeat script
and some way of signalling them to fail over to the new master.

Clustering for performance, as opposed to reliability, is a bit
trickier. You can do read-only queries on slaves (so if you have a
many-readers-few-writers model, this can work nicely), but otherwise,
you probably need some third-party middleware. I haven't looked into
that side of things. Ultimately your biggest bottleneck is going to be
locking, which fundamentally has to be done in one place... or else
you have to deal with merge conflicts (the bane of true multi-master
replication).

So, it all depends on what you need to accomplish, and how much work
you're willing to do. Postgres offers a particular set of primitives
(including replication, promotion of a slave to master, etc), and lets
you trigger things from scripts (execute "pg_ctl promote" to make this
node become master). Advanced logic can be done by writing a Python
script that edits config files, runs programs, sends Unix signals,
whatever. There are pay-for Postgres support companies, too, if you
need that sort of thing.

tl;dr: Yeah, you can do that too. :)

ChrisA

[1] He had a weird issue with the concept of authority, actually. I
think his dislike of any form of government polluted his thinking so
he wouldn't accept even the IT sense of the word "authority". Never
mind that that's the best way to solve a lot of problems. But I
digress.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

What is the recommended python module for SQL database access? Sam <lightaiyee@gmail.com> - 2014-02-08 00:55 -0800
  Re: What is the recommended python module for SQL database access? Chris Angelico <rosuav@gmail.com> - 2014-02-08 20:04 +1100
  Re: What is the recommended python module for SQL database access? Marcel Rodrigues <marcelgmr@gmail.com> - 2014-02-09 08:20 -0200
  Re: What is the recommended python module for SQL database access? Chris Angelico <rosuav@gmail.com> - 2014-02-09 22:00 +1100
    Re: What is the recommended python module for SQL database access? Asaf Las <roegltd@gmail.com> - 2014-02-09 04:47 -0800
      Re: What is the recommended python module for SQL database access? Chris Angelico <rosuav@gmail.com> - 2014-02-10 00:14 +1100
        Re: What is the recommended python module for SQL database access? Asaf Las <roegltd@gmail.com> - 2014-02-09 05:27 -0800
          Re: What is the recommended python module for SQL database access? Chris Angelico <rosuav@gmail.com> - 2014-02-10 00:36 +1100
    Re: What is the recommended python module for SQL database access? Walter Hurry <walterhurry@gmail.com> - 2014-02-11 02:57 +0000
      Re: What is the recommended python module for SQL database access? Asaf Las <roegltd@gmail.com> - 2014-02-10 19:02 -0800
        Re: What is the recommended python module for SQL database access? Chris Angelico <rosuav@gmail.com> - 2014-02-11 14:31 +1100
          Re: What is the recommended python module for SQL database access? Asaf Las <roegltd@gmail.com> - 2014-02-10 19:45 -0800
      Re: What is the recommended python module for SQL database access? Chris Angelico <rosuav@gmail.com> - 2014-02-11 14:18 +1100
  Re: What is the recommended python module for SQL database access? Marcel Rodrigues <marcelgmr@gmail.com> - 2014-02-09 10:04 -0200
  Re: What is the recommended python module for SQL database access? Chris Angelico <rosuav@gmail.com> - 2014-02-09 23:13 +1100
  Re: What is the recommended python module for SQL database access? Tim Chase <python.list@tim.thechases.com> - 2014-02-09 08:31 -0600
  Re: What is the recommended python module for SQL database access? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-02-09 10:40 -0500
  Re: What is the recommended python module for SQL database access? Chris Angelico <rosuav@gmail.com> - 2014-02-10 09:03 +1100
  Re: What is the recommended python module for SQL database access? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-02-09 19:27 -0500

csiph-web