Forums > MaxMSP

Multiple Computers accessing online database

September 9, 2008 | 11:23 pm

Hi,

I have a project with a problem that I a unsure how to address.

Multiple computers in different locations have access to a drawing program. The user draws a picture and then attaches it to a larger ‘communal’ picture.

The location of the users picture on the communal picture must not be the same as that chosen by another user.

Multiple users may be drawing a picture at the precise same moment as each other.

I need some way of accessing a database stored online that tests the users location choice and ‘checks it in’ if that location is not already taken.

I have never done anything like this before and don’t really know where to begin. My initial thoughts are to have some file (XMl/COLL file etc) stored on web space. When the user attempts to check their file in the XML/COLL is downloaded from the site making it unavailable for others to check their images in (I’ll deal with that problem later). The file is used to check in the users image and then re-uploaded to the web space for others to use.

Obviously with this method if max crashes before the file is re-uploaded ….. disaster. So am looking for a better/more sensible way to do this.

As I say I have never done anything like this before and would be interested in anybody’s opinion/tips/suggestions as to where I should begin to look for answers.

Cheers

Andy


September 10, 2008 | 9:37 am

I can’t speak from experience, but perhaps something like google gears would
be of use to you here. From my understanding, there is a central pool that
can automatically update databases on connected computers to keep the
current information syncronised. Your users can be online, but if they
should go offline for any reason the database is held on the local computer
so the latest information would still be available while they are being
reconnected.
Google gears isn’t available on safari as yet, but firefox is supported.
This would mean that you couldn’t use jweb as the interface from Max (on a
mac at least, I don’t know about the windows build of jweb), but, given the
limited useability that jweb offers for interfacing with Max at the moment
you’d need some other means of communicating with the database anyway.

Something else springs to mind here, but again I haven’t tested it: Andrew
has recently published a useful article on the Cycling website about
accessing the Max SQLite database. Google gears also uses SQLite so there
might be a way into accessing the information from Max using the information
that the article provides.

Some links:

Google gears: http://code.google.com/apis/gears/design.html
Andrew’s article:

http://www.cycling74.com/?op=displaystory;sid=2008/9/5/16230/12047

pelado

On Wed, Sep 10, 2008 at 1:23 AM, Andy Brennan wrote:

>
> I need some way of accessing a database stored online that tests the users
> location choice and ‘checks it in’ if that location is not already taken.
>
> I have never done anything like this before and don’t really know where to
> begin. My initial thoughts are to have some file (XMl/COLL file etc) stored
> on web space. When the user attempts to check their file in the XML/COLL is
> downloaded from the site making it unavailable for others to check their
> images in (I’ll deal with that problem later). The file is used to check in
> the users image and then re-uploaded to the web space for others to use.
>
> Obviously with this method if max crashes before the file is re-uploaded
> ….. disaster. So am looking for a better/more sensible way to do this.
>


September 10, 2008 | 5:24 pm

Thanks for the suggestions. The Max SQLite option sounds especially interesting since it is already a part of Max and has an example patch and article. I’ll check out Google Gears a little more thoroughly as well.

Cheers

Andy


September 11, 2008 | 3:41 am

Andy,

I was looking into this, and I suggest this forum post:

http://www.nabble.com/ways-to-sync-databases-with-Python-and-SQLite–td19402992.html

I agree with the user who suggests to keep a simple rolling log of
each sql entry. If you start with the same database on each machine,
then each subsequent change gets broadcast to everyone. That should
keep it in sync, provided you timestamp each change and don’t let
person A change before it’s confirmed that everyone else hasn’t made a
change before the commit happens. Else you’ll person B could have
deleted a table that person A is trying to perform a query on, for
example.

Google gears might not provide the speed you want; I also agree that
because SQLite is included, it will likely be easier to configure if
everyone is running MAXMSP or the runtime.

-Jerzy

On 9/10/08, Andy Brennan wrote:
>
> Thanks for the suggestions. The Max SQLite option sounds especially interesting since it is already a part of Max and has an example patch and article. I’ll check out Google Gears a little more thoroughly as well.
>
>
> Cheers
>
> Andy
>


Viewing 4 posts - 1 through 4 (of 4 total)