Ask HN: What are must-know concepts for back end development?
491 pointsI’d like to learn more about backend development but most of what I find while searching are results like “Build a nodejs backend in 20 minutes” or “learn backend development in an hour.” I think part of the problem is I don’t know enough to ask the right questions.
Comments (130) 48 threads
Show all comments
Showing thread 2 of 48
In the official sense, Security also includes availability (see the CIA triad), so a large portion of the bullets others have mentioned focuses on that.
I think a security mindset (including availability, which leads to thinking about disaster recovery, performance, redundancy, high availability, distributed systems as a mechanism to achieve it etc) is the first aspect that I look in a backend developer.
Other things are important, but security mindset in my opinion is the first layer in the foundation.
Others on my list that may be helpful to deep dive into:
1. HTTP, REST, know it well.
2. GraphQL as a complement/alternative to REST.
3. If using relational databases, learn what is a N+1 selects issue and how to solve it
4. If using NoSQL databases, learn about the CAP theorem and understand the tradeoffs etc
5. Learn to avoid premature optimization. Measure and profile before jumping to conclusion on theoretic bottlenecks that don't exist.
6. Unit test all the things, learn how to mock and what to mock, learn the difference between unit and integration tests.
7. Invest time in good design, read some other open source projets, see how they organize the code, what packages, what modules. Learn about dependency injection, Inversion of control.
8. Learn some cloud patterns, such as exponential backoff, throttling
9. Know everything about cookies, localStorage, XSS, CSRF, JWTs, and session cookies, stateless vs stateful architecture etc.
10. DevOps: Look into containers and serverless, CI/CD
11. Multithreading if you are in a language that has them.
One of the most important concepts is the principle of least privilege which is rarely ever discussed. Every tutorial I’ve seen, even paid ones, (this isn’t to say all of them) give their app master DB credentials. You could vastly improve your applications security just by leveraging your DB engine’s native access control.
For those using Postgres here’s a great resource for setting up RBAC: https://www.postgresql.org/docs/9.0/user-manag.html
A clarification on my previous comment: The way I’ve used Postgres RBAC is to create roles for each service in my application that needs DB access. For example say you have a service (in my case typically a lambda function) that only ever reads data from the DB and only from specific tables. I would create a role that only grants SELECT privileges for those specific tables. This also disallows UPDATE, DELETE, ALTER etc. privileges. Then assign this service that role. This mitigates the possible damage done if that service is compromised and shrinks your applications attack surface.