[Tutor] File vs. Database (possible off topic)

Alan Gauld alan.gauld at btinternet.com
Tue Nov 22 03:01:12 CET 2011

On 22/11/11 00:24, Ken G. wrote:
> It occurred to me last week while reviewing the files I made in using
> Python, it could be somewhat similar to a database.

Depending on how broadly you define "database" you could be right.

> What would be a different between a Python files and Python databases?

There is no such thing as a python database per-se. You can create 
databases in Python, as you can in any language.

> Granted, the access in creating them are different, I really don't see
> any different in the format of a file and a database.

A database in its most general sense describes a type of usage of a file 
so ther is no difference. However in the computing sense a database 
usually implies either a system or library that optimises the storage 
and retrieval of data in a way that is more efficient than simple 
sequential file access in Python. One such database is SqlLite which 
comes with Python. (But more primitive databases are also
provided like gdbms)

> Again, this may be off topic, but where can I review the basic concepts
> of creating a database/file.

Since its about programming basics its just about on topic.
But I'd start by reading wikipedia on the subject of databases. That 
will lead you into several different areas depending on interests. The 
theory of data storage/processing, the different available databases, 
object v relational data theory, and SQL.

> For example, when is a back up file created, after inputting a new value?

When the programmer creates it. In most operating systems backups are 
not reated automatically (VAX VMS and IBM OS./390 and a few 
others(Pick?) being exceptions).

But that has nothing much to do with databases.

 > Is sorting a consider a separate program after inputting a new value?

Yes, its a different operation that requires its own code - although 
Python does provide a sort method and most databases will provide a sort 

 > It has been some 30 years since I took a course in basic
> data processing...

Things have moved on quite a long way! Check wikipedia.

Alan G
Author of the Learn to Program web site

More information about the Tutor mailing list