News for hackers. Stuff that matters.
Re:SQL is 43 years old – Here’s why we still use it today by Kiro on Tuesday May 02, 2017 @09:05AM (#14245995)
Yes, I read them back as a JS object in whole on login. A few things are mandatory (hp, position) but most are optional and are only checked where needed.

    if (player.hasSomeProp) {
      doStuff(player);
    }
With your suggestion I would have a table with 200 fields and would probably have to add a lot of related tables since some of the props are arrays, objects etc. I also would lose the ability to just load the player as is (player = documentFromDB).

With "no-brainer" I mean it doesn't take any effort when developing since the representation of the player object in runtime is exactly the same as it's stored in the database.

Re:SQL is 43 years old – Here’s why we still use it today by elmigranto on Tuesday May 02, 2017 @09:43AM (#14246226)
I wasn't really suggesting anything, but if I were, Postgres and its binary JSON (`jsonb`) would be there alongside with full and easy indexing support and other SQL nicities like constraints, triggers, transactions, custom procedures, etc.

There are also excellent out-of-the-box support for arrays, enums, custom types, and JS procedures if you so desire. All that comes with consistent syntax, great aggregation functions, JOINs; and all those 43 years of advancement mentioned in general.

Read the docs, you'll be amazed with what you're missing :)

General overview https://www.postgresql.org/docs/current/static/tutorial.html

JSON support specifically https://www.postgresql.org/docs/current/static/datatype-json...

Re:SQL is 43 years old – Here’s why we still use it today by pythonaut_16 on Tuesday May 02, 2017 @09:27AM (#14246137)
I don't know anything about your game but I wonder if you could use SQLite to a similar effect.

If you just want things as JS objects, you could have a Player table with a column for playerID and a column for the JSON string.

I'm not saying you shouldn't use Mongo/NoSQL, I just think SQLite is an interesting potential choice. (e.g. https://sqlite.org/appfileformat.html)