This post originated from an RSS feed registered with Python Buzz
by Andrew Dalke.
Original Post: Web applications
Feed Title: Andrew Dalke's writings
Feed URL: http://www.dalkescientific.com/writings/diary/diary-rss.xml
Feed Description: Writings from the software side of bioinformatics and chemical informatics, with a heaping of Python thrown in for good measure.
CherryPy is one of many Python web
frameworks designed to simplify the development of web
applications. A big problem in web apps is maintaining state. The
web client doesn't stay connected to the server so neither side know
about changes in the other until a new connection is made.
This is a well-known problem and whichever system you choose will
explain how it solves the problem. It will most likely be through a
special session cookie or a modification to the URL to store
a session name.
Another problem is what to do when multiple requests occur at the same
time. CherryPy and many other systems use threads, though there are
other approaches. The two requests might make conflicting changes in
the server. The prototypical example is a counter tracking the number
of requests. The solution is to use a system that can handle
conflicts, like a SQL database or a server that uses internal locking.
Using the raw filesystem, while easy to do at the start, may lead to
problems because file locking under unix is shaky at best.
I could go on but there's nothing here specific to chemistry. Again,
all these problems are both all well-known and solved. It's just a
matter of understanding the approach used by the framework you chose.
(You could build a new framework but the odds are very small that it's
significantly different than several others that already exist and are
documented and debugged.)