Python Database Apps

  • Thread starter Bruno Desthuilliers
  • Start date
B

Bruno Desthuilliers

Tom Brown a écrit :
I have had a lot of good luck with PostgreSQL. It is easy to install and use.

Well... For an experimented (or opiniated) Unix user, at least !-)

But I can only second : PgSql is probably one of the best free RDBMS
around - one of my previous associates (and still friend !-), who has
quite a few years of experience as an Oracle DBA, consider it (pg) as
mostly as good as Oracle, and eventually better on some points. My own
experience with Pg for web applications is that it JustWorks(tm) - never
had a single problem with it. I wish I could say so about MySQL.

wrt/ sqlite, I've only used it for small web apps, and the only problem
I had was a strange incompatibility bug with first PHP5 versions
installed on the same machine. Since I doubt your users will have PHP5
installed on the client machines (!), this should not be a problem.

And, while it may takes some time to learn, SQLAlchemy is a very great lib.
 
D

darien.watkins

Kindof a poll, kindof curiosity...

What is your favorite python - database combination? I'm looking to
make an app that has a local DB and a server side DB. I'm looking at
python and sqlite local side and sql server side.

Any suggestions????

Darien
 
U

Uwe Grauer

Kindof a poll, kindof curiosity...

What is your favorite python - database combination? I'm looking to
make an app that has a local DB and a server side DB. I'm looking at
python and sqlite local side and sql server side.

Any suggestions????

Darien

http://dabodev.com/
 
H

Harry George

Tom Brown said:
I have had a lot of good luck with PostgreSQL. It is easy to install and use.
It is also very stable. It maybe overkill for a client side database. The
psycopg package makes interfacing to PostgreSQL very easy and there is a
package for Linux and Windows to make cross-platform development a breeze.

-Tom

I use postgresql as well. I wonder if Pythonistas do so out of
concern for rigor, clarity, and scalability. It works fine for a
quick one-off effort and still works fine after scaling to a DBMS
server supporting lots of clients, and running 10's of GBs of data.

If an app comes already designed for mysql, oracle, sqlite, db2, dbm,
etc I'll use those. But for my own projects, it is postgresql, with
maybe SQLAlchemy (I'm back and forth on that. Mostly stay with
straight SQL).

Of course, as long as you write DBI2 compliant code, your app doesn't
much care which DBMS you use. The postgresql payoff is in admin
functionality and scaling and full ACID.
 
E

Ed Leafe

Kindof a poll, kindof curiosity...

What is your favorite python - database combination? I'm looking to
make an app that has a local DB and a server side DB. I'm looking at
python and sqlite local side and sql server side.

Are you asking for opinions on what sort of database engine to use?
Or are you trying to get a feel for what people use to develop their
apps? Are you looking for a web app, or a desktop app, or a non-UI app?

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
 
D

darien.watkins

Are you asking for opinions on what sort of database engine to use?
Or are you trying to get a feel for what people use to develop their
apps? Are you looking for a web app, or a desktop app, or a non-UI app?

-- Ed Leafe
--http://leafe.com
--http://dabodev.com

It would help to get a feel of what is the most popular combination
for people to develop their apps. It's gonna be a desktop app. The
database engine is going to be the critical component. I like sqlite
so that I don't need a database server on the client side. It would
help though if there is a way to sync between multiple clients to a
central server database. That's the tough part. To give you a better
idea of what i'm trying to do, I am trying to write an app where
multiple technicians have an issue tracker that is available both
offline and online. I was looking to use sqlite as the local side
that would sync new and updated issues to a central server when
online. Any technician may work on any issue. Generally they will
not be working on the same issue at the same time. The technicians
are geographically diverse (anywhere in the southeast US, not in an
office.)

Thanks for the feedback so far...

Darien
 
T

Tom Brown

Kindof a poll, kindof curiosity...

What is your favorite python - database combination? I'm looking to
make an app that has a local DB and a server side DB. I'm looking at
python and sqlite local side and sql server side.

Any suggestions????

