Hands-On Introduction to Unikernels
https://www.reddit.com/r/programming/comments/1qef1xn/handson_introduction_to_unikernels/
submitted by /u/iximiuz (https://www.reddit.com/user/iximiuz)
[link] (https://labs.iximiuz.com/tutorials/unikernels-intro-93976514) [comments] (https://www.reddit.com/r/programming/comments/1qef1xn/handson_introduction_to_unikernels/)
https://www.reddit.com/r/programming/comments/1qef1xn/handson_introduction_to_unikernels/
submitted by /u/iximiuz (https://www.reddit.com/user/iximiuz)
[link] (https://labs.iximiuz.com/tutorials/unikernels-intro-93976514) [comments] (https://www.reddit.com/r/programming/comments/1qef1xn/handson_introduction_to_unikernels/)
How ClickHouse handles strings
https://www.reddit.com/r/programming/comments/1qef2lv/how_clickhouse_handles_strings/
submitted by /u/f311a (https://www.reddit.com/user/f311a)
[link] (https://rushter.com/blog/clickhouse-strings/) [comments] (https://www.reddit.com/r/programming/comments/1qef2lv/how_clickhouse_handles_strings/)
https://www.reddit.com/r/programming/comments/1qef2lv/how_clickhouse_handles_strings/
submitted by /u/f311a (https://www.reddit.com/user/f311a)
[link] (https://rushter.com/blog/clickhouse-strings/) [comments] (https://www.reddit.com/r/programming/comments/1qef2lv/how_clickhouse_handles_strings/)
The way I run standup meetings by Marc G Gauthier
https://www.reddit.com/r/programming/comments/1qegncf/the_way_i_run_standup_meetings_by_marc_g_gauthier/
submitted by /u/RevillWeb (https://www.reddit.com/user/RevillWeb)
[link] (https://marcgg.com/blog/2024/11/20/standup/) [comments] (https://www.reddit.com/r/programming/comments/1qegncf/the_way_i_run_standup_meetings_by_marc_g_gauthier/)
https://www.reddit.com/r/programming/comments/1qegncf/the_way_i_run_standup_meetings_by_marc_g_gauthier/
submitted by /u/RevillWeb (https://www.reddit.com/user/RevillWeb)
[link] (https://marcgg.com/blog/2024/11/20/standup/) [comments] (https://www.reddit.com/r/programming/comments/1qegncf/the_way_i_run_standup_meetings_by_marc_g_gauthier/)
If You Have Ever Seen Beautiful CGI Simulations Of Realistic Flocking Behaviour With Birds, You Might Wonder How It Is Done - This Is How:
https://www.reddit.com/r/programming/comments/1qeho0v/if_you_have_ever_seen_beautiful_cgi_simulations/
<!-- SC_OFF -->The fundamental premise is that flocking is a bottom-up phenomenon, which emerges almost magically from a few simple rules. Once the rules are found and tested, the programmer can create a model of them in code which he, or she will execute to test that it works. This model is then handed to a graphic artist that can then take this model to drive graphics software to draw it on screen. Modern graphics processors, as you have seen, can create strikingly realistic, jaw-dropping images. Sure, the artist may be talented, but the real credit goes to the person who created the model. I am not trying to diminish the creativity, or imagination of the artist. In our case, the wizard behind the model of flocking behaviour was a young man named Craig Reynolds, who discovered a few simple rules in 1986. Look him up. Here are Reynold’s rules: Rule 1: Steer to avoid collisions. This is a repulsive force. It ensures that the birds do not collide. Each bird maintains a small protected zone around itself. If another bird enters this zone, then the bird steers in the opposite direction. Rule 2: Steer towards the average heading of local flockmates. The bird looks at the velocity (speed + direction) of its neighbours and tries to match it. This behaviour gives the flock its “flow” and prevents individuals from scattering in different directions. Rule 3: Steer to move toward the average position (centre of mass) of local flock mates. This makes the bird want to be in the middle of the group it can see. It prevents individuals from drifting off into isolation, ensuring the group remains a "flock" rather than a collection of independent actors. There is a subtle but vital detail in Reynold’s logic: Reynolds specified that individual birds don’t see the whole flock; they only see what is nearby. This is why a flock can split around buildings and other obstacles and rejoin as a group. If you are not a programmer, stop reading here. Programmers will probably want an example of how these simple rules are actually coded. Here is my implementation, written in pseudo-code, because I am language agnostic. Note that Reynolds called the birds “Boids” to differentiate them from real birds: // Calculate the three forces for a single Boid 'b' PROCEDURE calculate_forces(boid b, flock): Vector separation_force = [0, 0] Vector alignment_avg_vel = [0, 0] Vector cohesion_avg_pos = [0, 0] int neighbor_count = 0 FOR EACH boid neighbor IN flock: IF neighbor != b AND distance(b, neighbor) < VISUAL_RADIUS: neighbor_count++ // Rule 1: Separation (Vector points AWAY from neighbor) IF distance(b, neighbor) < PROTECTED_RANGE: separation_force += (b.position - neighbor.position) // Rule 2: Alignment (Accumulate velocities) alignment_avg_vel += neighbor.velocity // Rule 3: Cohesion (Accumulate positions) cohesion_avg_pos += neighbor.position IF neighbor_count > 0: // Finalize Alignment: Average the velocity and steer toward it alignment_avg_vel /= neighbor_count alignment_force = (alignment_avg_vel - b.velocity) * ALIGN_WEIGHT // Finalize Cohesion: Find center of mass and steer toward it cohesion_avg_pos /= neighbor_count cohesion_force = (cohesion_avg_pos - b.position) * COHESION_WEIGHT // Finalize Separation: Scale the repulsion separation_force *= SEPARATE_WEIGHT RETURN separation_force + alignment_force + cohesion_force If you’d like to find Craig then he can be found on the Internet here: http://www.red3d.com/cwr/ As you can see, his presence is very understated. <!-- SC_ON --> submitted by /u/MarioGianota (https://www.reddit.com/user/MarioGianota)
https://www.reddit.com/r/programming/comments/1qeho0v/if_you_have_ever_seen_beautiful_cgi_simulations/
<!-- SC_OFF -->The fundamental premise is that flocking is a bottom-up phenomenon, which emerges almost magically from a few simple rules. Once the rules are found and tested, the programmer can create a model of them in code which he, or she will execute to test that it works. This model is then handed to a graphic artist that can then take this model to drive graphics software to draw it on screen. Modern graphics processors, as you have seen, can create strikingly realistic, jaw-dropping images. Sure, the artist may be talented, but the real credit goes to the person who created the model. I am not trying to diminish the creativity, or imagination of the artist. In our case, the wizard behind the model of flocking behaviour was a young man named Craig Reynolds, who discovered a few simple rules in 1986. Look him up. Here are Reynold’s rules: Rule 1: Steer to avoid collisions. This is a repulsive force. It ensures that the birds do not collide. Each bird maintains a small protected zone around itself. If another bird enters this zone, then the bird steers in the opposite direction. Rule 2: Steer towards the average heading of local flockmates. The bird looks at the velocity (speed + direction) of its neighbours and tries to match it. This behaviour gives the flock its “flow” and prevents individuals from scattering in different directions. Rule 3: Steer to move toward the average position (centre of mass) of local flock mates. This makes the bird want to be in the middle of the group it can see. It prevents individuals from drifting off into isolation, ensuring the group remains a "flock" rather than a collection of independent actors. There is a subtle but vital detail in Reynold’s logic: Reynolds specified that individual birds don’t see the whole flock; they only see what is nearby. This is why a flock can split around buildings and other obstacles and rejoin as a group. If you are not a programmer, stop reading here. Programmers will probably want an example of how these simple rules are actually coded. Here is my implementation, written in pseudo-code, because I am language agnostic. Note that Reynolds called the birds “Boids” to differentiate them from real birds: // Calculate the three forces for a single Boid 'b' PROCEDURE calculate_forces(boid b, flock): Vector separation_force = [0, 0] Vector alignment_avg_vel = [0, 0] Vector cohesion_avg_pos = [0, 0] int neighbor_count = 0 FOR EACH boid neighbor IN flock: IF neighbor != b AND distance(b, neighbor) < VISUAL_RADIUS: neighbor_count++ // Rule 1: Separation (Vector points AWAY from neighbor) IF distance(b, neighbor) < PROTECTED_RANGE: separation_force += (b.position - neighbor.position) // Rule 2: Alignment (Accumulate velocities) alignment_avg_vel += neighbor.velocity // Rule 3: Cohesion (Accumulate positions) cohesion_avg_pos += neighbor.position IF neighbor_count > 0: // Finalize Alignment: Average the velocity and steer toward it alignment_avg_vel /= neighbor_count alignment_force = (alignment_avg_vel - b.velocity) * ALIGN_WEIGHT // Finalize Cohesion: Find center of mass and steer toward it cohesion_avg_pos /= neighbor_count cohesion_force = (cohesion_avg_pos - b.position) * COHESION_WEIGHT // Finalize Separation: Scale the repulsion separation_force *= SEPARATE_WEIGHT RETURN separation_force + alignment_force + cohesion_force If you’d like to find Craig then he can be found on the Internet here: http://www.red3d.com/cwr/ As you can see, his presence is very understated. <!-- SC_ON --> submitted by /u/MarioGianota (https://www.reddit.com/user/MarioGianota)
The Astro Technology Company joins Cloudflare | Astro
https://www.reddit.com/r/programming/comments/1qeilrk/the_astro_technology_company_joins_cloudflare/
submitted by /u/ReallySuperName (https://www.reddit.com/user/ReallySuperName)
[link] (https://astro.build/blog/joining-cloudflare/) [comments] (https://www.reddit.com/r/programming/comments/1qeilrk/the_astro_technology_company_joins_cloudflare/)
https://www.reddit.com/r/programming/comments/1qeilrk/the_astro_technology_company_joins_cloudflare/
submitted by /u/ReallySuperName (https://www.reddit.com/user/ReallySuperName)
[link] (https://astro.build/blog/joining-cloudflare/) [comments] (https://www.reddit.com/r/programming/comments/1qeilrk/the_astro_technology_company_joins_cloudflare/)
You can’t control what you can’t see: cost visibility in growing organizations
https://www.reddit.com/r/programming/comments/1qeizln/you_cant_control_what_you_cant_see_cost/
submitted by /u/justanotherdevblog (https://www.reddit.com/user/justanotherdevblog)
[link] (https://justanotherdevblog.com/2026/01/14/you-cant-control-what-you-cant-see-cost-visibility-in-growing-organizations/) [comments] (https://www.reddit.com/r/programming/comments/1qeizln/you_cant_control_what_you_cant_see_cost/)
https://www.reddit.com/r/programming/comments/1qeizln/you_cant_control_what_you_cant_see_cost/
submitted by /u/justanotherdevblog (https://www.reddit.com/user/justanotherdevblog)
[link] (https://justanotherdevblog.com/2026/01/14/you-cant-control-what-you-cant-see-cost-visibility-in-growing-organizations/) [comments] (https://www.reddit.com/r/programming/comments/1qeizln/you_cant_control_what_you_cant_see_cost/)
How to make a Blog
https://www.reddit.com/r/programming/comments/1qelrri/how_to_make_a_blog/
<!-- SC_OFF -->Using make and pandoc instead of your typical static site generator to build a blog. <!-- SC_ON --> submitted by /u/erikwasunavailable (https://www.reddit.com/user/erikwasunavailable)
[link] (https://blog.erikwastaken.dev/posts/2026-01-16-how-to-make-a-blog.html) [comments] (https://www.reddit.com/r/programming/comments/1qelrri/how_to_make_a_blog/)
https://www.reddit.com/r/programming/comments/1qelrri/how_to_make_a_blog/
<!-- SC_OFF -->Using make and pandoc instead of your typical static site generator to build a blog. <!-- SC_ON --> submitted by /u/erikwasunavailable (https://www.reddit.com/user/erikwasunavailable)
[link] (https://blog.erikwastaken.dev/posts/2026-01-16-how-to-make-a-blog.html) [comments] (https://www.reddit.com/r/programming/comments/1qelrri/how_to_make_a_blog/)
Simon Willison on Technical Blogging
https://www.reddit.com/r/programming/comments/1qeo9gx/simon_willison_on_technical_blogging/
<!-- SC_OFF -->Simon shares how he got into blogging, the blogs he enjoys reading, and his tips for others <!-- SC_ON --> submitted by /u/swdevtest (https://www.reddit.com/user/swdevtest)
[link] (https://writethatblog.substack.com/p/simon-willison-on-technical-blogging) [comments] (https://www.reddit.com/r/programming/comments/1qeo9gx/simon_willison_on_technical_blogging/)
https://www.reddit.com/r/programming/comments/1qeo9gx/simon_willison_on_technical_blogging/
<!-- SC_OFF -->Simon shares how he got into blogging, the blogs he enjoys reading, and his tips for others <!-- SC_ON --> submitted by /u/swdevtest (https://www.reddit.com/user/swdevtest)
[link] (https://writethatblog.substack.com/p/simon-willison-on-technical-blogging) [comments] (https://www.reddit.com/r/programming/comments/1qeo9gx/simon_willison_on_technical_blogging/)
Cursor Implied Success Without Evidence | Not one of 100 selected commits even built
https://www.reddit.com/r/programming/comments/1qeotkj/cursor_implied_success_without_evidence_not_one/
submitted by /u/xX_Negative_Won_Xx (https://www.reddit.com/user/xX_Negative_Won_Xx)
[link] (https://embedding-shapes.github.io/cursor-implied-success-without-evidence/) [comments] (https://www.reddit.com/r/programming/comments/1qeotkj/cursor_implied_success_without_evidence_not_one/)
https://www.reddit.com/r/programming/comments/1qeotkj/cursor_implied_success_without_evidence_not_one/
submitted by /u/xX_Negative_Won_Xx (https://www.reddit.com/user/xX_Negative_Won_Xx)
[link] (https://embedding-shapes.github.io/cursor-implied-success-without-evidence/) [comments] (https://www.reddit.com/r/programming/comments/1qeotkj/cursor_implied_success_without_evidence_not_one/)
NpgsqlRest vs PostgREST vs Supabase: Complete Feature Comparison
https://www.reddit.com/r/programming/comments/1qfbw6x/npgsqlrest_vs_postgrest_vs_supabase_complete/
submitted by /u/vbilopav89 (https://www.reddit.com/user/vbilopav89)
[link] (https://npgsqlrest.github.io/blog/npgsqlrest-vs-postgrest-supabase-comparison.html) [comments] (https://www.reddit.com/r/programming/comments/1qfbw6x/npgsqlrest_vs_postgrest_vs_supabase_complete/)
https://www.reddit.com/r/programming/comments/1qfbw6x/npgsqlrest_vs_postgrest_vs_supabase_complete/
submitted by /u/vbilopav89 (https://www.reddit.com/user/vbilopav89)
[link] (https://npgsqlrest.github.io/blog/npgsqlrest-vs-postgrest-supabase-comparison.html) [comments] (https://www.reddit.com/r/programming/comments/1qfbw6x/npgsqlrest_vs_postgrest_vs_supabase_complete/)
C++ ♥ Python - Alex Dathskovsky - CppCon 2025
https://www.reddit.com/r/programming/comments/1qfcivc/c_python_alex_dathskovsky_cppcon_2025/
submitted by /u/BlueGoliath (https://www.reddit.com/user/BlueGoliath)
[link] (https://www.youtube.com/watch?v=9uwDMg_ojdk) [comments] (https://www.reddit.com/r/programming/comments/1qfcivc/c_python_alex_dathskovsky_cppcon_2025/)
https://www.reddit.com/r/programming/comments/1qfcivc/c_python_alex_dathskovsky_cppcon_2025/
submitted by /u/BlueGoliath (https://www.reddit.com/user/BlueGoliath)
[link] (https://www.youtube.com/watch?v=9uwDMg_ojdk) [comments] (https://www.reddit.com/r/programming/comments/1qfcivc/c_python_alex_dathskovsky_cppcon_2025/)
The Evolution of CMake: 25 Years of C++ Build Portability - Bill Hoffman - CppCon 2025
https://www.reddit.com/r/programming/comments/1qfck14/the_evolution_of_cmake_25_years_of_c_build/
submitted by /u/BlueGoliath (https://www.reddit.com/user/BlueGoliath)
[link] (https://www.youtube.com/watch?v=wPZV2hBNJmo) [comments] (https://www.reddit.com/r/programming/comments/1qfck14/the_evolution_of_cmake_25_years_of_c_build/)
https://www.reddit.com/r/programming/comments/1qfck14/the_evolution_of_cmake_25_years_of_c_build/
submitted by /u/BlueGoliath (https://www.reddit.com/user/BlueGoliath)
[link] (https://www.youtube.com/watch?v=wPZV2hBNJmo) [comments] (https://www.reddit.com/r/programming/comments/1qfck14/the_evolution_of_cmake_25_years_of_c_build/)
High Contrast-ish Dark Gruvbox theme for VS Code
https://www.reddit.com/r/programming/comments/1qff3ci/high_contrastish_dark_gruvbox_theme_for_vs_code/
<!-- SC_OFF -->Marketplace link: - https://marketplace.visualstudio.com/items?itemName=bullptr.highgruv <!-- SC_ON --> submitted by /u/duke_of_brute (https://www.reddit.com/user/duke_of_brute)
[link] (https://vscodethemes.com/e/bullptr.highgruv/highgruv) [comments] (https://www.reddit.com/r/programming/comments/1qff3ci/high_contrastish_dark_gruvbox_theme_for_vs_code/)
https://www.reddit.com/r/programming/comments/1qff3ci/high_contrastish_dark_gruvbox_theme_for_vs_code/
<!-- SC_OFF -->Marketplace link: - https://marketplace.visualstudio.com/items?itemName=bullptr.highgruv <!-- SC_ON --> submitted by /u/duke_of_brute (https://www.reddit.com/user/duke_of_brute)
[link] (https://vscodethemes.com/e/bullptr.highgruv/highgruv) [comments] (https://www.reddit.com/r/programming/comments/1qff3ci/high_contrastish_dark_gruvbox_theme_for_vs_code/)
ArchiMate philosophy and Behaviour Driven Development
https://www.reddit.com/r/programming/comments/1qfg0ea/archimate_philosophy_and_behaviour_driven/
<!-- SC_OFF -->BDD and ArchiMate are essentially based on the same patterns and share the same philosophy. They can both be found rooted in the same fundamental works, such as those of J. F. Sowa and J. A. Zachman, which provide a formalisation of Information Systems Architecture (ISA) and the Six-column framework. <!-- SC_ON --> submitted by /u/SpiritualMortgage253 (https://www.reddit.com/user/SpiritualMortgage253)
[link] (https://andremoniy.medium.com/archimate-philosophy-and-behavior-driven-development-3dcf2b62353e) [comments] (https://www.reddit.com/r/programming/comments/1qfg0ea/archimate_philosophy_and_behaviour_driven/)
https://www.reddit.com/r/programming/comments/1qfg0ea/archimate_philosophy_and_behaviour_driven/
<!-- SC_OFF -->BDD and ArchiMate are essentially based on the same patterns and share the same philosophy. They can both be found rooted in the same fundamental works, such as those of J. F. Sowa and J. A. Zachman, which provide a formalisation of Information Systems Architecture (ISA) and the Six-column framework. <!-- SC_ON --> submitted by /u/SpiritualMortgage253 (https://www.reddit.com/user/SpiritualMortgage253)
[link] (https://andremoniy.medium.com/archimate-philosophy-and-behavior-driven-development-3dcf2b62353e) [comments] (https://www.reddit.com/r/programming/comments/1qfg0ea/archimate_philosophy_and_behaviour_driven/)
The Engineer to Executive Translation Layer
https://www.reddit.com/r/programming/comments/1qfgy7j/the_engineer_to_executive_translation_layer/
submitted by /u/Ordinary_Leader_2971 (https://www.reddit.com/user/Ordinary_Leader_2971)
[link] (https://www.annashipman.co.uk/jfdi/engineer-exec-translation.html) [comments] (https://www.reddit.com/r/programming/comments/1qfgy7j/the_engineer_to_executive_translation_layer/)
https://www.reddit.com/r/programming/comments/1qfgy7j/the_engineer_to_executive_translation_layer/
submitted by /u/Ordinary_Leader_2971 (https://www.reddit.com/user/Ordinary_Leader_2971)
[link] (https://www.annashipman.co.uk/jfdi/engineer-exec-translation.html) [comments] (https://www.reddit.com/r/programming/comments/1qfgy7j/the_engineer_to_executive_translation_layer/)
Designing A Key-Value Store
https://www.reddit.com/r/programming/comments/1qfjeos/designing_a_keyvalue_store/
submitted by /u/okutac (https://www.reddit.com/user/okutac)
[link] (https://yusufaytas.com/designing-a-key-value-store/) [comments] (https://www.reddit.com/r/programming/comments/1qfjeos/designing_a_keyvalue_store/)
https://www.reddit.com/r/programming/comments/1qfjeos/designing_a_keyvalue_store/
submitted by /u/okutac (https://www.reddit.com/user/okutac)
[link] (https://yusufaytas.com/designing-a-key-value-store/) [comments] (https://www.reddit.com/r/programming/comments/1qfjeos/designing_a_keyvalue_store/)
MindFry: An open-source database that forgets, strengthens, and suppresses data like biological memory
https://www.reddit.com/r/programming/comments/1qfjptb/mindfry_an_opensource_database_that_forgets/
submitted by /u/laphilosophia (https://www.reddit.com/user/laphilosophia)
[link] (https://erdemarslan.hashnode.dev/mindfry-the-database-that-thinks) [comments] (https://www.reddit.com/r/programming/comments/1qfjptb/mindfry_an_opensource_database_that_forgets/)
https://www.reddit.com/r/programming/comments/1qfjptb/mindfry_an_opensource_database_that_forgets/
submitted by /u/laphilosophia (https://www.reddit.com/user/laphilosophia)
[link] (https://erdemarslan.hashnode.dev/mindfry-the-database-that-thinks) [comments] (https://www.reddit.com/r/programming/comments/1qfjptb/mindfry_an_opensource_database_that_forgets/)
The Disappearance of the Junior Developer: How to Start a Career in 2026
https://www.reddit.com/r/programming/comments/1qfjtn2/the_disappearance_of_the_junior_developer_how_to/
submitted by /u/RevillWeb (https://www.reddit.com/user/RevillWeb)
[link] (https://www.denoise.digital/the-disappearance-of-the-junior-developer-how-to-start-a-career-in-2026/) [comments] (https://www.reddit.com/r/programming/comments/1qfjtn2/the_disappearance_of_the_junior_developer_how_to/)
https://www.reddit.com/r/programming/comments/1qfjtn2/the_disappearance_of_the_junior_developer_how_to/
submitted by /u/RevillWeb (https://www.reddit.com/user/RevillWeb)
[link] (https://www.denoise.digital/the-disappearance-of-the-junior-developer-how-to-start-a-career-in-2026/) [comments] (https://www.reddit.com/r/programming/comments/1qfjtn2/the_disappearance_of_the_junior_developer_how_to/)
Engineering a Columnar Database in Rust: Lessons on io_uring, SIMD, and why I avoided Async/Await
https://www.reddit.com/r/programming/comments/1qfkijn/engineering_a_columnar_database_in_rust_lessons/
<!-- SC_OFF -->I recently released the core engine for Frigatebird, an OLAP (Columnar) database built from scratch. While building it, I made a few architectural decisions that go against the "standard" Rust web/systems path. I wanted to share the rationale and the performance implications of those choices. 1. Why I ditched Async/Await for a Custom Runtime
The standard advice in Rust is "just use Tokio." However, generic async runtimes are designed primarily for IO-bound tasks with many idle connections. In a database execution pipeline, tasks are often CPU-heavy (scanning/filtering compressed pages). I found that mixing heavy compute with standard async executors led to unpredictable scheduling latency. Instead, I implemented a Morsel-Driven Parallelism model (inspired by DuckDB/Hyper): Queries are broken into "morsels" (fixed-size row groups). Instead of a central scheduler, worker threads use lock-free work stealing. A query job holds an AtomicUsize counter. Threads race to increment it (CAS), effectively "claiming" the next step of the pipeline. This keeps CPU cores pinned and maximizes instruction cache locality, as threads tend to stick to specific logic loops (Scanning vs Filtering). 2. Batched io_uring vs. Standard Syscalls
For the WAL (Write-Ahead Log), fsync latency is the killer. I built a custom storage engine ("Walrus") to leverage Linux's io_uring. Instead of issuing pwrite syscalls one by one, the writer constructs a submission queue of ~2,000 entries in userspace. It issues a single submit_and_wait syscall to flush them all. This reduced the context-switching overhead significantly, allowing the engine to saturate NVMe bandwidth on a single thread. 3. The "Spin-Lock" Allocator
This was the riskiest decision. Standard OS mutexes (pthread_mutex) put threads to sleep, costing microseconds. For the disk block allocator, I implemented a custom AtomicBool spin-lock. It spins in a tight loop (std::hint::spin_loop()) for nanoseconds. Trade-off: If the OS preempts the thread holding the lock, the system stalls. But because the critical section is just simple integer math (calculating offsets), it executes faster than the OS scheduler quantum, making this statistically safe and extremely fast. 4. Zero-Copy Serialization
I used rkyv instead of serde. Serde is great, but it usually involves deserialization steps (parsing bytes into structs). rkyv guarantees that the in-memory representation is identical to the on-disk representation, allowing for true zero-copy access by just casting pointers on the raw buffer. I'm curious if others here have hit similar walls with Tokio in CPU-bound contexts, or if I just failed to tune it correctly? <!-- SC_ON --> submitted by /u/Ok_Marionberry8922 (https://www.reddit.com/user/Ok_Marionberry8922)
[link] (https://github.com/Frigatebird-db/frigatebird) [comments] (https://www.reddit.com/r/programming/comments/1qfkijn/engineering_a_columnar_database_in_rust_lessons/)
https://www.reddit.com/r/programming/comments/1qfkijn/engineering_a_columnar_database_in_rust_lessons/
<!-- SC_OFF -->I recently released the core engine for Frigatebird, an OLAP (Columnar) database built from scratch. While building it, I made a few architectural decisions that go against the "standard" Rust web/systems path. I wanted to share the rationale and the performance implications of those choices. 1. Why I ditched Async/Await for a Custom Runtime
The standard advice in Rust is "just use Tokio." However, generic async runtimes are designed primarily for IO-bound tasks with many idle connections. In a database execution pipeline, tasks are often CPU-heavy (scanning/filtering compressed pages). I found that mixing heavy compute with standard async executors led to unpredictable scheduling latency. Instead, I implemented a Morsel-Driven Parallelism model (inspired by DuckDB/Hyper): Queries are broken into "morsels" (fixed-size row groups). Instead of a central scheduler, worker threads use lock-free work stealing. A query job holds an AtomicUsize counter. Threads race to increment it (CAS), effectively "claiming" the next step of the pipeline. This keeps CPU cores pinned and maximizes instruction cache locality, as threads tend to stick to specific logic loops (Scanning vs Filtering). 2. Batched io_uring vs. Standard Syscalls
For the WAL (Write-Ahead Log), fsync latency is the killer. I built a custom storage engine ("Walrus") to leverage Linux's io_uring. Instead of issuing pwrite syscalls one by one, the writer constructs a submission queue of ~2,000 entries in userspace. It issues a single submit_and_wait syscall to flush them all. This reduced the context-switching overhead significantly, allowing the engine to saturate NVMe bandwidth on a single thread. 3. The "Spin-Lock" Allocator
This was the riskiest decision. Standard OS mutexes (pthread_mutex) put threads to sleep, costing microseconds. For the disk block allocator, I implemented a custom AtomicBool spin-lock. It spins in a tight loop (std::hint::spin_loop()) for nanoseconds. Trade-off: If the OS preempts the thread holding the lock, the system stalls. But because the critical section is just simple integer math (calculating offsets), it executes faster than the OS scheduler quantum, making this statistically safe and extremely fast. 4. Zero-Copy Serialization
I used rkyv instead of serde. Serde is great, but it usually involves deserialization steps (parsing bytes into structs). rkyv guarantees that the in-memory representation is identical to the on-disk representation, allowing for true zero-copy access by just casting pointers on the raw buffer. I'm curious if others here have hit similar walls with Tokio in CPU-bound contexts, or if I just failed to tune it correctly? <!-- SC_ON --> submitted by /u/Ok_Marionberry8922 (https://www.reddit.com/user/Ok_Marionberry8922)
[link] (https://github.com/Frigatebird-db/frigatebird) [comments] (https://www.reddit.com/r/programming/comments/1qfkijn/engineering_a_columnar_database_in_rust_lessons/)
How to Build Decentralized Web Apps on Freenet Using Rust and WebAssembly
https://www.reddit.com/r/programming/comments/1qflgvq/how_to_build_decentralized_web_apps_on_freenet/
submitted by /u/sanity (https://www.reddit.com/user/sanity)
[link] (https://freenet.org/resources/manual/tutorial/) [comments] (https://www.reddit.com/r/programming/comments/1qflgvq/how_to_build_decentralized_web_apps_on_freenet/)
https://www.reddit.com/r/programming/comments/1qflgvq/how_to_build_decentralized_web_apps_on_freenet/
submitted by /u/sanity (https://www.reddit.com/user/sanity)
[link] (https://freenet.org/resources/manual/tutorial/) [comments] (https://www.reddit.com/r/programming/comments/1qflgvq/how_to_build_decentralized_web_apps_on_freenet/)