Subj : Discord’s websocket boost 🚀, nobody builds in public 📣, devs are unhappy ☹️ To : tldr@synchro.net From : TLDR Web Dev Date : Mon Sep 23 2024 11:21:18 --DTGXbcf3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Discord reduced its websocket traffic by 40% through two key optimization= s. It first replaced its existing compression algorithm, zlib, with zstan= dard=C2=A0=20 Sign Up [1] |Advertise [2]|View Online [3]=20 =09=09TL= DR=20 =09=09TOGETHER WITH [Clerk] [4] =C2=A0TLDR WEB DEV 2024-09-23= BUILDING SESSION MANAGEMENT IN NEXT.JS FROM SCRATCH: HOW TO KEEP YOU= R USERS LOGGED IN (SPONSOR) [4]=20 Session management is a concept th= at flies under the radar in most applications, but it has a crucial role = to play: keeping users securely logged in when they use different tabs or= devices (imagine life without that!). Because session management is= often abstracted away by auth libraries, many developers are fuzzy about= the details. How do you actually know where a session starts, and when i= t ends? In this blog post, the Clerk team details the step-by-step pro= cess of building session management in Next.js [4], without using any a= uthentication library. Read [5] the blog [4] to understand what's happeni= ng under the hood! =F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20 ARTICLES & = TUTORIALS HOW DISCORD REDUCED WEBSOCKET TRAFFIC BY 40% (17 MINUTE REA= D) [6]=20 Discord reduced its websocket traffic by 40% through two key= optimizations. Firstly, it replaced its existing compression algorithm= , zlib, with zstandard, achieving higher compression ratios and shorter c= ompression times. It further improved performance by implementing streami= ng compression for zstandard, allowing it to utilize historical data for = better compression of small payloads. Secondly, it introduced Passive Ses= sions v2, which only sends updates about changes in server information in= stead of sending complete snapshots.=20 ONE YEAR OF RUST IN PRODUCTIO= N (10 MINUTE READ) [7]=20 This developer found that Rust's type-safety = and compile-time checks led to a smooth transition to production without = major issues. After a year, they reflect back on how it's going. They fin= d that Rust's long compile times, particularly with macro-heavy libraries= , necessitate a different development workflow. At the same time, Rust is= still satisfying to use and will continue to be used in production.=20 = GAINING ACCESS TO ANYONE'S BROWSER WITHOUT THEM EVEN VISITING A WEBSI= TE (7 MINUTE READ) [8]=20 A vulnerability in Arc Browser's use of Fireb= ase allowed unauthorized access to any user's browser without them visiti= ng a website. This was possible because Arc's cloud features, like Boosts= , stored data in Firestore with insecure security rules. An attacker coul= d exploit this by obtaining a user's ID, creating a malicious Boost, and = changing the Boost's creator ID to the victim's. This has since been addr= essed by Arc, who patched the vulnerability, added a feature to disable B= oosts, and started a bug bounty program.=20 =F0=9F=A7=A0=20 OPINION= S & ADVICE NO ONE BUILDS IN PUBLIC (5 MINUTE READ) [9]=20 The "bu= ild in public" trend within the indie hacker community has an over-relian= ce on sharing revenue figures. While initially attention-grabbing, the co= nstant stream of success stories may be losing its impact and overshadowi= ng the discussion of actual product development. Also, the "build in publ= ic" approach may not be necessary for success, as some prominent indie ha= ckers have achieved great results without actively sharing their progress= publicly.=20 A NEW ERA OF WRITING CODE (5 MINUTE READ) [10]=20 LLM= s can significantly speed up development by taking care of repetitive tas= ks, but they still have limitations, especially when dealing with complex= or open-ended features. While LLMs can't replace engineers entirely, the= y can help them to focus on higher-level tasks. 80% OF DEVELOPERS = ARE UNHAPPY. THE PROBLEM IS NOT AI, NOR IS CODING (5 MINUTE READ) [11] = A recent Stack Overflow survey revealed that 80% of developers are= unhappy with their jobs, with many reporting feeling burnt out and dem= oralized. The primary culprit appears to be a combination of factors, inc= luding unrealistic expectations, technical debt, bureaucratic obstacles, = and a lack of work-life balance.=20 =F0=9F=9A=80=20 LAUNCHES & TOOLS= IMPROVE WEB PERFORMANCE BY OPTIMIZING JAVASCRIPT BUNDLE SIZES (SPO= NSOR) [12]=20 Nobody likes slow front end response =E2=80=93 not you, y= our users, or search engines. Learn how to get ahead of bloated JavaScrip= t bundles and improve your web performance in this blog. Read more on the= Sentry blog [12]=20 KAMAL PROXY (GITHUB REPO) [13]=20 Kamal Prox= y is an HTTP proxy that makes it easy to coordinate zero-downtime deploym= ents. It can deploy changes to web applications without interrupting any = of the traffic in progress.=20 SCALAR (GITHUB REPO) [14]=20 Scalar = is an offline-first API client and interactive reference generator. It us= es OpenAPI/Swagger documents to create user-friendly documentation and AP= I clients for various languages and frameworks.=20 CSS PEEPER (CHROME E= XTENSION) [15]=20 CSS Peeper is a Chrome extension that allows designer= s to easily view and inspect CSS styles on any website. It allows for bro= wsing components and colors in a visual way.=20 =F0=9F=8E=81=20 MIS= CELLANEOUS FORGET CHATGPT: WHY RESEARCHERS NOW RUN SMALL AIS ON THEIR= LAPTOPS (9 MINUTE READ) [16]=20 Researchers are increasingly choosin= g to run smaller AI models on their laptops instead of relying on online = services like ChatGPT. This shift is driven by the availability of open-s= ource AI models and the development of smaller models that can run effici= ently on consumer hardware.=20 THE SORRY STATE OF JAVA DESERIALIZATIO= N (12 MINUTE READ) [17]=20 Java deserialization is surprisingly slow. T= his developer benchmarks various techniques for reading 1 billion rows of= data from disk, including using `DataInputStream`, JDBC, Protobuf, Parqu= et, and custom solutions. The results show that even with optimized custo= m implementations, Java's performance lags significantly behind the the= oretical maximum for disk I/O.=20 ANALYZING THE OPENAPI TOOLING ECOSYST= EM (14 MINUTE READ) [18]=20 This is an exploration of the OpenAPI Speci= fication (OAS) tooling ecosystem that visually diagrams the various tasks= tools perform and how they relate to each other. The tools are separated= into three areas: Parsing libraries, OAD tools, and API tools.=20 = =E2=9A=A1=20 QUICK LINKS SANDING UI (4 MINUTE READ) [19]=20 = =E2=80=9CSanding UI=E2=80=9D involves repeatedly clicking and interacting w= ith a user interface to identify and fix subtle usability issues.=20 = WRITE CHANGE-RESILIENT CODE WITH DOMAIN OBJECTS (3 MINUTE READ) [20]=20 = By using domain objects that represent the fundamental ideas of a produc= t, rather than specific requirements, code becomes more resilient to chan= ges in those requirements.=20 HOW I HIRE PROGRAMMERS (6 MINUTE READ) [2= 1]=20 A better programmer hiring process focuses on evaluating candidat= es' past work, conversational intelligence, and compatibility with the = team rather than traditional interviews like Leetcode questions.=20 I L= IKE MAKEFILES (5 MINUTE READ) [22]=20 This developer prefers using Make= files for project automation due to their simplicity, consistency across = projects, and compatibility with various build tools.=20 Love TLDR? Te= ll your friends and get rewards! Share your referral link below with = friends to get free TLDR swag!=20 https://refer.tldr.tech/363c65bf/3 [2= 3]=20 =09=09 Track your referrals here. [24]=20 Want to advertise in = TLDR? =F0=9F=93=B0 If your company is interested in reaching an audie= nce of web developers and engineering decision makers, you may want to AD= VERTISE WITH US [25].=20 If you have any comments or feedback, just r= espond to this email!=20 Thanks for reading,=20 Priyam Mohanty, Jenny Xu= & Ceora Ford=20 If you don't want to receive future editions of TLDR We= b Dev, please unsubscribe from TLDR Web Dev [26] or manage all of your TL= DR newsletter subscriptions [27].=20 =20 Links: ------ [1] http= s://tldr.tech/webdev?utm_source=3Dtldrwebdev [2] https://advertise.tldr.t= ech/?utm_source=3Dtldrwebdev&utm_medium=3Dnewsletter&utm_campaign=3Dadverti= setopnav [3] https://a.tldrnewsletter.com/web-version?ep=3D1&lc=3Ddf5a9a8= 4-734c-11ef-ae5c-1145880928d7&p=3D69b24446-7985-11ef-a20b-85db7d9d6075&pt= =3Dcampaign&t=3D1727090478&s=3D780e650ba0d5e0cdb7d278b3834dbd7aa83bde214f2f= 550c1d788a1db89b7186 [4] https://go.clerk.com/dykM8q7 [5] https://clerk= ..com/blog/complete-guide-session-management-nextjs [6] https://discord.co= m/blog/how-discord-reduced-websocket-traffic-by-40-percent?utm_source=3Dtld= rwebdev [7] https://yieldcode.blog/post/one-year-of-rust-in-production/?u= tm_source=3Dtldrwebdev [8] https://kibty.town/blog/arc/?utm_source=3Dtldr= webdev [9] https://laike9m.com/blog/no-one-builds-in-public,160/?utm_sour= ce=3Dtldrwebdev [10] https://www.developing.dev/p/a-new-era-of-writing-co= de?utm_source=3Dtldrwebdev [11] https://shiftmag.dev/unhappy-developers-s= tack-overflow-survey-3896/?utm_source=3Dtldrwebdev [12] https://about.cod= ecov.io/blog/improve-web-performance-by-optimizing-javascript-bundle-sizes/= ?utm_source=3Dtldr&utm_medium=3Dpaid-community&utm_campaign=3Dcodecov-fy25q= 2-bundleanalysis&utm_content=3Dnewsletter-bundleblog-read [13] https://gi= thub.com/basecamp/kamal-proxy?utm_source=3Dtldrwebdev [14] https://github= ..com/scalar/scalar?utm_source=3Dtldrwebdev [15] https://chromewebstore.go= ogle.com/detail/css-peeper/mbnbehikldjhnfehhnaidhjhoofhpehk?utm_source=3Dtl= drwebdev [16] https://www.nature.com/articles/d41586-024-02998-y?utm_sour= ce=3Dtldrwebdev [17] https://www.marginalia.nu/log/a_110_java_io/?utm_sou= rce=3Dtldrwebdev [18] https://modern-json-schema.com/analyzing-the-openap= i-tooling-ecosystem?utm_source=3Dtldrwebdev [19] https://blog.jim-nielsen= ..com/2024/sanding-ui/?utm_source=3Dtldrwebdev [20] https://testing.google= blog.com/2024/09/write-change-resilient-code-with-domain.html?utm_source=3D= tldrwebdev [21] http://www.aaronsw.com/weblog/hiring.en?utm_source=3Dtldr= webdev [22] https://switowski.com/blog/i-like-makefiles/?utm_source=3Dtld= rwebdev [23] https://refer.tldr.tech/363c65bf/3 [24] https://hub.sparkl= p.co/sub_c9fe76197514/3 [25] https://advertise.tldr.tech/?utm_source=3Dtl= drwebdev&utm_medium=3Dnewsletter&utm_campaign=3Dadvertisecta [26] https:/= /a.tldrnewsletter.com/unsubscribe?ep=3D1&l=3De8d201ca-3e93-11ed-9a32-0241b9= 615763&lc=3Ddf5a9a84-734c-11ef-ae5c-1145880928d7&p=3D69b24446-7985-11ef-a20= b-85db7d9d6075&pt=3Dcampaign&pv=3D4&spa=3D1727089238&t=3D1727090478&s=3D55b= 09d5ba91bca2ea23c734fc86e3f4fcb102e5a50b2cc86e8972e3bdc767e4c [27] https:= //tldr.tech/webdev/manage?email=3Dtldr%40synchro.net --DTGXbcf3 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable TLDR WebDev
Discord reduced its websocket traffic by 40% through two key optimizatio= ns. It first replaced its existing compression algorithm, zlib, with zstand= ard 

