For simplicity, let's say that databases are summarized as the place where you store and update data. Python is able to connect to a wide variety of databases. The simplest solution to handle databases in Python is to use plain text files. A tiny variation of this method is to store the information in binary format.
The next possible solution is to use the indexing mechanism provided by the dbm-like modules. This mechanism provides better performance than our first option because it automatically organizes the data. It works by implementing dictionary structures that are used to store information. This option enables you to encode Python objects, and efficiently archive them in indexed files without having to go through the details of parsing and unparsing the information.
For this reason, object serialization and persistence storing are also present here. Both concepts are very helpful when it comes to storing information. Their roles are to translate Python objects to strings before archiving them to the file system or before transferring them to another process.
The last solution is to use "real" databases'systems by importing third-party database extension modules, such as the native Python interfaces to MySQL, Oracle, and Sybase database systems.
If your database doesn't have a native interface to Python, don't worry. Python also offers ODBC extensions that will enable you to connect to any database that supports ODBC, and as you know, almost all database servers have ODBC drivers available nowadays.
In the worst -case scenario, many client /server database systems provide C libraries that connect to their databases. If you are a dedicated hacker, you can create extension modules that talk to these C libraries connecting to the database.