DEV Community

Discussion on: Modern Full-Stack Developer Tech Stack 2021

Collapse
 
cubiclesocial profile image
cubiclesocial

The backends listed are extremely limited and not actually part of reality.

Whether or not anyone wants to admit it, market share is an important factor in deciding what is "modern." Relevant reality check: kinsta.com/php-market-share/

Modern software/web development should be ultra-light on system resources. Partly because it saves money but also because it saves the environment from needless waste. NodeJS is a massive memory and resource hog - about 150MB RAM per instance + many, many seconds of CPU and disk I/O to spin up and that's before it does anything vs PHP which is about 13MB RAM per PHP FPM invocation and most of that in shared libraries and starts instantly. NodeJS is 10x as heavy on critical system resources compared to PHP so you need approximately 10 times the amount of hardware and therefore 10 times the cost. Your local bean counter in Finance would look at the strict cost numbers and tell you to write PHP whether you like it or not. Facebook runs on a modified version of PHP known as HHVM - if NodeJS were better, they'd be using it...but their engineers know better. Firing up a Javascript engine is expensive and that software doesn't run as well as you think it does. V8 is pretty efficient for Javascript, but it's still Javascript - a not great language.

On the database side of things, MySQL/MariaDB are still relevant and powerful relational database backends. However, even SQLite is more than good enough for most websites. SQLite paired with a custom-built arbitration TCP/IP server in PHP can vastly outperform a more traditional LAMP/LIMP stack (I've done that myself to significant effect). And for sheer performance, nothing beats ANSI C/C++ or even Assembly language. Although in a web environment, writing C/C++ is probably a bad idea at best, so Rust comes in handy to offer at least a seatbelt between you and the windshield.

On a related note and to show that I know what I'm talking about with regards to language performance: I wrote a C++ program about 3 years ago that took live dispatches from the local fire department from an attached radio, recorded and generated MP3 files of each audio snippet, and shoved the result out onto a web server...because even PHP and Python weren't fast enough to process the incoming audio data - on a Raspberry Pi 3. That is, even the smallest loop in the fastest scripting languages were still too slow to handle basic analysis of the incoming realtime audio data feed! In addition, the C++ program ran at a nice cool 1% CPU (spiking to about 5% when processing detected dispatches) while PHP and Python where chugging 100% CPU the entire time and literally unable to keep up with the data feed. I can't even imagine what a NodeJS version would have looked like. It probably wouldn't have even started running in a reasonable amount of time and therefore missed entire dispatches let alone keep up with PHP, which had slightly better throughput compared to Python. Granted, the Raspberry Pi is seriously underpowered hardware, but the point is that no scripting language in existence can handle super basic realtime audio processing on the Pi and, for anyone reading this, that knowledge and reality scales up to production environments. Sometimes you need to pull out a compiled language or write specialized software for a specific task but, apart from that, we as devs should be responsible with system resources as we write software. I'm NOT saying everyone should give up on scripting languages. They have obvious benefits like having defenses against a garden variety of attacks built into them. But scripting languages don't perform as well as you might think and the decision to use a NodeJS backend (and Docker too) requires either a lot of prior bad decisions or at least a distinct lack of knowledge of how computer systems are designed.