Reborn in 2000, starting from the university website
Chapter 36 Developing Compression Algorithms
In the New Century Internet Cafe, the private room occupied by Qihang Company was filled only with the buzzing of the computer case fans and the occasional cough.
Bai Yuhang opened his black leather notebook and placed it next to the keyboard, glancing at it every now and then. It was densely covered with his thoughts and plans from the months since his rebirth.
For the past three months, besides earning living expenses, attending classes, eating, and sleeping, he has been constantly thinking about what he can do now that he has been reborn. He has thought about search engines, social media, e-commerce platforms, and online games countless times. These words have popped into his head so many times, but none of them are realistic.
He stared at the screen, his hands never stopping, and he ruthlessly sliced up the server's 500GB hard drive.
"Sixth Brother, 400? Isn't that a bit excessive?" Zhang Jian leaned closer, looking at the partitioning operation on the screen. "You're allocating all 400GB to the music site for caching? What if the system service crashes one day? I'm afraid there won't even be enough space for the logs."
"The system won't crash unless there are physical bad sectors on the hard drive." Bai Yuhang didn't even turn his head as he typed a line of commands on the keyboard, and a row of green characters instantly appeared on the screen. "And this time we won't use the web server setup method taught by our school teachers."
"Not IIS?" Zhang Qingheng, who was engrossed in reading "ASP Dynamic Web Page Design," snapped the book shut upon hearing this. "Then what should we use? This is a legitimate commercial website; we can't possibly use Microsoft's personal version of PWS, can we?"
Bai Yuhang pulled a disc without any label from the CD case, inserted it into the CD player, and the squeaking sound during reading was particularly jarring in the quiet private room.
"Use this." Bai Yuhang pointed to the installation interface that popped up on the screen, "Nginx, with PHP and MySQL."
Zhang Jian was stunned by the three unfamiliar words. He scratched his greasy hair, which hadn't been washed for days: "What is this? I've never seen this before. It's not in the textbook."
"If it's written in the textbooks, what's the point of us playing? The stuff in our books is already outdated by the time it's written in them. They've been reviewed and reprinted so many times, it's hard for teachers to come up with anything new." Bai Yuhang casually explained while configuring environment variables, "I got Nginx from a Russian guy on ICQ, it's still in the testing phase. Just think of it as a low-memory, but incredibly resilient IIS. Microsoft's IIS plus ASP is for big companies, it's too fussy. When there are a lot of visitors, the server CPU spikes to 100%, it might even crash, and you have to crazily increase server resources. Our small business is just starting out, we need something this robust."
"What about the database? Can't we use Access?" Zhang Qingheng asked in a low voice. He had recently learned how to create tables and indexes using Access.
"Access is fine for storing our class contact list. But we're building a nationwide music website with tens of thousands, even hundreds of thousands of songs. If we used Access, the time it would take to look up just one song would be enough for half a meal." Bai Yuhang brought up the black-and-white interface of MySQL. "SQL Server would work, but a legitimate license costs over two thousand yuan per CPU core. Now that we have MySQL, there's no need for that. Where are we going to get the money to send a donation to Bill Gates?"
Upon hearing that a CPU license cost "two thousand yuan," everyone in the room fell silent. Two thousand yuan is still a huge sum of money these days.
"This MySQL was developed by Swedes; it's free and open-source. Even if we have ten million users in the future, with some optimization, it can still run." Bai Yuhang typed the last line of configuration code and pressed Enter.
The screen flickered and entered the server system. The familiar Windows remote control window interface was gone, replaced by lines of command lines jumping around.
"That's... all done?" Zhang Jian stared in disbelief at the rudimentary, even somewhat shabby, interface. "There's not even a graphical interface. Can this really work?"
"Give it a try." Bai Yuhang asked Zhang Jian to upload the scraping script that he and Wan Lianghao had just tested.
Scripts that used to stumble and frequently throw errors in the IIS environment now run like they've taken a laxative in this new environment, with their progress bars rising rapidly.
"Holy crap!" Zhang Jian couldn't help but curse, almost pressing his face against the monitor. "This speed? What kind of amazing language is PHP? It's so much faster than ASP?"
"It's not that the language is fast, it's that the architecture is lightweight." Bai Yuhang didn't explain much; he knew what this "golden combination" meant in later generations. It was an iron wall that had withstood Singles' Day shopping festivals and the Spring Festival ticket rush. In 2000, dealing with this amount of traffic was like using a Gatling gun to kill a mosquito.
"Alright, stop lamenting. Third brother, I've given you all the corresponding administrator privileges. From now on, don't be silly and manually sort the songs; use a static page. I've written a trigger in the database. Every time a user clicks to download, the popularity column will automatically increment by one. The website's initial charts will refresh automatically every half hour."
Zhang Qingheng nodded in agreement, his stubby pen flying across the notebook.
Just as he was getting the server setup sorted out, Bai Yuhang frowned again. He stared at the bandwidth monitoring graph of his machine; the red test curve had already reached the ceiling.
"Personal computer bandwidth is still too small." Bai Yuhang lit a cigarette, looking at the straight line. "We're using a dedicated line from an internet cafe and it's still so slow. Nowadays, most home users have 56K dial-up modems. Our server has dedicated bandwidth, which is enough, but the users' connections are too limited. If thousands of people are downloading at the same time, this 400GB cache is useless; it will all be stuck in the transmission."
"Then what should we do? We can't just go and install fiber optic cables and dedicated lines for users' homes," Wan Lianghao said, shrugging.
"If you can't install fiber optics, then make things smaller." Bai Yuhang muttered, a cigarette dangling from his lips, as he pulled his chair closer and created a new C++ source file.
"Make it smaller? MP3 is already a compressed format. If you compress it any further, it will become electronic sound, which will sound like random squeaking." Zhang Jian knew what he was talking about; there are limits to audio compression.
"That was before." Bai Yuhang didn't even lift his eyelids, his hands on the keyboard, pausing for two seconds.
In my mind, the logic of the RAISR algorithm, which Google wouldn't release until 2016, clearly emerged from my notebook.
Of course, given the current hardware limitations, simply copying it won't work; we need to simplify and adapt it to the actual situation.
"Watch closely."
"The basic logic is that I need to break a compressed file into multiple parts before compressing it, which will greatly reduce the file size. The download request will also download the compressed parts simultaneously, speeding up the download process."
The sound of keyboards suddenly rang out, as dense as a downpour hitting a tin roof.
Bai Yuhang remained silent, his posture unchanged. The complex mathematical functions on the screen were broken down into lines of code: bilinear interpolation, hash bucket classification, residual learning…
Zhang Jian initially wanted to check the logic, but gave up after five minutes. He turned to look at Wan Lianghao and found that the fourth brother also had a "Who am I? Where am I?" expression.
This isn't just writing code; this is using code to solve math problems.
Two hours.
No one dared to make a sound in the private room, and they even drank water very carefully.
It wasn't until Bai Yuhang typed the last semicolon and pressed the compiler's F5 key heavily that the code was compiled.
"Zero errors, zero warnings. Successful!"
Bai Yuhang let out a long breath, stubbed out the cigarette butt that had burned down to the filter, and felt his fingers burning.
"Let's try a song."
Zhang Jian quickly found the file he had just downloaded, "Thank You for Your Love 1999," which was 4.5MB in size.
Drag it into the program and run it.
The progress bar flashed by in an instant.
New file generated: 1.1MB.
"More than half of it was compressed?" Zhang Jian's throat was a little dry. "Is this even listenable?"
"Streaming online is definitely no problem. After downloading, transcoding, and reassembling, restoring the original size, online listening won't affect the quality; it will only be faster."
Nicholas Tse's signature voice came from the speakers, the guitar strumming was crisp, and the drumbeats were steady. Compared to the original high-bitrate version, there was no difference in sound quality.
The private room was deathly silent.
After a long pause, Wan Lianghao stammered, "Sixth Brother... what's going on in your head? This algorithm... did that Russian guy teach you that too?"
Bai Yuhang rubbed his sore neck, stood up and stretched, ignoring the previous comment, and simply pointed to the screen: "Encapsulate this algorithm into the download and online playback modules. When a user clicks download, the server transcodes it in real time. This way, the bandwidth that could originally support one person's download can now support four or five people, and the website's dedicated bandwidth can support tens of thousands of people downloading and accessing simultaneously."
Zhang Jian stared at the six-megabyte algorithm core file as if it were a monster, finally blurting out, "This isn't writing code, it's like you've stretched this thin network cable into an eight-lane highway. Lao Liu, if you sold this, it'd probably be worth more than an entire top software company in Beijing."
"Why sell it? Keep it for your own benefit." Bai Yuhang picked up the now-cold boxed lunch on the table, shoveled a couple of bites, and said, "Get to work. With this, I think all the music websites on the internet have nothing to compete with us in terms of speed."
You'll Also Like
-
The transmigrated villain wants to escape Feng Aotian's hellish situation.
Chapter 365 3 minute ago -
In music anime, band girls won't be alone.
Chapter 192 3 minute ago -
No kidding, even Rocks would have to offer me a cigarette.
Chapter 137 3 minute ago -
My anime-style card deck is fine!
Chapter 304 3 minute ago -
Practical teaching, all I want is your reward.
Chapter 251 3 minute ago -
I'm on the Ark, and I start out as Gretchen.
Chapter 272 3 minute ago -
If you're going on a blind date, do it properly, don't confiscate my property!
Chapter 43 3 minute ago -
Surviving in the chaos of battle, I'm grinding for proficiency.
Chapter 105 3 minute ago -
Reborn in 2000, starting from the university website
Chapter 118 3 minute ago -
Li Zhuiyuan, a corpse retriever, travels through a mysterious resurrection.
Chapter 83 3 minute ago