I’ve seen 5-year "Senior" resumes that haven't ever touched a raw Execution Plan. 📉 It’s Friday at 4 PM. The web servers are idling, but the SQL Database is screaming at 99% CPU. Your code is "clean," your ORM is "standard," but your production environment is melting. We’re building a generation of engineers with "Hollow Experience"—senior-level output with junior-level foundational roots. We treat the database as a "Black Box" that just stores JSON. But when the abstraction leaks, and the N+1 queries start firing like a machine gun, do you know how to look under the hood? Real seniority is developed in the intuition of failure. It's the ability to "smell" a table scan before it hits production. SQL isn't an "implementation detail"—it is the backbone of your system. If you can't read an Execution Plan, you aren't driving the car; you're just a passenger hoping the AI co-pilot doesn't crash. Stop guessing and start indexing. I’ve written a deep dive into why your ORM might be killing your performance. Read the full post here: https://lnkd.in/dD-SHnQW #SQLServer #DatabasePerformance #BackendEngineering #SoftwareArchitecture #Codehouse #SeniorEngineer
Senior Engineers Need to Know SQL Execution Plans
More Relevant Posts
-
🚨 N+1 Query Problem — The Silent Scalability Killer A pattern that doesn’t crash your system. It just makes it slower… with every single record you add. Most backend performance issues don’t come from bad code. They come from code that looks right. Clean. Readable. Shippable. And one of the most common patterns hiding in plain sight is: 👉 The N+1 Query Problem You run: • 1 query to fetch a list • N queries to fetch related data 👉 Total = N + 1 queries Sounds harmless. Until N becomes 1,000… or 10,000. ⚠️ What changes at scale? • Query count grows linearly • Latency compounds across round trips • Database load spikes • Performance degrades gradually Exactly as shown in the attached breakdown 👇 🧠 Why this slips through Because it doesn’t look like a problem. It looks like: • Simple loops • Clean ORM calls • Well-structured resolvers 👉 But underneath, it’s inefficient data access design 🧩 The Reality N+1 is not a bug. It’s a design gap between: how we write code how data is actually fetched Final Thought N+1 doesn’t fail fast. It fails quietly. And by the time you notice it… 👉 it’s already impacting your system at scale. 💬 Have you run into N+1 in production? How did you detect it — logs, APM, or just latency complaints? #BackendEngineering #SystemDesign #NodeJS #PerformanceOptimization #ScalableSystems #Database #ORM #NPlusOne #TechArchitecture #Developers #Programming
To view or add a comment, sign in
-
Every backend developer has faced this dilemma: ❌ Auto-increment IDs? You're leaking your business volume to anyone paying attention. order_id=100420 at 10am, 100780 at 2pm = 360 orders in 4 hours. Your growth curve, exposed. 📉 ❌ UUID v4? 128-bit random keys destroy your B+ tree index performance once data outgrows memory. Every insert becomes a cache miss. 😩 ❌ Snowflake-style timestamp IDs? You married the wall clock. NTP step backward? VM resume after snapshot? Your ID generator either emits duplicates or stalls. ⏱️ There's a fourth option — and it sidesteps all three. permid64 generates 64-bit IDs from a simple idea: 🔑 "Uniqueness comes from a counter. The random-looking surface comes from a reversible permutation." A persistent counter provides strictly monotonic uniqueness — no wall clock involved, ever. A bijection over 64 bits maps those sequential values into opaque-looking IDs that reveal nothing about your business volume. The best part? It's FULLY DECODABLE. When an anomalous ID appears in a production log, you can instantly recover the instance and sequence number — no database lookup required. 👇 Quick look at the Python implementation: from permid64 import Id64 gen = Id64.multiplicative(instance_id=42, state_file="orders.state") token = gen.next_base62() // e.g. '3kTMd92Hx7Q' print(f"New Order: ORD_{token}") // Incident tracing: decode instantly meta = gen.decode_base62('3kTMd92Hx7Q') print(f"Instance: {meta.instance_id}, Sequence: {meta.sequence}") You get compact, URL-safe tokens for external use — and full traceability for ops. No trade-off required. 📦 pip install permid64 🔗 Full technical deep-dive (B+ tree analysis, bijection proofs, Feistel network internals) in the comments 👇 #Python #SoftwareEngineering #BackendDevelopment #Database #IDGeneration #Microservices #OpenSource
To view or add a comment, sign in
-
-
Most teams I've worked with underestimate how much time they lose to poor database indexing strategy. You'll write query after query, optimize the application logic, add caching layers—all while your table scans are silently murdering performance in production. The worst part? A junior dev can spot it in 5 minutes with the right tools, but nobody thinks to look. The real skill isn't knowing every index type. It's building the habit of checking execution plans before deployment and understanding which columns actually get filtered or joined. I've seen 30-second queries drop to 50ms with a single composite index. Once you internalize that patterns repeat across your codebase, you stop writing slow code in the first place. The mistake isn't complexity—it's ignoring the fundamentals because they feel boring. What's the worst performance issue you've inherited that turned out to be a missing index? #Database #SQL #Performance #BackendDevelopment #DatabaseOptimization
To view or add a comment, sign in
-
𝗔 𝗰𝗹𝗲𝗮𝗿 𝘂𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝗼𝗳 𝘀𝗼𝗺𝗲 𝗯𝗮𝘀𝗶𝗰 𝗰𝗼𝗻𝗰𝗲𝗽𝘁𝘀 𝗰𝗮𝗻 𝗺𝗮𝗸𝗲 𝗮 𝗵𝘂𝗴𝗲 𝗱𝗶𝗳𝗳𝗲𝗿𝗲𝗻𝗰𝗲 𝗶𝗻 𝘁𝗵𝗲 𝘄𝗮𝘆 𝘆𝗼𝘂 𝘁𝗮𝗰𝗸𝗹𝗲 𝗮𝗻𝘆 𝘀𝘆𝘀𝘁𝗲𝗺 𝗱𝗲𝘀𝗶𝗴𝗻 𝗽𝗿𝗼𝗯𝗹𝗲𝗺. After analyzing 𝟯𝟬 𝗸𝗲𝘆 𝘀𝘆𝘀𝘁𝗲𝗺 𝗱𝗲𝘀𝗶𝗴𝗻 concepts, I’ve put together this one-page cheat sheet to help you: 𝟭. 𝗦𝗰𝗮𝗹𝗲 𝗹𝗶𝗸𝗲 𝗮 𝗽𝗿𝗼 – Auto-scaling, horizontal scaling, database sharding, and CDN strategies. 𝟮. 𝗠𝗮𝗻𝗮𝗴𝗲 𝗱𝗮𝘁𝗮 𝗲𝗳𝗳𝗶𝗰𝗶𝗲𝗻𝘁𝗹𝘆 – Data partitioning, NoSQL, SQL transactions, and indexing best practices. 𝟯. 𝗘𝗻𝘀𝘂𝗿𝗲 𝗿𝗲𝗹𝗶𝗮𝗯𝗶𝗹𝗶𝘁𝘆 & 𝗳𝗮𝘂𝗹𝘁 𝘁𝗼𝗹𝗲𝗿𝗮𝗻𝗰𝗲 – Load balancing, redundancy, heartbeat mechanisms, and event-driven architecture. 𝟰. 𝗠𝗮𝘀𝘁𝗲𝗿 𝗰𝗮𝗰𝗵𝗶𝗻𝗴 𝘀𝘁𝗿𝗮𝘁𝗲𝗴𝗶𝗲𝘀 – Read-through vs. write-through caching, Denormalise Databases, and Distributed Caching. 𝟱. 𝗗𝗲𝘀𝗶𝗴𝗻 𝗳𝗹𝗲𝘅𝗶𝗯𝗹𝗲 𝗮𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲𝘀 – Microservices, async tasks, and avoiding over-engineering. 𝟲. 𝗗𝗲𝗳𝗶𝗻𝗲 𝗽𝗿𝗼𝗯𝗹𝗲𝗺𝘀 𝗯𝗲𝗳𝗼𝗿𝗲 𝗷𝘂𝗺𝗽𝗶𝗻𝗴 𝗶𝗻𝘁𝗼 𝘀𝗼𝗹𝘂𝘁𝗶𝗼𝗻𝘀 – System constraints, trade-offs, WebSockets, and security. 𝗧𝗵𝗶𝘀 𝗶𝘀 𝘁𝗵𝗲 𝘂𝗹𝘁𝗶𝗺𝗮𝘁𝗲 𝗰𝗵𝗲𝗮𝘁 𝘀𝗵𝗲𝗲𝘁 𝗜 𝘄𝗶𝘀𝗵 𝗜 𝗵𝗮𝗱 𝗯𝗲𝗳𝗼𝗿𝗲 𝗺𝘆 𝘀𝘆𝘀𝘁𝗲𝗺 𝗱𝗲𝘀𝗶𝗴𝗻 𝗶𝗻𝘁𝗲𝗿𝘃𝗶𝗲𝘄𝘀. #SoftwareEngineering #BackendDevelopment #APIDesign #SystemDesign #DistributedSystems #Microservices #Java #JavaDeveloper #WebSecurity #CloudArchitecture #SoftwareArchitecture
To view or add a comment, sign in
-
-
I spent two hours optimizing a slow query. Indexes. Rewrites. Stack Overflow rabbit holes. Then a senior engineer looked over my shoulder and typed two words. EXPLAIN ANALYZE. And just like that — the database told us exactly what it was doing. Every step. Every scan. Every place it was working too hard. I had been guessing. The answer was sitting in the query planner the whole time. That moment changed how I debug slow queries forever. I stopped assuming. Started asking the database itself. Because here's the thing nobody tells you early on — your database has opinions about your queries. It has a plan. A cost estimate. A reason it's slow. And it will tell you all of it. If you just know to ask. I don't touch a slow query without it now. Feel like I was handed a cheat code two years too late. What's the tool or command that made you feel like you'd been doing things the hard way all along? #SoftwareEngineering #BackendDevelopment #Databases #SQL #EngineeringLife #TechLessons #CodeLife
To view or add a comment, sign in
-
Stop Sending Fat Payloads If you’re building APIs, you’ve probably spent 99% of your time writing res.json(). We take JSON for granted, but as systems scale to millions of requests, the "JSON Tax" becomes real. Understanding the mechanics of Serialization and Deserialization is key to identifying your system's next bottleneck. The Core: Serialization & Deserialization In your server, data (like a User object or an Array) lives in Heap Memory. This memory location is just a pointer (e.g., 0x3E...). You cannot send a "memory pointer" over the internet to a client. Serialization: Converting an in-memory object (complex structure) into a format that can be transmitted over a network (like a String or Binary). Deserialization: The client receives that data and reconstructs it back into a usable object in its own memory. Why JSON isn’t always the answer JSON is human-readable and universal, but it has two major flaws: Size: It’s a text-based format. Every quote, brace, and key name adds bytes. Speed: Parsing a large string into a JavaScript object requires significant CPU cycles. MessagePack vs. Protobuf vs. JSON When every byte matters, binary formats win. Here is how they compare in efficiency: JSON: The baseline. Highly compatible but "fat." A 969-byte payload in JSON is standard, but often redundant. MessagePack (MsgPack): It’s like JSON but binary. It’s faster and smaller. In benchmarks, a JSON payload that takes 969 bytes can be compressed down to just 58 bytes (or nearly half for complex structures) using MessagePack. Protocol Buffers (Protobuf): Used heavily by Google and in gRPC. It uses a strict schema to serialize data into an extremely small binary format. It’s significantly faster than JSON but requires more setup (defining .proto files). How to Optimize Your Payloads Switch to Binary for Internal Services: If you are doing Server-to-Server communication (Microservices), stop using JSON. Use Protobuf or MessagePack to save on bandwidth and CPU. Schema-Based Transfer: By using a schema (like in Protobuf), you don't need to send "key names" (like "firstName", "email") over the wire every time. You only send the values. Audit Your Serialization Cost: If your server is hitting 100% CPU, check if it’s spending too much time stringifying massive objects. Next time you write a network call, remember: You aren't just sending data; you are paying a CPU and Bandwidth tax for how that data is packed. #SoftwareEngineering #WebDevelopment #Backend #SystemDesign #JSON #APIs #PerformanceOptimization #PiyushGarg
To view or add a comment, sign in
-
-
Choosing the wrong data structure can make your code 100x slower. Here is how to pick the right one! Every data structure has a specific use case. Using the wrong one is like using a hammer to cut wood. Array ✅ Fast random access by index (O(1)) ❌ Fixed size, slow insertions/deletions Use case: When you know the size and need fast lookups Queue (FIFO) ✅ First In, First Out operations Use case: Task scheduling, breadth-first search, handling requests Stack (LIFO) ✅ Last In, First Out operations Use case: Undo/redo, function calls, depth-first search, expression evaluation Linked List ✅ Fast insertions/deletions (O(1) at head) ❌ Slow search (O(n)) Use case: When you need frequent insertions/deletions, implementing queues/stacks Tree ✅ Hierarchical data, fast search in balanced trees (O(log n)) Use case: File systems, databases, decision trees, BST for sorted data Graph ✅ Represents relationships between entities Use case: Social networks, maps/routing, recommendation systems Matrix ✅ 2D data representation Use case: Image processing, game boards, mathematical computations Max Heap ✅ Fast access to maximum element (O(1)) Use case: Priority queues, finding top K elements, median streaming Trie ✅ Fast prefix searches (O(m) where m is string length) Use case: Autocomplete, spell checkers, IP routing HashMap ✅ Fast key-value lookups (O(1) average) Use case: Caching, counting occurrences, fast lookups HashSet ✅ Fast membership checks, no duplicates (O(1) average) Use case: Removing duplicates, checking existence Pro tip: The best data structure is not always the most complex one. Sometimes a simple array is all you need. Which data structure do you find yourself using the most? Share below! #DataStructures #Programming #Java #BackendDevelopment #Algorithms #SoftwareDevelopment
To view or add a comment, sign in
-
-
🚀 Day 8 — Search, Indexing, and Information Retrieval Most systems are not useful just because they store a lot of data. They become useful when people can actually find the right information quickly. That was my biggest takeaway from Day 8. Because in large systems, the challenge is not only storing documents, products, or records. It is organizing them in a way that makes search fast, relevant, and meaningful. Today’s focus was: Search, Indexing, and Information Retrieval 🔎 What I covered today 📘 🔍 Search system basics 📚 Inverted indexes and tokenization ⚙️ Indexing pipeline and document updates 📊 Ranking and relevance 📝 Exact match vs full-text search ⌨️ Autocomplete and prefix search 🗂️ Sharding, replication, and query fan-out in search systems What stood out to me ✅ Search systems are usually two systems in one: indexing and querying ✅ Inverted indexes make retrieval efficient, but tokenization and normalization have a huge impact on search quality ✅ Search is not just about finding matching documents, but about ranking them in a useful order ✅ A search system can be technically correct and still feel broken if the ranking is poor ✅ Near-real-time indexing is often a practical trade-off between freshness and performance ✅ Large-scale search brings its own challenges around sharding, replication, and query latency I also implemented a small Inverted Index Search sample in Python and Java to make the concept more practical. 🛠️ ➡️ Git: https://lnkd.in/d24hjg-J That helped me understand a simple but important idea: 📌 Search is not only about storing terms 📌 Relevance matters as much as retrieval speed 📌 Good search systems make large amounts of data actually usable This is one of those topics that looks simple in notes, but becomes much more interesting when you think about ranking, freshness, autocomplete, and distributed query flow in real systems. System Design is slowly becoming less about just storing data and more about making that data searchable, relevant, and useful at scale. On to Day 9 📈 #SystemDesign #DistributedSystems #BackendEngineering #SoftwareEngineering #ScalableSystems #SearchSystems #InformationRetrieval #InvertedIndex #Tokenization #Ranking #Relevance #Autocomplete #FullTextSearch #SystemArchitecture #Microservices #BackendDevelopment #CloudComputing #TechLearning #EngineeringJourney #DataEngineering #Indexing #QueryProcessing #SoftwareArchitecture #SearchEngineering #DatabaseSystems
To view or add a comment, sign in
-
Indexing & Query Optimization — What actually clicked for me After diving deep into databases, one thing became clear: -Performance is not about writing queries… - it’s about writing the right queries. -Indexing is not just a speed booster -Faster SELECT -Slower INSERT / UPDATE / DELETE Why? Because every write also updates the index (B-Tree structure). How I now identify a query needs optimization: -Works fine on small data, slow on large data -Execution plan shows Scan instead of Seek -High CPU / long execution time -Query patterns like: -SELECT * -Functions in WHERE (YEAR(date)) -Leading wildcard (%abc) -Too many joins without filtering Big mindset shift: “Indexes don’t make queries fast — making queries index-friendly does.” If you want to grow as a backend engineer: Stop just writing queries Start thinking like a query optimizer #SQL #Backend #Performance #Indexing #QueryOptimization #Learning #InterviewPrep #Developers
To view or add a comment, sign in
-
-
𝐈 𝐮𝐬𝐞𝐝 𝐭𝐨 𝐭𝐡𝐢𝐧𝐤 𝐔𝐔𝐈𝐃 𝐰𝐚𝐬 “𝐠𝐨𝐨𝐝 𝐞𝐧𝐨𝐮𝐠𝐡”… 𝐮𝐧𝐭𝐢𝐥 𝐈 𝐥𝐞𝐚𝐫𝐧𝐞𝐝 𝐭𝐡𝐢𝐬. In most backend systems, generating IDs feels trivial. Just use UUID, right? No coordination. No collisions. Done. But then you hit scale. 𝐓𝐡𝐞 𝐩𝐫𝐨𝐛𝐥𝐞𝐦 𝐬𝐡𝐨𝐰𝐬 𝐮𝐩 𝐢𝐧 𝐲𝐨𝐮𝐫 𝐝𝐚𝐭𝐚𝐛𝐚𝐬𝐞. Random IDs (like UUID): • Break index locality • Cause frequent page splits • Slow down inserts over time Your database silently becomes the bottleneck. 𝐓𝐡𝐢𝐬 𝐢𝐬 𝐰𝐡𝐞𝐫𝐞 𝐒𝐧𝐨𝐰𝐟𝐥𝐚𝐤𝐞 𝐜𝐡𝐚𝐧𝐠𝐞𝐬 𝐭𝐡𝐞 𝐠𝐚𝐦𝐞. Instead of randomness, it uses structure: 𝐓𝐢𝐦𝐞𝐬𝐭𝐚𝐦𝐩 + 𝐌𝐚𝐜𝐡𝐢𝐧𝐞 𝐈𝐃 + 𝐒𝐞𝐪𝐮𝐞𝐧𝐜𝐞 Which means: • IDs are time-ordered • Writes are sequential (better for indexes) • No central DB dependency 𝐁𝐮𝐭 𝐡𝐞𝐫𝐞’𝐬 𝐭𝐡𝐞 𝐫𝐞𝐚𝐥 𝐥𝐞𝐚𝐫𝐧𝐢𝐧𝐠 👇 Snowflake is NOT just about generating IDs. It forces you to think about: • How do you ensure unique machine IDs? • What happens if clocks drift backwards? • How do you handle concurrency safely? 𝐓𝐡𝐚𝐭’𝐬 𝐰𝐡𝐞𝐧 𝐢𝐭 𝐜𝐥𝐢𝐜𝐤𝐬: Distributed systems are not about code. They’re about handling uncertainty: • Time isn’t perfectly reliable • Systems aren’t perfectly synchronized • Failures are expected 𝐌𝐲 𝐛𝐢𝐠𝐠𝐞𝐬𝐭 𝐭𝐚𝐤𝐞𝐚𝐰𝐚𝐲 Choosing an ID strategy is not a small decision. It directly impacts: • Performance • Scalability • System design If you’re building backend systems today: Would you still pick UUID, or would you consider something like Snowflake/ULID? Curious to hear your thought process. #DistributedSystems #SystemDesign #BackendEngineering #DotNetDeveloper #Scalability #TechHiring #Microservices #DatabaseDesign
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development