File I/O
We discussed previously a use case whereby users upload data from their local system to a Bokeh server application for it to be processed and visualized there. As was noted, in that scenario, user data are never stored on disk or in a database on the server — instead, they reside in memory as part of the server application after being uploaded, and are deleted from memory once that specific browser connection is closed. This might be a common use case where different users each have their own particular data files, but want to carry out a typical set of data processing and/or visualization operations for the data of interest.
The mechanics of this process are a bit different than might typically be done if the data were in fact resident on the server's filesystem. In that use case, one would typically use standard sorts of input/output (I/O) functionality to read and write data from a file, for example, by creating and reading from python file objects using the built-in open
function, or using package-specific I/O functions, such as pandas.read_csv
to read a csv file.
In the pages that follow, we discuss some of the issues that arise in doing file I/O when using Bokeh server.