Dev.to
Great Stack to Doesn't Work #3 — Redis: "99% Cache Hit Ratio, System Down"
A survival guide for when everything goes wrong in production. Your Redis dashboard looks perfect. Hit ratio: 99.2%. Latency: sub-millisecond. Memory usage: 60% of available. Every metric says healthy. Then at 2:47 PM, your API starts returning 500s. Response times spike to 30 seconds. Users can't log in. The dashboard still shows 99% hit ratio because the cache is working — it's serving cached errors to everyone equally fast. Redis is doing exactly what you told it to do. The problem is what you told it to do. Why Single-Threaded Is Fast (Until It Isn't) Redis processes commands on a single thread. No locks. No context switching. No synchronization overhead. One CPU core, fully utilized, can handle 100K+ operations per second because it never waits for another thread to release a lock. The event loop model (similar to Node.js) multiplexes thousands of client connections on a single thread using non-blocking I/O. Read a request, process it, write the response, move to the next. When your commands are simple — GET, SET, INCR — each one takes microseconds. The trap: slow commands block everything. KEYS * on a million-key database? That's a full keyspace scan on the main thread. While it runs, every other client waits. SORT on a large set? Same. LRANGE on a list with 10 million elements? Same. Redis 6.0 introduced I/O threading ( io-threads config) for reading and writing network data on multiple threads, but command execution is still single-threaded. Redis 7.0 improved this further, but the fundamental model hasn't changed. Long-running commands on the main thread stall everything. Rules: Never use KEYS in production. Use SCAN instead — it's cursor-based and returns results incrementally. Watch out for O(N) commands on large data structures: LRANGE , SMEMBERS , HGETALL on million-element structures. Use SLOWLOG to find commands that are blocking the event loop. Pipelining: The Easiest 10x You'll Ever Get Every Redis command involves a network round trip: send request
Mehmet TURAÇ
2026-05-31 05:47
👁 12
查看原文 →
Dev.to
The Bug That Passes Every Toolchain Check: Circular Dependencies in JavaScript
A circular dependency is one of the few bugs that passes every check your toolchain runs. TypeScript compiles it cleanly. The tests pass. The build succeeds. The app ships. And somewhere deep in your import graph, a developer is staring at a TypeError: X is not a constructor that disappears the moment they add a console.log . Here are the three patterns that create them, what Node.js, webpack, Rollup, and esbuild actually do with them — they don't solve the problem, they each make a different tradeoff — and how to stop them from forming. What a circular dependency actually is A circular dependency exists when module A imports from module B, which imports — directly or transitively — from module A. // user.service.ts import { formatUser } from ' ./user.utils ' ; // user.utils.ts import { UserService } from ' ./user.service ' ; // ← closes the loop Neither developer planned this. user.service.ts needed a formatter. user.utils.ts needed the service type for a helper added three sprints later. Nobody saw the cycle form — they just saw two reasonable imports. This is how every circular dependency is born: through incremental, individually sensible decisions. The 3 patterns that create them 1. Barrel files ( index.ts re-exports) Barrel files are the biggest source of accidental cycles in TypeScript projects. // features/user/index.ts — re-exports everything in the feature export { UserService } from ' ./user.service ' ; export { UserRepository } from ' ./user.repository ' ; export { UserController } from ' ./user.controller ' ; export { formatUser , validateUser } from ' ./user.utils ' ; Now every file in the user feature imports from ../user (the barrel) for cleaner paths. And any utility the barrel re-exports cannot safely import anything else from the barrel without creating a cycle. // user.utils.ts import { UserService } from ' ../user ' ; // ← imports the barrel // The barrel re-exports user.utils → user.utils imports the barrel → cycle Teams adopt barrel files for
Ofri Peretz
2026-05-31 05:46
👁 13
查看原文 →
Dev.to
Great Stack to Doesn't Work Bonus: SQL vs NoSQL: Which One in 2026?
The honest decision framework, not another flame war. The SQL vs NoSQL debate has been running for 15 years and it still generates more heat than light. Here's the framework that actually helps you decide. The Real Question It's not "SQL or NoSQL." It's: what does your access pattern look like? If your application is mostly reading and writing related data through well-defined queries — orders with line items, users with addresses, products with categories — relational databases are purpose-built for this. JOINs are not expensive when they're indexed. Transactions are not slow when they're scoped correctly. PostgreSQL handles 50 million rows comfortably on a single node. If your application is reading and writing self-contained documents with predictable access by a primary key, and you rarely need cross-document queries — user profiles, product catalogs, content management — a document database simplifies your code. No ORM mapping hell. No migration files for adding a field. If your application writes massive volumes and reads by partition key with eventual consistency — time-series data, IoT telemetry, activity feeds at scale — wide-column stores like Cassandra were built for this specific workload. The 2026 Reality PostgreSQL has eaten NoSQL's lunch in many areas. JSONB support means you can store and query unstructured data inside PostgreSQL with GIN indexes. You get the document model flexibility without giving up transactions, JOINs, and a 30-year ecosystem. For 80% of startups and mid-size companies, PostgreSQL is the only database you need. MongoDB has gotten more relational. Multi-document ACID transactions (since 4.0), schema validation, aggregation pipelines that look suspiciously like SQL. It's converging toward what PostgreSQL already does, but with a different starting point. DynamoDB dominates serverless. If you're in AWS and your access pattern is simple key-value with known query patterns, DynamoDB's pricing model (pay-per-request) and operational s
Mehmet TURAÇ
2026-05-31 05:45
👁 8
查看原文 →
TechCrunch
SoftBank says it will invest up to €75 billion to build French data centers
The goal, the firm said, is to develop and operate up to 5 gigawatts of additional data center capacity.
Anthony Ha
2026-05-31 05:45
👁 10
查看原文 →
Dev.to
I built a detention-pay calculator for truckers in a day — unglamourous niches beat another AI wrapper
Every "what should I build" thread on here is full of AI wrappers fighting over the same five SaaS founders. Meanwhile there's a guy sitting at a loading dock right now, doing arithmetic in his head, who is about to undercharge his broker by a few hundred bucks because nobody built him a 30-second tool. I built that tool. It's a free detention-pay calculator for truck drivers. This is the build log — the niche-selection, the single-file stack, and two decisions (an SVG gauge and a no-mail-service auth scheme) that were more interesting than the app deserves. I'm not a trucker. I build small free web tools for industries other may find unglamourous or not enticing enough. That honesty matters later. The problem (worth $2–6k/yr to one user) Truckers get a "free time" window at a dock — usually 2 hours. Past that, the broker owes detention pay (~$50–100/hr). Drivers leave an estimated $2,000–6,000/year of it unclaimed, mostly because the math + the paperwork is annoying enough to skip. So the spec wrote itself: In/out times + free hours + rate → dollars owed. Export a dispute-ready PDF they can email the broker. Work on a phone, no login, instant. Validating before writing a line The mistake I almost made: assume the niche is empty because I'd never heard of it. I checked. It is not empty — DockClaim ($49/mo, GPS tracking), Detention Buddy, a couple of $9.99/mo App Store apps, even a free email-gated web calculator or two. That killed my first instinct ("be the only one") but clarified the real wedge: everything is a paid app download or email-gated. The opening was a genuinely free, no-signup, instant web version that also generates the claim PDF. Not "the only detention tool" — the one with the least friction. I'll say more on why I'm careful about that claim at the end. Lesson: validate to find your angle , not just a go/no-go. "Crowded but all friction-heavy" is a fine market. The stack: one HTML file No framework. The whole app is a single self-contained .html — m
ItsEvilDuck
2026-05-31 05:43
👁 10
查看原文 →
HackerNews
Show HN: Phive, a Gomoku-like game to play with friends or solo
In 2025, my family and I had a long streak of playing a Gomoku / Go Bang / five-in-a-row based game called OK Play. I built a web version so that we could play any time we wanted (i.e. on our phones after kiddos went to sleep). The first player to get five-in-a-row (horizontally, vertically, or diagonally) wins. In the first phase of play, players take turns placing their pieces next to existing pieces (always edge-to-edge; you can't place a piece with only a corner-to-corner connection). After
0xCA1EB
2026-05-31 05:43
👁 2
查看原文 →
Dev.to
The Same AI Model Can Perform 6x Better: Here's Why
A Stanford and Tsinghua paper ran a controlled experiment earlier this year. Same model. Same task. Different harness architecture. The result: a 6x performance gap driven entirely by the system built around the model. Not the model itself. This is not a prompt engineering insight. It is a systems architecture insight, and it changes where developers should invest their time when building agentic systems. The 6x Gap Meta-Harness tested Claude Opus 4.6 across two harness configurations on TerminalBench-2. The only variable was the scaffold: the code that manages tool calls, context windows, error recovery, and state persistence. One version scored at baseline. The other, with structured tool orchestration and context management, scored 18.4 points higher. Same inference cost. Same model. Different architecture. This pattern replicates across multiple independent studies: LangChain DeepAgents (2026): Same GPT-5.2-Codex model. Harness-only changes moved it from Top 30 to Top 5. That is a 13.7-point gain. Can Bölük (Hashline, 2026): Same model, same task. Changed the edit tool format. Performance went from 6.7% to 68.3%. That is a 10x improvement with 61% fewer tokens. Vercel's d0 agent : A production agent had 16 tools. Removing 14 of them (leaving only bash) took success rate from 80% to 100%. The bottleneck was not capability. It was decision surface. Why This Matters Practically The cheapest Haiku call with an optimised harness (37.6% on TerminalBench-2) outperformed the most expensive Opus call with a default harness (58.0%). That is at 1/50th the inference cost. Most teams are optimising at the wrong layer. They swap models, tune prompts, add retrieval. The structural leverage is in how the system manages tool calls, handles state, and recovers from failure. What Changes The practical takeaway for anyone building with AI agents: Audit your tool surface. Every tool your agent can call is a decision it must make. Vercel found 16→1 tool reduction improved everything.
Harry Floyd
2026-05-31 05:39
👁 6
查看原文 →
Dev.to
SQL-like Queries in FSRS Plugin for Obsidian
SQL-like Queries in FSRS Plugin for Obsidian Spaced repetition in Obsidian usually works as "show all cards with due earlier than today." That's enough for simple cases, but once you have hundreds of notes, you want to filter, sort, and select. My FSRS plugin now has a query language resembling SQL. It turns a markdown block into a live table that updates with every review. ``` fsrs-table SELECT file as "Note", r as "Retrievability", date_format(due, '%d.%m.%Y') as "Due" WHERE r < 0.7 ORDER BY r ASC LIMIT 20 ``` → the table shows the 20 most "forgotten" cards, sorted by retrieval probability. From Simple Settings to an Embedded DB Initially I planned to offer table settings using standard SQL syntax. But pretty quickly the syntax became a real query language, and the implementation itself — an embedded lightweight DB. High-level test coverage in TypeScript made it easy to iterate on functionality located in the WASM module via an AI agent. When faced with dual-language testing (TypeScript + Rust), the artificial intelligence prefers to do the job properly rather than fake it. After implementing the lexer → parser → AST → evaluator pipeline for numeric values, I extended it to strings, added filtering via WHERE, then functions. Extending the syntax or adding a function came down to a single request to the agent — and a feasibility check. What's Inside fsrs-table Supported Features SELECT — choose fields, rename via AS . WHERE — conditions with = , != , < , > , <= , >= , AND , OR . ORDER BY — sort ascending ( ASC ) or descending ( DESC ). LIMIT — cap the number of rows. date_format() — convert the due date to any text format. Available fields: Field (alias) Type Description file string path to the note due date next review date stability (s) number stability in days difficulty (d) number difficulty retrievability (r) number probability of recall (0…1) reps number total number of reviews state string New, Learning, Review, or Relearning elapsed number days since last r
Evgene
2026-05-31 05:38
👁 10
查看原文 →
Dev.to
[Imposter syndrome] Back to the beginning (DevSecOps path)
I’ve been writing my project - Python port scanner for 9 months now. You might be wondering, “Why is it taking so long?” Most of the time was spent figuring out how raw sockets work, how to write a function for manually assembling a packet, calculating the checksum, packing the IP packet bytes, the TCP header, the pseudo-header using struct.pack, sending the packet, and how SYN scanning works. Why did I decide to take such a complicated route instead of just using Scapy? I’m a principled person and have a very exhausting yet useful skill—understanding everything. That’s how I got acquainted with big-endian, or “network byte order.” I won’t go into the details of big-endian logic, to be honest, I’m already mentally exhausted It took several evenings and nights to analyze and understand the principles—watching videos, reading RFCs, and looking at GitHub code (which I didn’t understand)—but what bothered me most was that I had to ask gemini for an explanation. As I mentioned above, I’m very principled; I can’t just copy code without understanding it, so I ask gemini for a prompt like this: “Don’t write the code for me. If I end up asking you for an example because I’m tired, explain it line by line.” Yesterday I realized I don’t fully understand Python (basics)—I don’t remember REPL—so I went to ask Gemini for advice; I don’t have anyone competent who could help me with advice. I’m not very sociable, and the only thing that’s interested me for the last four years is IT. I used to make music. Lately, something strange has been going on with my health, the day before yesterday I woke up because of a nosebleed; this has happened before, but on a larger scale. I stopped working on the scanner yesterday and decided to try writing a backup script in Python. I found an article and jotted down in Obsidian what the project should and shouldn’t do. Previously, the project used Docker, Prometheus, and Grafana. My questions: Am I a good developer, and am I even one at all? Should
Kotany
2026-05-31 05:36
👁 5
查看原文 →
HackerNews
Rotary GPU: Exploring Local Execution for Large MoE Models Under Limited VRAM
dryarzeg
2026-05-31 05:05
👁 2
查看原文 →
Reddit r/artificial
[Open Source] I built a full Git MCP server in Go that doesn't just wrap bash. It uses tree-sitter, handles real plumbing (write-tree), and runs 100% locally.
I was tired of watching LLM agents fail at basic Git operations. Standard integrations pass raw text, hang on pagers, or scream because they can't parse unstructured git diff outputs. git-courer is a full Model Context Protocol (MCP) server written in Go that treats Git properly. No bash spawning, no unstructured text to parse. Everything communicates via structured JSON. Here is an actual commit message it generated completely locally: fix: fix mcp server connection handling WHY The previous implementation lacked proper error handling for connection failures in the MCP server, leading to unhandled panics or silent failures when the local LLM backend was unreachable. WHAT * Added connection timeout logic to the local client calls. * Implemented retry mechanisms with exponential backoff for transient backend errors. The Architecture & Tool Pack Read Tools (status, diff, history, blame): Completely structured JSON and fully paginated. A single status call replaces over 5 standard Git commands for the agent. Write Tools (commit, merge, rebase, branch, stash, stage, sync...): Every single mutation auto-creates a backup before executing. If the LLM messes up, a RESTORE command brings you back exactly where you were. Safety Model: Destructive operations (hard resets, force pushes, branch deletions) require an explicit confirmed=true gate. The agent is forced to ask you first. dry_run=true is also available for peace of mind. The Semantic Annotator (Why it's different) Instead of just feeding raw code to the LLM, git-courer uses go-enry + go-tree-sitter to parse the AST and tag every hunk semantically before the LLM even sees it. It detects tags like NEW_FUNC, MOD_SIG, MOD_BODY, DELETED, and BREAKING_CHANGE. The commit type (feat, fix, refactor) is determined deterministically from these AST tags rather than guessed by the model. The Commit Pipeline Atomic Commits: One staged area = one commit. It actively prevents the agent from creating gian
/u/blakok14
2026-05-31 05:04
👁 4
查看原文 →
Reddit r/artificial
reddit brain goldmine - you are welcome
reddit.com/settings/data-request https://gamma.app/docs/Reddit-Brain-qt0g7e5vktlgifm Implementation Blueprint Your questions answered. Three steps to go from zero to a fully operational Reddit Brain. Step 0: Download Your Archive Go to reddit.com/settings/data-request and request your full data export. You'll receive a ZIP file containing comments.csv and posts.csv — everything you've ever posted on Reddit. Step 1: Get the Data Action: Request your export at reddit.com/settings/data-request . Then: Download ZIP, extract comments.csv and posts.csv . Optionally run reddit-user-to-sqlite to build a parallel SQLite archive for richer querying. Step 2: Build the Brain Action: Load into Sheets or a database. Clean, tag, and compute word count and engagement metrics. Then: Add LLM passes for canonical_question , topic, tone, and content type. Push into a vector store; connect via n8n or your preferred orchestrator. Step 3: Exploit the Hell Out of It Action: Generate content backlogs, podcast outlines, FAQs, scripts, and social copy from your corpus. Then: Use agents to draft from your own history, keep messaging on-brand, and refresh the archive with new exports on a schedule. submitted by /u/jdawgindahouse1974 [link] [留言]
/u/jdawgindahouse1974
2026-05-31 05:02
👁 4
查看原文 →
HackerNews
I am against GenAI and everything it stands for
birdculture
2026-05-31 04:44
👁 2
查看原文 →
HackerNews
Domain expertise has always been the real moat
aaronbrethorst
2026-05-31 04:40
👁 2
查看原文 →
Reddit r/webdev
2 years later, anyone using PandaCSS? Like it?
I have been using PandaCSS + Ark UI to build out my components on my app. I kind of like it, I mean really its an alternative to Tailwind basically using CSS in JS, but with full types so you don't need an extension to get auto-complete. Where it gets clunky for me though is the build tooling having to build the styled-system directory with everything...but I mean I guess Tailwind has its own building configuration. I'm just curious cause I've kind of liked it, but really see it used much. Most I can find on info is like videos and stuff when it first came out. submitted by /u/k032 [link] [留言]
/u/k032
2026-05-31 04:40
👁 4
查看原文 →
HackerNews
Mystery company accidentally blew $500M on Claude AI in a single month
timpera
2026-05-31 04:36
👁 2
查看原文 →
HackerNews
Show HN: Breathe CLI – Paced resonance breathing in the macOS terminal
I built a terminal app that paces slow breathing at 6 breaths per minute for vagal tone training. It's a single Python file, stdlib only, no dependencies — just run breathe and follow the bar. I'm a cardiology patient (HFrEF). Slow breathing at resonance frequency is one of the few non-pharmacological interventions shown to improve cardiac vagal tone and baroreflex sensitivity (Bernardi et al., Circulation 2002; Lancet 1998). I wanted a frictionless daily habit tool — no app store, no account, n
marekkowalczyk
2026-05-31 04:30
👁 2
查看原文 →
Reddit r/programming
Does any one have any notes or comments on the Philosophy of Coding?
I started off thinking I needed to simply memorize Modules and go through each and find a way to apply each of them linearly through the docs. Thinking about it that was kind of a retarded approach, but i blame it on classroom conditioning. My inconsistent life stability as well, going off and on with studying. Anyway, I found progress in freeCodeCamp and I've took these notes: Project Completion List: Report card printer | Employee profile generator | Bill Splitter Movie ticket calculator | Weather Travel Planner | Apply Discount Function Caesar Cipher | RPG Character Creator | Pin Extractor | Number Pattern Generator Medical Data Validator | In Python, code blocks are determined by indentation. Redundancy Is A BIG Logic Problem I have in learning Python. Think of parameters as placeholder variables that act as "slots" for the values you pass into functions when you call them. To use the parameters, you have to pass in "arguments". Arguments are the values you pass to a function when you call it. In Python it seems that you should learn to do things with incredible detail and specifics. In the FCC it seems an unspoken lesson is to pay careful attention to what is not said, don't under-cut and don't exceed the expectation. That might be something to ponder later. In note taking i have also found that it is much more meaningful and efficient to only record pointers, not executions or further examples. Logic Thinking and Problem Solving are both things that have to be developed by you. They cant be memorized or given to you. You should give yourself obvious recognition to look back on, It helps you remind yourself when you think your not making progress. order matters whenever it comes to for loops Also, an if statement is NOT a for loop Memorizing isn't learning, It's memorizing. submitted by /u/Big_Example_3390 [link] [留言]
/u/Big_Example_3390
2026-05-31 04:29
👁 4
查看原文 →
HackerNews
768GB Intel Optane DIMMs to run 1T-parameter LLM with single GPU at 4tps
walterbell
2026-05-31 04:17
👁 2
查看原文 →
HackerNews
1M Ancient Greek fragments soon to be translated with the help of AI
janandonly
2026-05-31 04:14
👁 2
查看原文 →