Database vs Data Structure?

castironpi at gmail.com castironpi at gmail.com
Sat Apr 19 16:45:44 EDT 2008


On Apr 19, 1:27 pm, Scott David Daniels <Scott.Dani... at Acm.Org> wrote:
> castiro... at gmail.com wrote:
> > On Apr 18, 12:23 am, I V <ivle... at gmail.com> wrote:
> >> On Thu, 17 Apr 2008 19:30:33 -0700, erikcw wrote:
> >>> use some sort of data-structure (maybe
> >>> nested dictionaries or a custom class) and store the pickled
> >>> data-structure in a single row in the database (then unpickle the data
> >>> and query in memory).
> >> Why would you want to do this? I don't see what you would hope to gain by
> >> doing this, over just using a database.
>
> > Are databases truly another language from Python, fundamentally?
>
> Yes.  A fair amount of study went into them.  Databases are about
> information that survives the over an extended period of time (months
> or years, not hours).
>
> Classic qualities for a database that don't normally apply to Python
> (all properties of a "transaction" -- bundled set of changes):
>      * Atomicity:
>         A transaction either is fully applied or not applied at all.
>      * Consistency:
>         Transactions applied to a database with invariants preserve
>         those invariants (things like balance sheets totals).
>      * Isolation:
>         Each transactions happens as if it were happening at its own
>         moment in time -- tou don't worry about other transactions
>         interleaved with your transaction.
>      * Durability:
>         Once a transaction actually makes it into the database, it stays
>         there and doesn't magically fail a long time later.
>
> -Scott David Daniels
> Scott.Dani... at Acm.Org

Scott,

Classical qualities for Python that don't normally apply to a database
are:
   * Encapsulation
   * Modularity

(Besides for social factors,) I make case that database language is
always better to start learning than program language.  They have no
properties of databases.

Hold that databases are slightly less sophisticated than language, and
you hold rates at which data comes from the universe.  Note,
information isn't terribly well quantified, but is empirical.  Note,
matter comes from the universe too, but information goes to heads and
we care.

I hold it's proper to distinguish, though: you're doing the usual
things to data from the real world, but it seems like things I want to
do to computer screen are hard to do to a computer screen.  I'm
sensitive to money (want>0); why doesn't it want to do computers?  I'd
rather just animate plastics.  Hook some up to it.  Build roads and
surfboards.  (No snowboards; it's water; or it's way below it.)  Plus
get a bunch from the A.C. lines.

Data always come from the universe, i.e. from matter.  Just another
way to make money with it.  Everyone can make money, what's the
problem with SQL?



More information about the Python-list mailing list