Profile avatar
hnasr.bsky.social
Backend and Database Courses https://courses.husseinnasser.com YouTube http://youtube.com/@hnasr Author of https://pglocks.org
70 posts 139 followers 2 following
Regular Contributor
Active Commenter

Took me a while to understand the typescript optimization. What I didn’t realize is tsc (the typescript compiler) itself is written in Typescript which needs a runtime to be interpreted (Node). The change was to rewrite tsc in Go, producing native tsc executable. good stuff.

There is tremendous joy that can be extracted from breaking down technology to its fundamental first principles. At first it is blurry, confusing and filled with vague abstraction. Once understood, it is clear as day. Only then an engineer can use the technology effectively.

New course alert Node Internals and Architecture grab it at node.win

Limited $9.99 coupons for my courses expire Mar 5th OS-MAR2025-A BACK-MAR2025-A NET-MAR2025-A NGINX-MAR2025-A DB-MAR2025-A PY-MAR2025-A PF-MAR2025-A All my courses courses.husseinnasser.com

TIL that fsync need to be called on open, especially for WAL files, in case of a previous incarnation crashes that may have wrote to the page cache.

memory allocation is an interesting dilemma. You can allocate exactly what you need making allocations compact and efficient. But once you start deallocating, you are left with too many tiny non-uniform gaps and fragments that cannot be reused effectively (left image) Meet external fragmentation

Any code you write has a flaw, It might not be obvious today, but it will reveal itself one day.

I think most bloat in modern apps stems from the development on high-end machines, which masks inefficiencies in code.

There is no simple code. There is code that looks simple. If you dig deep enough into any code you will find complexity.

Code with fewer lines is not always simple code. Fewer lines of code often indicate an abstraction. Abstractions are not inherently simple; they create the illusion of simplicity. They don’t remove complexity—they hide it.

Every backend is a frontend; consuming some other backend. Of course there are “leaf” backends that receive commands but don’t talk to anything else.

kernel SYN retransmission timeout has increased. This is driving me to read about the default configs for the various kernels github.com/torvalds/lin...

99% of latency issues are caused by the user app logic. App logic here includes libraries and frameworks used by the app. Sometimes however, the 1% could be the kernel. Here is one example where a config to TCP can improve backend and frontend network latency.