Sunday, December 14, 2008

Hooray for multipart/x-mixed-replace!

Mozilla's support for this content type has allowed me to implement server push in AMI. No more polling. Updating the UI from server events is now much smoother and the traffic to the server is greatly reduced.

Of course IE doesn't support it, from what I've read. Eh, no great loss.

If I wanted to support IE I could implement long polling, which is where the client sends a status request only upon receiving a response. This would be functionally the same as using multipart/x-mixed-replace, but would be a lot of work to implement and supporting IE right now is a low priority for me.

Friday, December 5, 2008

I'm re-reading Accelerando by Charles Stross. There are a few books that are like intellectual ambrosia to me. This is one of them, at least the first part. It's now under the creative commons license and available for free. I very much identify with Manfred Macx. Manfred doesn't believe in scarcity, zero-sum games or competition. I would love to create a hierarchy of virtual companies and write their regulations in Python.

Thursday, December 4, 2008

Now I'm taking a look at Amazon SimpleDB, which went into beta a few days ago. SimpleDB works in concert with S3. It's designed for storing smaller chunks of data and automatically indexes everything. It's just as dynamic as S3 in that you don't have to provide any kind of schema before storing data.

So SimpleDB adds one component that was missing from S3 - indexing. However there is one more thing missing - concurrency handling. I see no mention of locking or even of whether operations are atomic. And there's a new problem, what Amazon calls "eventual consistency", which basically means that if you read back an item immediately after writing it, it might not reflect your changes. This is because the changes haven't yet propagated across all the storage locations.

They say the changes should usually be seen within a few seconds but any amount of time during which the data is inconsistent throws a big wrench into the works. Now I will have to maintain a sequence number on each item, increment the number when I make a change, and then POLL to see when it's up to date. Furthermore I'm going to need to maintain an index somewhere else containing all the sequence numbers of all the items so I can determine whether any given item is consistent. That's basically a show stopper for me.