Simple search and Display system, no need for db?

F

flit

Hello All,

I was discussing with a friend and we get in a hot debate.

We have homepage that act like a name list.

The user goes there:

- Choose the building -- Department and the user receive an html table
with all names .

So the user gives two inputs and receive the names.

Currently we are using this in mysql, This is the reason of the
debate.

If our list will never change and we are supposing that will be true
for a long time, is it not too much use an mysql?

Which kind of structure can we use in python? in web?

Thanks!
 
M

Marc 'BlackJack' Rintsch

The user goes there:

- Choose the building -- Department and the user receive an html table
with all names .

So the user gives two inputs and receive the names.

Currently we are using this in mysql, This is the reason of the
debate.

If our list will never change and we are supposing that will be true
for a long time, is it not too much use an mysql?

Maybe mysql is really a bit "heavy" for this. If you still want to use an
SQL DB then SQLite seems to be a candidate here. It doesn't need a
server and comes with Python 2.5. SQLite doesn't handle concurrent
updating of data that well, but in the given scenario there seem to be far
more queries than updates.

If the data is not too large, simple text files would do. Maybe in CSV
format. Either with building and department as columns in the files or
coded into the file name or path.

Another approach would be the JSON_ format. Again, if the data is not too
large one might send the whole JSON document to the client browser and use
JavaScript on the client side to display and filter the name lists. Then
you can slap the Web 2.0 buzz label onto the system. ;-)

Ciao,
Marc 'BlackJack' Rintsch
 
H

Helmut Jarausch

flit said:
Hello All,

I was discussing with a friend and we get in a hot debate.

We have homepage that act like a name list.

The user goes there:

- Choose the building -- Department and the user receive an html table
with all names .

So the user gives two inputs and receive the names.

Currently we are using this in mysql, This is the reason of the
debate.

If our list will never change and we are supposing that will be true
for a long time, is it not too much use an mysql?

Which kind of structure can we use in python? in web?

What about using a simple dictionary in Python. You can use the module
pickle (or cpickle) to dump it to disk and load it next time.
Furthermore you can easily write the whole web server in Python,
e.g. I like http://karrigell.sourceforge.net/

--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 
F

flit

If the data is not too large, simple text files would do. Maybe in CSV
format. Either with building and department as columns in the files or
coded into the file name or path.

That seems to be a good idea, but I am afraid the web hosting does not
have the csv modules..
(maybe if I do an split?)
 
M

Marc 'BlackJack' Rintsch

That seems to be a good idea, but I am afraid the web hosting does not
have the csv modules..

The `csv` module is part of the standard library.

Ciao,
Marc 'BlackJack' Rintsch
 

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

Forum statistics

Threads
474,433
Messages
2,571,683
Members
48,796
Latest member
Greg L.

Latest Threads

Top