TLDR

Together With 3D"Clerk"

 TLDR Web Dev 2024-09-23=

Building session management= in Next.js from scratch: how to keep your users logged in (Sponsor)

Session management is a concept that fl= ies under the radar in most applications, but it has a crucial role to play= : keeping users securely logged in when they use different tabs or devices = (imagine life without that!).

Because session management is often = abstracted away by auth libraries, many developers are fuzzy about the deta= ils. How do you actually know where a session starts, and when it ends?

=

In this blog post, the Clerk team details the step-by-step process of building session management in Next.js, without using any authentication library. Read the blog to understand what's happe= ning under the hood!

=F0=9F= =A7=91=E2=80=8D=F0=9F=92=BB

Articles & Tutorials

How Discord Reduced Websock= et Traffic by 40% (17 minute read)

Discord reduced its websocket traffic b= y 40% through two key optimizations. Firstly, it replaced its existing comp= ression algorithm, zlib, with zstandard, achieving higher compression ratio= s and shorter compression times. It further improved performance by impleme= nting streaming compression for zstandard, allowing it to utilize historica= l data for better compression of small payloads. Secondly, it introduced Pa= ssive Sessions v2, which only sends updates about changes in server informa= tion instead of sending complete snapshots.
One year of Rust in product= ion (10 minute read)