I have had a lot of good luck with PostgreSQL. It is easy to install and use.
It is also very stable. It maybe overkill for a client side database. The
psycopg package makes interfacing to PostgreSQL very easy and there is a
package for Linux and Windows to make cross-platform development a breeze.

-Tom
 
J

Jonathan Gardner

I have had a lot of good luck with PostgreSQL. It is easy to install and use.
It is also very stable. It maybe overkill for a client side database. The
psycopg package makes interfacing to PostgreSQL very easy and there is a
package for Linux and Windows to make cross-platform development a breeze.

SQLAlchemy works wonderfully with PostgreSQL. I absolutely love it.

For client-side apps, managing a PostgreSQL installation might be
asking too much. But for a web site or web service, I absolutely
recommend it.
 
J

Jonathan Gardner

For client-side apps, managing a PostgreSQL installation might be
asking too much. But for a web site or web service, I absolutely
recommend it.

I should mention that I wrote a medical billing software app (client
side--PyQt) in Python with a PostgreSQL backend and there were no
problems (aside from managing the database--which was easy.) That was
over 4 years ago though.
 
D

David

It would help to get a feel of what is the most popular combination
for people to develop their apps. It's gonna be a desktop app. The
database engine is going to be the critical component. I like sqlite
so that I don't need a database server on the client side. It would
help though if there is a way to sync between multiple clients to a
central server database. That's the tough part. To give you a better
idea of what i'm trying to do, I am trying to write an app where
multiple technicians have an issue tracker that is available both
offline and online. I was looking to use sqlite as the local side
that would sync new and updated issues to a central server when
online. Any technician may work on any issue. Generally they will
not be working on the same issue at the same time. The technicians
are geographically diverse (anywhere in the southeast US, not in an
office.)

If you have an offline mode then the most important thing to work out
is how to handle conflicts in your data synchronization. You need a
clear logic policy for this, and some means of conflict resolution.
Also all parties need to be consistent and not go out of sync too
badly. Maybe avoid conflicts altogether. eg define exactly what types
of updates can take place offline (record insertions only). Or a
policy where deletes+updates can only be made offline by the
technician that "owns" the issue/has locked it. This approach has a
few issues also.

If the database is relatively small and your data is simple then you
could get away with simple table record comparisons to do syncing
(only works properly for inserts, and you need 'natural keys' for
comparison - updates and deletes are more complicated).

Another (really complicated) way is to use a series of log events,
which your app can commit locally or to the server, and merge incoming
events from the server. This is similar in principle to a SCM like
CVS, subversion, git, bazaar, etc. SVK is probably the closest to your
model (centralised scm, with offline commit mode). This gets
complicated very quickly.
 
I

Ivo

Kindof a poll, kindof curiosity...

What is your favorite python - database combination? I'm looking to
make an app that has a local DB and a server side DB. I'm looking at
python and sqlite local side and sql server side.

Any suggestions????

Darien
If you like to make a kind of stand alone app with a database, SQLite a
good choice. It is easy to embed into your app. If you keep to ANSI SQL
there should be no trouble changing databases at a later date.
I use SQLite for my WebSite http://IvoNet.nl and it performs great.
The whole database is less than 1Mb including the SQLite module for
python. No 50Mb install needed if you just want a simple database.
It makes my website very portable and easy to install.

MySQL works great to. I have used it a lot and it is very available.
Just about every provider can provide you one.

Ivo.
 
S

Steve Holden

Harry said:
I use postgresql as well. I wonder if Pythonistas do so out of
concern for rigor, clarity, and scalability. It works fine for a
quick one-off effort and still works fine after scaling to a DBMS
server supporting lots of clients, and running 10's of GBs of data.

If an app comes already designed for mysql, oracle, sqlite, db2, dbm,
etc I'll use those. But for my own projects, it is postgresql, with
maybe SQLAlchemy (I'm back and forth on that. Mostly stay with
straight SQL).

Of course, as long as you write DBI2 compliant code, your app doesn't
much care which DBMS you use. The postgresql payoff is in admin
functionality and scaling and full ACID.
I also have a tendency to prefer PostgreSQL over MySQL, though I run and
use both from time to time as an exercise in application portability.

