Lurker News
I’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

Earlier comments
BerislavLopac#
1. By definition, on the Web every application is a distributed system. Even the simplest HTML-only Web page with just one visitor involves at least two separate machines -- the server, which will at the very least run a HTTP server, and the client, which not only needs to run a browser, but also your HTML code (and possibly CSS, Javascript etc) will be parsed executed (parsed) in real-time. This means that all of the Web development -- back-end and front-end needs to take into consideration all the caveats and gotchas of distributed systems (including, but not limited to, the eight fallacies [0]).

2. Many Web frameworks -- Django and Ruby on Rails come to mind -- treat the database as an integral part of an application. In practice, however, the database in most cases runs as a separate service, more often than not on a completely separate machine. It is useful to view a database as just another part of your distributed system, with a very clear responsibility (persistence of state), that is accessed via a special API (SQL).
[0] https://en.wikipedia.org/wiki/Fallacies_of_distributed_compu...

vbsteven#
There are a lot of good answers in the comments. One thing I always do from the beginning that I see a lot of people forget is to decouple the API classes from the Database model.

For example, I use Java Spring a lot in combination with Hibernate. I always have a layer with my ORM classes mapped to the database, and then in my API layer I will have lots of mirror classes that initially look very similar to the database classes with a conversion step from one to the other. You can use libraries like ModelMapper for the tedious conversions.
With this setup it is easy to evolve the database schema without impacting the API and vice versa. This is something that (in my opinion) some web frameworks like Ruby on Rails do wrong by default.

nobody271#
I'll just list some that come to mind:

- The front end can do whatever it wants. The back end is where all important data integrity and security logic should go.
- Sessions. No one has mentioned sessions? Sessions are somewhat important.

Load more comments