This developer found that Rust's type-s= afety and compile-time checks led to a smooth transition to production with= out major issues. After a year, they reflect back on how it's going. They f= ind that Rust's long compile times, particularly with macro-heavy libraries= , necessitate a different development workflow. At the same time, Rust is s= till satisfying to use and will continue to be used in production.
Gaining access to anyone's = browser without them even visiting a website (7 minute read)

A vulnerability in Arc Browser's use of= Firebase allowed unauthorized access to any user's browser without them vi= siting a website. This was possible because Arc's cloud features, like Boos= ts, stored data in Firestore with insecure security rules. An attacker coul= d exploit this by obtaining a user's ID, creating a malicious Boost, and ch= anging the Boost's creator ID to the victim's. This has since been addresse= d by Arc, who patched the vulnerability, added a feature to disable Boosts,= and started a bug bounty program.
=F0=9F= =A7=A0

Opinions & Advice

No One Builds in Public (5 = minute read)

The "build in public" trend within the = indie hacker community has an over-reliance on sharing revenue figures. Whi= le initially attention-grabbing, the constant stream of success stories may= be losing its impact and overshadowing the discussion of actual product de= velopment. Also, the "build in public" approach may not be necessary for su= ccess, as some prominent indie hackers have achieved great results without = actively sharing their progress publicly.
A New Era of Writing Code (= 5 minute read)

