0

A previous question wanted to save each move to a database as a game of chess plays out. And asked what database to use to do this. Various possibilities were given:

MongoDb, CouchDb, MySql, SQLite

One answer in particular mentioned a traditional one to many mapping:

The only advantage I can see to a mongodb or couchdb is that you could conceivably store the entire match in a single record, thus making your data a little simpler. You wouldn't have to do the traditional one to many mapping between moves table and a game table.

What exactly does this mean and what would this look like in say PostgreSql so I have a concrete idea of what this means?

Community
  • 1
  • 1
user782220
  • 10,677
  • 21
  • 72
  • 135

1 Answers1

1

Below example Entity Relationship Diagram based on SQL 2005, but with some tweaks to datatypes it can be transferred to MySql or PostgreSql.

enter image description here

Farfarak
  • 1,497
  • 1
  • 8
  • 8
  • Going back to the previous question that I linked to. Would using this over say CouchDb make sense for chess? – user782220 Nov 09 '12 at 10:32
  • It depends on what kind of queries are you going to make to it, and volume of the data, and personal preference ( which one easier to use for you ). There is a link where performance differences are discussed http://stackoverflow.com/questions/1693412/couchdb-vs-mysql-speed – Farfarak Nov 09 '12 at 11:00
  • 1
    For chess what would be the benefits of having the game stored in multiple rows across multiple tables in sql vs storing everything in one chunk (or document)? – user782220 Nov 09 '12 at 22:49