Hacker News new | ask | show | jobs
by stavros 634 days ago
The main part is to avoid holding state in two places (frontend and backend) if you can do with holding state in only one (either frontend or backend).
2 comments

Unless you're building an app that holds data locally, for most web apps, you should be pushing state down into the backend. Fat models should be your single source of truth, skinny controllers, and service functions in order to separate data from code for testability.

Avoid caching as much as possible until you absolutely need to. As soon as you introduce caching you now have multiple sources of truth instead of one.

or be stateless… ;)