Don't forget, there is absolutely no need to use the same database
technology for the client-side and the central repository - sqlite is
hard to beat for its simplicity and ease of installations on the client
side, and you could look at PostgreSQL for the repository as and when
that became a practical proposition.

regards
Steve

--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
--------------- Asciimercial ------------------
Get on the web: Blog, lens and tag the Internet
Many services currently offer free registration
----------- Thank You for Reading -------------
 
E

Ed Leafe

It's gonna be a desktop app. The
database engine is going to be the critical component. I like sqlite
so that I don't need a database server on the client side. It would
help though if there is a way to sync between multiple clients to a
central server database. That's the tough part. To give you a better
idea of what i'm trying to do, I am trying to write an app where
multiple technicians have an issue tracker that is available both
offline and online. I was looking to use sqlite as the local side
that would sync new and updated issues to a central server when
online. Any technician may work on any issue. Generally they will
not be working on the same issue at the same time. The technicians
are geographically diverse (anywhere in the southeast US, not in an
office.)

As far as the server goes, you can't go wrong with PostgreSQL, as
others have mentioned. I have more experience with MySQL, but their
recent licensing changes have simply made it easier to go with
Postgres, as I don't have to worry about which clause of which
document I might be violating.

For the local data store, SQLite is far and away the best choice,
since you don't have to use two types of data access, as you would if
you went with SQL on the server and, say, pickling on the local.

If you create both data stores with the same structure, you can use
UUIDs as your keys, along with a timestamp flag for records that are
added or modified when disconnected so that you can re-sync later.
You will have to handle conflicts (i.e., someone changed a record
that another also changed while disconnected) on your own,
implementing your own business logic to determine who "wins", and how
the conflicted data is handled.

I'll close with a plug for our product: Dabo. It is a desktop
application framework with support for SQLite, PostgreSQL, MySQL,
Firebird and Microsoft SQL Server databases. For disconnected data,
you would simply define a local connection (to SQLite) and a remote
connection (to your server database), and switch between the two
depending on whether you are disconnected or not. The framework will
handle the rest, allowing you to focus on the stuff that is unique to
your app, such as the conflict resolution and business logic.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
 
G

Goldfish

I use MySQL and also sqlite. However, I also use Spring Python (http://
springpython.python-hosting.com) to use both its DatabaseTemplate
utility class and also the remoting functionality. This way, I can
have the database code sitting on the server, and then export the data
access functions remotely to clients. It is also relatively easy to
swap out database engines.

For the record: Spring Python is my pet project. I use it myself, and
recommend it to others as well.
 
D

darien.watkins

As far as the server goes, you can't go wrong with PostgreSQL, as
others have mentioned. I have more experience with MySQL, but their
recent licensing changes have simply made it easier to go with
Postgres, as I don't have to worry about which clause of which
document I might be violating.

For the local data store, SQLite is far and away the best choice,
since you don't have to use two types of data access, as you would if
you went with SQL on the server and, say, pickling on the local.

If you create both data stores with the same structure, you can use
UUIDs as your keys, along with a timestamp flag for records that are
added or modified when disconnected so that you can re-sync later.
You will have to handle conflicts (i.e., someone changed a record
that another also changed while disconnected) on your own,
implementing your own business logic to determine who "wins", and how
the conflicted data is handled.

I'll close with a plug for our product: Dabo. It is a desktop
application framework with support for SQLite, PostgreSQL, MySQL,
Firebird and Microsoft SQL Server databases. For disconnected data,
you would simply define a local connection (to SQLite) and a remote
connection (to your server database), and switch between the two
depending on whether you are disconnected or not. The framework will
handle the rest, allowing you to focus on the stuff that is unique to
your app, such as the conflict resolution and business logic.

-- Ed Leafe
--http://leafe.com
--http://dabodev.com

Thanks for ideas Ed. I am checking out dabo now. I do have a few
questions about it. Packaging. Is it easy to package into a quick
install for windows. The users are going to want to get too in
depth. Second, data sources. When I'm adding a data source to the
window in class designer, it always picks up the one I created (which
incidentally was a sample, my form for connection manager isn't
working at the moment.) My idea is to have the the local sqlite
database as the only viewable data source, and the server side only
for syncing. So they logon, sync up, sync down, and view. I'm
worried about having to get them to install python, dabo, and the app.

