Semicolon & Sons
X
About
Contact & Support
Code Diary
Episodes
Blog
Subscribe
Sign in
Semicolon & Sons
About
Screencasts
Code Diary
Blog
Contact & Support
Subscribe
Sign In
Data Code Diary Entries
This is part of the Semicolon&Sons
Code Diary
- consisting of lessons learned on the job.
Always use strings keys in JSON in languages that support symbol keys
Be alert for non standard base representations
Ensure all envs have same key seed accounts
Format data before validating
Has one and many2many etc relationships are about possibility not reality
Higher DB ids should always correspond with later points in time
If data is hashed or encrypted remember to check your setters do that too
JSON requires double quotes for strings
Prefer two boolean columns to one column which contains combinations
Take data interchange specs seriously
Use a key value built in schema with JSON
Use fuzzy match algorithms to manage messy string data
Use number types instead of stringifying everything
Use simple data formats
Use standard formats for date times
Validations for presence are ambiguous with key value styles
When append writing CSV do not write headers twice
When modifying code that acts on production data test against a good sized sample
When using foreign keys seed the dependent records first
Your seed data must exactly reflect the structure of real data