tags:

views:

154

answers:

4

which is the best back end for python applications and what is the advantage of using sqlite ,how it can be connected to python applications

+3  A: 

What do you mean with back end? Python apps connect to SQLite just like any other database, you just have to import the correct module and check how to use it.

The advantages of using SQLite are:

  • You don't need to setup a database server, it's just a file
  • No configurations needed
  • Cross platform

Mainly, desktops applications are the ones that take real advantage of this. For web apps, SQLite is not recommended, since the file containing the data, is easily readable (lacks any kind of encryption), and when the web server lacks special configuration, the file is downloadable by anyone.

rogeriopvl
Sorry to be pedantic, but you don't connect to SQLite just like any other database. No network connections are needed.
Jason Baker
What I really meant was that you have to import a module, and use it (like other databases) :)
rogeriopvl
A: 

The language you are using at the application layer has little to do with your database choice underneath. You need to examine the advantages of other DB packages to get an idea of what you want.

Here are some popular database packages for cheap or free:

ms sql server express, pg/sql, mysql

San Jacinto
however ms sql server express is severely limited.
nosklo
The language choice *does* affect your choice of RDBMS. Not because the two are connected, but because every language has varying support for different types of database. For example, SQL Server has about 4 sets of drivers, none of which are really complete. For example, adodbapi is the only one that has full dbapi support for stored procedures, but it's windows-only AFAIK.
Jason Baker
A: 

If you mean "what is the best database?" then there's simply no way to answer this question. If you just want a small database that won't be used by more than a handful of people at a time, SQLite is what you're looking for. If you're running a database for a giant corporation serving thousands, you're probably looking for Oracle. In between those, you have MySQL, PostgreSQL, SQL Server, db2, and probably more.

If you're familiar with one of those, that may be the best to go with from a practical standpoint. If you're doing a typical webapp, my advice would be to go with MySQL or PostgreSQL as they're free and well supported by just about any ORM you could think of (my personal preference is towards PostgreSQL, but I'm not experienced enough with either of these to make a good argument one way or another). If you do go with one of those two, my recommendation is to use storm as the ORM.

(And yes, there are free versions of SQL Server and Oracle. You won't have as many choices as far as ORMs go though)

Jason Baker
A: 

Django, Twisted, and CherryPy are popular Python "Back-Ends" as far as web applications go, with Twisted likely being the most flexible as far as networking is concerned.

SQLite can, as has been previously posted, be directly interfaced with using SQL commands as it has native bindings for Python, or it can be accessed with an Object Relational Manager such as SQLObject (another Python library).

As far as performance is concered, SQLite is fairly scalable and should be able to handle most use cases that don't require a seperate database server (nothing enterprise level). An additional benefit of SQLite is that the database is self-contained in a single file allowing for easy backup while remained a common enough format that multiple applications can access the data. A word of advice on using SQLite with Python, however, is that you may run into issues with threading (in the past most of the bindings for SQLite were not thread-safe, although this may have changed over time).

Jon