
Designed for backend engineers who want to demystify why systems work and bridge backend and network concepts. It also serves full-stack or frontend engineers seeking intermediate to advanced insights.
Explore backend engineering fundamentals by examining communication patterns, protocols, and execution models—from request-response and pub-sub to OSI, UDP/TCP, HTTP/1.1/2/3, TLS, and QUIC, ending with proxies and load balancers.
Repo: github /hnasr/backend-course-code
Explore synchronous versus asynchronous workloads, including blocking IO, non-blocking IO, callbacks, promises, and async/await, with Node.js event loop, queuing, and asynchronous backend processing.
We explain what Push is, how does it work, its pros and cons, and then we build a web socket chatting application using Push model
In this lecture we discuss Server Sent Events pattern and show an example in NodeJS
In this lecture I talk about the publish subscribe pattern, its pros and cons and show an example with RabbitMQ
Explore multiplexing and demultiplexing across http/1.1 and http/2, and how reverse proxies and connection pooling affect throughput and resource use.
Explore stateful and stateless backends and protocols to understand how applications store or transfer client state. Learn implications, such as session management, cookies, and database-backed state, influencing scalability and resilience.
What to take into account when designing a protocol?
Open Systems Interconnection model - this lecture is taken from my networking course.
This is a collection of lectures specific to IP protocol taken from my fundamentals of network engineering course merged into one lecture.
User Datagram Protocol - This is a collection of lectures specific to UDP protocol taken from my fundamentals of network engineering course merged into one lecture.
Transmission Control Protocol - This is a collection of lectures specific to TCP protocol taken from my fundamentals of network engineering course merged into one lecture.
Transport Layer Security - This is a collection of lectures specific to TLS protocol taken from my fundamentals of network engineering course merged into one lecture.
Learn how WebSocket enables bidirectional, full-duplex communication over HTTP via the upgrade handshake. Explore use cases like chat apps and live feeds, plus pros, cons, and a simple Node.js example.
Explore WebRTC for real-time peer-to-peer communication, covering SDP signaling, ICE candidates, NAT traversal with STUN and TURN, and browser data channels.
Explore https over tcp using tcp fast open, showing how a pre-shared tfo cookie resumes a connection and allows client hello data to follow immediately, under TLS 1.3.
Explore backend execution patterns for accepting and dispatching requests with tcp, udp, http, grpc, and https over tls and quic, and how listeners and process models affect performance and idempotence.
Compare processes and threads, explain how CPU scheduling and memory sharing shape multi-process and multi-thread backends, and show locking and copy-on-write strategies.
In this lecture we explain the SYN and ACCEPT queues in the OS and how the backend reads from them
In this lecture we explain the Receive and Sender queues in the OS and how the backend reads and writes to them
Discover the single listener, single acceptor, and single reader pattern in Node.js, where a thread handles connections asynchronously, and scale by running multiple Node.js processes.
Implement idempotency by attaching a unique request ID, a UUID, and replay-detect to prevent duplicate effects on the backend with absurd execution. Get is read-only; never use get for writes.
Learn how nagle's algorithm buffers tcp segments to fill the maximum segment size (MSS), causing client delays, and how disabling tcp no delay can improve overall performance.
Explore the difference between a proxy and a reverse proxy, and how they bridge to the back end, enabling caching, logging, and load balancers through gateways, sidecars, and api gateways.
Compare layer four and layer seven WebSocket proxying, explain how layer four tunnels traffic via nginx while layer seven terminates TLS and inspects content, enabling smart routing and WebSocket upgrades.
This is a video from my YouTube channel that I thought it's useful to add it here.
Code https://github.com/hnasr/javascript_playground/tree/master/chatgpt-twochats
Explain the OWASP top ten web security risks, including injection, broken authentication, sensitive data exposure, and more, and show how to design secure backend and frontend applications.
Explore how to perform graceful shutdowns in HTTP/1.1 and HTTP/2, including the go away frame, balancing connections, streams, and caches to free resources without disrupting clients.
Backend engineering is an art. During my 18 years career working with and building backend applications, I discovered that certain communication design patterns keep emerging. There are only handful of ways clients communicate with backend applications, although they might be more, I believe the patterns I discuss in this course are the most common. Examples of these patterns are request-response, publish-subscribe, short and long and push.
Based on these communication design patterns, engineers may use a number of protocols for concrete communication. While core transport vehicles are limited to either TCP or UDP, tons of industry specific protocols are built on top of these two to address certain problems and use cases. Examples of these high level protocols are HTTP/1.1, HTTP/2, HTTP/3, gRPC, WebRTC and many more. Other transport protocols like QUIC was built on top of UDP to bring HTTP/2 streaming down at the transport level. Each protocol has its pros and cons and fits certain use cases. In the course, I discuss the top common protocols and provide examples and demos where applicable.
Before the client can send a request, it has to establish a connection to the backend. Understanding how the connection is established, and what parts of connection establishment is done at kernel and what parts are done at the backend application process is critical. How the connection is then accepted by the backend application and how it can accept connections as fast as possible so the kernel queue doesn’t get full otherwise clients can no longer connect.
After the connection is established the client sends the request, but what happens exactly in the backend application to read the request? What exactly is a request? Understanding the cost of parsing a request based on the protocol makes the engineer appreciate the work done and equip her with better tools to troubleshoot performance problems or bugs.
Once the request reaches the backend, the application has to execute the request. The backend has a buffet of design choices when it comes to the style of execution it can choose. Understanding the difference between a process and a thread, multi-process, multi-threaded and the correlation to the number of CPU cores or hardware threads is crucial to pick the right execution pattern. One does not have to stick with these patterns but can invent new ones that suits their needs.
This course is designed for engineers who have built backend applications, it is an intermediate — advance level course, certain programming and networking knowledge is required so I recommend taking my fundamentals of network engineering course before taking this course if you don’t have the networking skills. I hope you enjoy this course, and thank you so much for considering it.