Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In the real world you probably wouldn't want to have a dob field on the unicorns table. Instead just use the timestamp embedded into the _id field.

Pretty good overall though.



"In the real world you probably wouldn't want to have a dob field on the unicorns table. Instead just use the timestamp embedded into the _id field."

The real world unicorns are not born on the same second that their db record is created.


The issue with that is if your DB gets backed and starts queuing writes, the timestamps will be skewed. Obviously this isn't always a show stopper, but a caveat nonetheless.


Actually the _id is usually created client-side so the timestamp will reflect when the application created the object rather than when it was processed by the DB. The only major exception is when the DB creates the _id for an upsert.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: