A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Jump to

Quick reference

Flat file vs database

Flat file
  • Easy to set up, only have to consider local file permissions
  • Easy to implement in an ad-hoc way, ideal for a prototype
    • Plain text for very simple things like a list
    • JSON/YAML/Perl for complex data structures
  • Doesn't work when the app is load balanced across multiple servers
  • Not automatically backed up
  • Amazon S3 is relatively expensive
  • Have to make your own model
Database
  • Requires up-front schema design - more work, but forces you to consider design of data 
  • You can put business logic in the ResultSet models
  • Requires an instance to be provisioned
  • Easy cross-referencing of data
  • Works when the app is load balanced across multiple servers
  • Backup-as-a-service (i.e. replication)
  • Amazon RDS is cheaper than S3
  • Get the model for free with ORM
Conclusion

For production services that have redundancy (load balanced), always use a database unless the overhead of setting one up for the first time is considered too high for the business.