Dalke Scientific Software: More science. Less time. Products
[ previous | newer ]     /home/writings/diary/archive/2005/04/26/web_applications

Web applications

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.)


Andrew Dalke is an independent consultant focusing on software development for computational chemistry and biology. Need contract programming, help, or training? Contact me



Copyright © 2001-2013 Andrew Dalke Scientific AB