LLMs can significantly speed up develop= ment by taking care of repetitive tasks, but they still have limitations, e= specially when dealing with complex or open-ended features. While LLMs can'= t replace engineers entirely, they can help them to focus on higher-level t= asks.
80% of developers are unhap= py. The problem is not AI, nor is coding (5 minute read)

A recent Stack Overflow survey revealed= that 80% of developers are unhappy with their jobs, with many reporting fe= eling burnt out and demoralized. The primary culprit appears to be a combin= ation of factors, including unrealistic expectations, technical debt, burea= ucratic obstacles, and a lack of work-life balance.
=F0=9F= =9A=80

Launches & Tools

Improve Web Performance by = Optimizing JavaScript Bundle Sizes (Sponsor)

Nobody likes slow front end response = =E2=80=93 not you, your users, or search engines. Learn how to get ahead of= bloated JavaScript bundles and improve your web performance in this blog. = Read more on the Sentry blog
Kamal Proxy (GitHub Repo)

Kamal Proxy is an HTTP proxy that makes= it easy to coordinate zero-downtime deployments. It can deploy changes to = web applications without interrupting any of the traffic in progress.
Scalar (GitHub Repo)

Scalar is an offline-first API client a= nd interactive reference generator. It uses OpenAPI/Swagger documents to cr= eate user-friendly documentation and API clients for various languages and = frameworks.
CSS Peeper (Chrome Extensio= n)

CSS Peeper is a Chrome extension that a= llows designers to easily view and inspect CSS styles on any website. It al= lows for browsing components and colors in a visual way.
=F0=9F= =8E=81

Miscellaneous

<= /div>
Forget ChatGPT: why researc= hers now run small AIs on their laptops (9 minute read)

Researchers are increasingly choosing t= o run smaller AI models on their laptops instead of relying on online servi= ces like ChatGPT. This shift is driven by the availability of open-source A= I models and the development of smaller models that can run efficiently on = consumer hardware.
The sorry state of Java des= erialization (12 minute read)

Java deserialization is surprisingly sl= ow. This developer benchmarks various techniques for reading 1 billion rows= of data from disk, including using `DataInputStream`, JDBC, Protobuf, Parq= uet, and custom solutions. The results show that even with optimized custom= implementations, Java's performance lags significantly behind the theoreti= cal maximum for disk I/O.
Analyzing the OpenAPI Tooli= ng Ecosystem (14 minute read)

This is an exploration of the OpenAPI S= pecification (OAS) tooling ecosystem that visually diagrams the various tas= ks tools perform and how they relate to each other. The tools are separated= into three areas: Parsing libraries, OAD tools, and API tools.
=E2=9A= =A1

Quick Links

Sanding UI (4 minute read)<= /strong>

=E2=80=9CSanding UI=E2=80=9D involves r= epeatedly clicking and interacting with a user interface to identify and fi= x subtle usability issues.
Write Change-Resilient Code= With Domain Objects (3 minute read)

By using domain objects that represent = the fundamental ideas of a product, rather than specific requirements, code= becomes more resilient to changes in those requirements.
How I Hire Programmers (6 m= inute read)

A better programmer hiring process focu= ses on evaluating candidates' past work, conversational intelligence, and c= ompatibility with the team rather than traditional interviews like Leetcode= questions.
I Like Makefiles (5 minute = read)

This developer prefers using Makefiles = for project automation due to their simplicity, consistency across projects= , and compatibility with various build tools.

Love TLDR? Tell your friends and get rewards!

Share your referral link below with friends to get free TLDR swag!
Track your referrals here.

Want to advertise in TLDR? =F0=9F=93=B0

If your company is interested in reaching an audience of web developers and= engineering decision makers, you may want to advertise with us= .

If you have any comments or feedback, just respond to this email!

Thanks for reading,
Priyam Mohanty, Jenny Xu & Ceora Ford


If you don't want to receive fu= ture editions of TLDR Web Dev, please un= subscribe from TLDR Web Dev or manage all of your TLDR newsl= etter subscriptions.
3D"" --DTGXbcf3-- --- ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net .