couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <j...@couchbase.com>
Subject Re: CiuchApp logic
Date Wed, 19 Sep 2012 17:57:55 GMT

On Sep 19, 2012, at 10:39 AM, Ido Ran <ido.ran@gmail.com<mailto:ido.ran@gmail.com>>
wrote:

I want to build game using CouchApp.
It's not sensitive data but I don't want very easy way to cheat.

It sounds like you want both players to have their own local CouchDB, and they’ll replicate
with each other?

In general, with a peer-to-peer system where you don’t trust the other peers, you have to
strictly validate any updates you receive. So if there’s a document representing the game
state, you have to verify that the new revision represents a valid move made from the state
of the old revision. Particularly important are that player turns have to alternate, and that
a revision received in replication has to represent a move by the other player. (So the document
schema has to include an indication of who made the last move.)

It gets trickier if the board state is expressed by multiple documents, because then you can’t
validate the entire move at once. It might not be feasible to do it that way.

—Jens

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message