Darien
 
E

Ed Leafe

Thanks for ideas Ed. I am checking out dabo now. I do have a few
questions about it. Packaging. Is it easy to package into a quick
install for windows. The users are going to want to get too in
depth.

py2exe is your friend here. I know several developers who have used
this to distribute Dabo apps, so we could certainly help you get your
setup.py working.
Second, data sources. When I'm adding a data source to the
window in class designer, it always picks up the one I created (which
incidentally was a sample, my form for connection manager isn't
working at the moment.) My idea is to have the the local sqlite
database as the only viewable data source, and the server side only
for syncing. So they logon, sync up, sync down, and view. I'm
worried about having to get them to install python, dabo, and the app.

The users would never see any of the Class Designer, connection
editor, or any of the other development tools. I would imagine that
you would need to code the sync parts by getting the current changed
data from the local SQLite database, creating a connection to the
server DB, doing the insert/update as needed, grabbing the latest
from the server, disconnecting from the server, and then updating the
local data. The user would probably need to do nothing more than
click a button to start running your code.

As far as what the user must install, that's what will happen with
any Python solution. py2exe takes care of all of that, bundling
Python, Dabo, your database modules, and any other dependencies into
a single .exe file. You can then use something like Inno Setup to
create a basic Installer that will look and work like any other
Windows application installer.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
 
P

Prateek

py2exe is your friend here. I know several developers who have used
this to distribute Dabo apps, so we could certainly help you get your
setup.py working.


The users would never see any of the Class Designer, connection
editor, or any of the other development tools. I would imagine that
you would need to code the sync parts by getting the current changed
data from the local SQLite database, creating a connection to the
server DB, doing the insert/update as needed, grabbing the latest
from the server, disconnecting from the server, and then updating the
local data. The user would probably need to do nothing more than
click a button to start running your code.

As far as what the user must install, that's what will happen with
any Python solution. py2exe takes care of all of that, bundling
Python, Dabo, your database modules, and any other dependencies into
a single .exe file. You can then use something like Inno Setup to
create a basic Installer that will look and work like any other
Windows application installer.

-- Ed Leafe
--http://leafe.com
--http://dabodev.com

Have you checked out Brainwave?
http://www.brainwavelive.com

We provide a schema-free non-relational database bundled with an app
server which is basically CherryPy with a few enhancements (rich JS
widgets, Cheetah/Clearsilver templates). Free for non-commercial use.



--Prateek Sureka
 
J

Jonathan Gardner

I use postgresql as well. I wonder if Pythonistas do so out of
concern for rigor, clarity, and scalability. It works fine for a
quick one-off effort and still works fine after scaling to a DBMS
server supporting lots of clients, and running 10's of GBs of data.

I can only speak for myself, but I use it for the reasons you listed.
I also appreciate the concise and clear documentation, the helpfulness
of the community, and the clarity of the code. It's also pretty easy
to get back into PostgreSQL after leaving it for years. There's not
too many weird details you have to remember to get your job done.
Of course, as long as you write DBI2 compliant code, your app doesn't
much care which DBMS you use. The postgresql payoff is in admin
functionality and scaling and full ACID.

It's not true that DBI2 compliance meands plug-and-play. Among the
various databases, the featuresets are different, and the way certain
features are implemented is different. You need something like
SQLAlchemy on top to make it truly portable.
 
J

Jonathan Gardner

Have you checked out Brainwave?http://www.brainwavelive.com

We provide a schema-free non-relational database bundled with an app
server which is basically CherryPy with a few enhancements (rich JS
widgets, Cheetah/Clearsilver templates). Free for non-commercial use.

You might want to rethink how you are handling databases. What sets
your database apart from hierarchical or object-oriented databases? Do
you understand why people prefer relational databases over the other
options? There's a reason why SQL has won out over all the other
options available. You would do well to understand it rather than
trying out things we already know do not work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top