Your FastAPI backend is fast to build. But is it fast to run? Most developers find out the answer at the worst possible moment when real users hit it at the same time. Endpoints slow down. Requests pile up. Users drop off. Not because the code is wrong. Because it is blocking. Here is what blocking actually looks like in production: Your user hits an endpoint. FastAPI calls the database. That query takes 200ms. During those 200ms your server is frozen. Not slow. Frozen. Every other request sits in a queue waiting for that one query to finish. 100 users hit your API at the same time. User 1 gets served. Users 2 to 100 wait in line. That is sync. That is blocking I/O. FastAPI was built to never work that way. With async/await while your database query runs in the background, your server is already picking up the next request. And the next. And the next. 200ms of database wait becomes invisible to every other user. In real backend terms. SYNC — blocks: def get_orders(user_id: int): return db.query(user_id) ASYNC — non blocking: async def get_orders(user_id: int): return await db.query(user_id) Same logic. Same database. Same server. But now 100 users get served in the time it used to take to serve 1. This matters even more when your endpoints call external services. 1. Payment gateway 300ms wait. 2. AI model response 2 to 3 seconds wait. 3. Email service 500ms wait. Sync every user feels every millisecond of every one of those waits. with Async none of them do. FastAPI gives you non-blocking I/O natively. No extra setup. No plugins. No workarounds. Just write async. Add await. Let FastAPI handle the rest. Your backend was already fast to build. Now make it fast to run. Are you using async endpoints in your FastAPI projects? 👇 #FastAPI #Python #BackendDevelopment #AsyncProgramming #SoftwareEngineering #APIDesign #PythonDeveloper #WebDevelopment #TechIn2026 #BuildInPublic
Lahiru Shiran’s Post
More Relevant Posts
-
𝗙𝗮𝘀𝘁𝗔𝗣𝗜 𝗶𝘀 𝗺𝗼𝗿𝗲 𝘁𝗵𝗮𝗻 𝗷𝘂𝘀𝘁 "𝗳𝗮𝘀𝘁." 𝗜𝘁’𝘀 𝗮 𝗺𝗮𝘀𝘁𝗲𝗿𝗰𝗹𝗮𝘀𝘀 𝗶𝗻 𝗗𝗲𝘃𝗲𝗹𝗼𝗽𝗲𝗿 𝗘𝘅𝗽𝗲𝗿𝗶𝗲𝗻𝗰𝗲 (𝗗𝗫). 💎 Most developers switch to FastAPI for the benchmark speeds, but they stay for the architectural "Hidden Gems" that make production-grade code actually maintainable. If you’re building scalable backends, these 3 features are game-changers: 1️⃣ 𝗧𝗵𝗲 𝗣𝗼𝘄𝗲𝗿 𝗼𝗳 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆 𝗜𝗻𝗷𝗲𝗰𝘁𝗶𝗼𝗻 (𝗗𝗜) FastAPI’s DI system isn't just for database sessions. It’s a tool for clean architecture. By creating hierarchical dependencies, you can inject authentication or logging logic across routes effortlessly. 2️⃣ 𝗘𝗳𝗳𝗶𝗰𝗶𝗲𝗻𝘁 𝗕𝗮𝗰𝗸𝗴𝗿𝗼𝘂𝗻𝗱 𝗧𝗮𝘀𝗸𝘀 Stop making your users wait for emails or logs to process. You don't always need the overhead of Celery or RabbitMQ. With the BackgroundTasks class, you can execute logic after the response is sent. 3️⃣ 𝗠𝗼𝘂𝗻𝘁𝗶𝗻𝗴 𝗦𝘂𝗯-𝗔𝗽𝗽𝗹𝗶𝗰𝗮𝘁𝗶𝗼𝗻𝘀 Why clutter one file when you can mount entire FastAPI instances within a main app? This is the secret to clean API Versioning (v1 vs v2) and isolating microservices within a monorepo. Speed gets you noticed, but using these features is what keeps a codebase from becoming technical debt. Are you leveraging these in your current stack, or sticking to the basics? Let’s talk architecture in the comments. 👇 #Python #FastAPI #BackendEngineering #SystemDesign #CleanCode #SoftwareArchitecture #AWS
To view or add a comment, sign in
-
-
Most of us have requests baked into our muscle memory, but as web standards move toward HTTP/3 and high-concurrency, the "old reliable" is starting to show its age. I’ve been diving into Niquests, and it’s a serious contender for the new standard. It’s designed as a drop-in replacement, meaning you get a massive performance boost without the headache of a refactor. What makes it a "pro" choice: - Protocol Support: It handles HTTP/2 and HTTP/3 natively. If you're hitting modern APIs, this isn't just a "nice to have"—it’s a massive efficiency gain. - Multiplexing: You can send multiple requests over a single connection. This eliminates the handshake overhead that usually slows down bulk data fetching. - True Async Compatibility: Unlike the original requests library, this is built to play nice with asyncio, making it ideal for high-traffic backend services. - Performance: In standard benchmarks, it significantly outperforms HTTPX and AIOHTTP in request-heavy loops. If you’re building production-grade scrapers, microservices, or data pipelines, the switch is almost a no-brainer. It’s the same API we love, just supercharged for 2026. Check out the project on GitHub: https://lnkd.in/d98Zy_cc #Python #SoftwareEngineering #Backend #Performance #DataEngineering #OpenSource
To view or add a comment, sign in
-
Switched to FastAPI. Never looked back. Before FastAPI, building an API meant setting up boilerplate for 2 hours before writing a single line of actual logic. Sound familiar? Then FastAPI happened. The first thing that broke the brain — Swagger docs auto-generated themselves. No extra library. No config file. No setup. Just ran the server and there it was. The second thing — Pydantic validation stopped bad data at the door. Wrong data type? Rejected. Missing field? Rejected. Before it even touched the database. No manual checks. No if-else chains. Nothing. Framework just handled it like a senior dev who's seen too much. The third thing is async endpoints that actually perform. 1000 concurrent requests. Not a single sweat. 💀 What FastAPI actually teaches: The best tools don't just save time. They change how problems are solved. Less fighting the framework. More building the product. Less boilerplate. More logic that actually matters. Every Python backend developer still sleeping on FastAPI — The market already moved on. Your stack should too.
To view or add a comment, sign in
-
-
I’m starting to realize backend development is a lot more than just creating endpoints. This week, I went deeper into backend development with FastAPI and started connecting the pieces behind how APIs actually work. Beyond just building endpoints, I began understanding how APIs communicate through HTTP status codes and how data is managed behind the scenes. One thing that stood out to me: Understanding status codes makes debugging much easier. Instead of guessing what went wrong, you can quickly narrow down whether the issue is coming from the client or the server. I also started exploring the data side of backend systems, how databases store information and how SQL is used to perform operations like creating, reading, updating, and deleting data. Step by step, I’m starting to see how APIs, databases, and backend logic all connect to form real backend systems. Still early in the learning process, but it’s exciting to see the bigger picture becoming clearer. Screenshots: Image 1: FastAPI endpoint tested using Swagger UI, demonstrating query parameter filtering (book_rating) and the JSON response returned by the API. #BackendDevelopment #FastAPI #Python #SoftwareEngineering #LearningInPublic #APIs #WebDevelopment #RESTAPI #BackendEngineer #CodingJourney
To view or add a comment, sign in
-
-
They say 90% of software engineering is debugging, and today I definitely felt that! 😂 After a marathon session of untangling server conflicts, navigating API versioning updates, and restructuring database schemas on the fly, I am thrilled to finally share my latest project: NutriScan-AI. 🚀🍏 I wanted to build something that bridged the gap between raw data and practical, everyday AI. NutriScan-AI is a full-stack web application that allows users to snap a photo of any meal and instantly receive a complete nutritional breakdown and ingredient analysis. 🧠 How it works under the hood: Frontend: A clean, dark-mode UI built with HTML/CSS that handles user image uploads. Backend: A robust Python (Flask) server handling the API routing and logic. AI Integration: Integrated Google's Gemini 2.5 Flash Vision API to process the image pixels and accurately identify complex food items. Database: Engineered a PostgreSQL relational database to securely log user scans and perform fuzzy-search lookups for detailed macro-nutrients (Calories, Protein, Carbs, Fat). git - https://lnkd.in/gW7VqJrM Always learning, always building. On to the next challenge! #ArtificialIntelligence #Python #Flask #PostgreSQL #FullStackDevelopment #GeminiAI #SoftwareEngineering #TechJourney #StudentDeveloper
To view or add a comment, sign in
-
From Node.js to FastAPI — My Backend Learning Shift As someone with a strong background in Node.js (Express), I recently started exploring FastAPI — and the experience has been eye-opening. Here are some key differences I observed 🔹 Dependency Injection (Built-in) In Node.js, we manually handle middleware and pass data via req/res. In FastAPI, Depends() automatically injects dependencies — cleaner and scalable. 🔹 Automatic Validation with Pydantic No need for external libraries like Joi. FastAPI validates, parses, and enforces types out of the box. 🔹 Database Session Management Using yield in dependencies ensures: ✔ Proper DB connection handling ✔ Automatic cleanup after response ✔ No memory leaks 🔹 Async First Architecture FastAPI is built on Starlette, making async operations seamless and high-performing. 🔹 Developer Experience ✔ Auto-generated Swagger docs ✔ Type safety ✔ Less boilerplate 💡 Key Insight: FastAPI doesn’t just give features — it enforces better architecture patterns by design. 📌 My Take: Node.js is still powerful and flexible, but FastAPI provides a more structured and optimized approach for building modern APIs. #FastAPI #NodeJS #BackendDevelopment #Python #WebDevelopment #SoftwareEngineering #LearningJourney AiFA Labs
To view or add a comment, sign in
-
-
Built a personal project called 𝗥𝗲𝗲𝗹𝗩𝗮𝘂𝗹𝘁 over the past few weeks and wanted to share what went into it. 𝗧𝗵𝗲 𝗽𝗿𝗼𝗯𝗹𝗲𝗺 𝗜 𝘄𝗮𝘀 𝘀𝗼𝗹𝘃𝗶𝗻𝗴: I watch a lot of content on Instagram and YouTube about AI tools, open source models, and dev resources. I kept losing track of things I wanted to revisit. 𝗖𝗼𝗺𝗺𝗲𝗻𝘁𝘀 𝗮𝗻𝗱 𝗯𝗼𝗼𝗸𝗺𝗮𝗿𝗸𝘀 𝗱𝗼 𝗻𝗼𝘁 𝗰𝘂𝘁 𝗶𝘁. So I built a full-stack application where I can save any link, reel, or note and 𝘀𝗲𝗮𝗿𝗰𝗵 𝗶𝘁 𝗹𝗮𝘁𝗲𝗿 𝘂𝘀𝗶𝗻𝗴 𝗻𝗮𝘁𝘂𝗿𝗮𝗹 𝗹𝗮𝗻𝗴𝘂𝗮𝗴𝗲. Not keyword search. Meaning-based search. Tech used: Backend — 𝗝𝗮𝘃𝗮 𝟮𝟭 with Spring Boot 3.2, Spring Data JPA, REST APIs Database — 𝗣𝗼𝘀𝘁𝗴𝗿𝗲𝗦𝗤𝗟 with 𝗽𝗴𝘃𝗲𝗰𝘁𝗼𝗿 extension on Supabase Embeddings — 𝗛𝘂𝗴𝗴𝗶𝗻𝗴 𝗙𝗮𝗰𝗲 Inference API using sentence-transformers/all-MiniLM-L6-v2 to convert 𝘁𝗲𝘅𝘁 𝗶𝗻𝘁𝗼 𝟯𝟴𝟰-𝗱𝗶𝗺𝗲𝗻𝘀𝗶𝗼𝗻𝗮𝗹 𝘃𝗲𝗰𝘁𝗼𝗿𝘀 Search — Cosine similarity search using 𝗽𝗴𝘃𝗲𝗰𝘁𝗼𝗿'𝘀 𝗶𝘃𝗳𝗳𝗹𝗮𝘁 𝗶𝗻𝗱𝗲𝘅 𝗧𝗲𝗹𝗲𝗴𝗿𝗮𝗺 𝗕𝗼𝘁 — built into the Spring Boot service, lets me send a URL and get it saved automatically with metadata extracted via Jsoup Frontend — Vanilla HTML, CSS, JS 𝗱𝗲𝗽𝗹𝗼𝘆𝗲𝗱 𝗼𝗻 𝗩𝗲𝗿𝗰𝗲𝗹 Deployment — 𝗗𝗼𝗰𝗸𝗲𝗿𝗶𝘇𝗲𝗱 𝗦𝗽𝗿𝗶𝗻𝗴 𝗕𝗼𝗼𝘁 𝗮𝗽𝗽 𝗼𝗻 𝗥𝗲𝗻𝗱𝗲𝗿 What I learned from actually shipping it: Hugging Face free tier uses a different endpoint than documented. Had to debug a 404 mid-production. Render is IPv4 only so Supabase Direct Connection does not work. Transaction Pooler with stringtype=unspecified in the JDBC URL is the fix. pgvector requires data to exist before the ivfflat index is useful. This project gave me hands-on experience with vector embeddings, semantic search, RAG-adjacent architecture, and end-to-end deployment on free-tier infrastructure. 𝗚𝗶𝘁𝗛𝘂𝗯 𝗹𝗶𝗻𝗸 𝗶𝗻 𝗰𝗼𝗺𝗺𝗲𝗻𝘁𝘀. #Java #SpringBoot #SemanticSearch #VectorDatabase #pgvector #HuggingFace #BackendDevelopment #FullStackDevelopment #RAG #GenerativeAI #AIEngineering #PostgreSQL #Docker #SoftwareEngineering #OpenSource
To view or add a comment, sign in
-
The Try-Catch Time Trap: Why Async Errors Escape? Lets look at this code that reads and parse the invalid JSON file. Sync code try { const data = fs.readFileSync("invalid.json", "utf-8"); const jsonData = JSON.parse(data); } catch (err) { console.log("error caught:", err.message); // catches parsing error } All good. --- Async code try { fs.readFile("invalid.json", "utf-8", (err, data) => { const jsonData = JSON.parse(data); }); } catch (err) { console.log("error caught:", err.message); // does NOT even run } Catch block won't execute. Now the question is… 👉 Why? --- Here’s how I started thinking about it: If JS finds an error → it stops execution → looks for a catch block in the current call stack → if not found, it bubbles up the stack --- In sync code: 👉 Everything runs in one continuous stack → error happens → catch block is right there → so it works --- But async changes things. When this line runs: fs.readFile(..., callback) 👉 JS does NOT execute the callback immediately Instead: → it registers the callback → pushes it to the event loop → and moves on --- Now important part 👇 👉 The current call stack finishes execution → which means try-catch is gone --- Later… 👉 when file reading is done → event loop pushes the callback to the call stack → callback runs But now: 👉 this is a new call stack And the old try-catch? 👉 already gone. --- So when error happens inside callback: ❌ there is no catch block anymore --- That’s when it clicked for me: 👉 try-catch works only within the same execution stack Not across time. Not across async boundaries. #JavaScript #Node #Programming #ErrorHandling #Interview #Eventloop #Callstack
To view or add a comment, sign in
-
Data extraction from modern enterprise websites in 2026 is officially an extreme sport. 🧗♂️ If you’ve tried to pull data from large-scale hospitality or e-commerce systems lately, you’ve likely slammed into a brick wall. The "Standard Stack" (Python Requests + BeautifulSoup) just isn't cutting it anymore. You're probably seeing: ❌ 403 Forbidden errors on the first attempt. ❌ TLS Fingerprinting that identifies your script in milliseconds. ❌ IP Bans after fewer than 5 requests. ❌ Anti-bot walls feel impossible to scale. Standard headers aren't enough when the server is looking at your JA3 fingerprint and HTTP/2 settings. The Good News? There is a way through. 🛠️ Over the past few weeks, I’ve been reverse-engineering to understand the process. I’ve built a production-grade, asynchronous system specifically for hotel booking APIs that uses a methodology to extract the data by providing the required assessment. In my next post, I’ll dive into the exact architecture and the specific Python libraries I’m using to build the system. What’s the toughest challenge you’ve faced down recently? Let's swap war stories in the comments. 👇 #WebScraping #DataEngineering #Python #Backend #SoftwareDevelopment #APIs #SunnyJaiswal
To view or add a comment, sign in
-
Building a CRUD API with FastAPI One of the first practical projects backend developers build is a CRUD API, which allows applications to Create, Read, Update, and Delete data. Using FastAPI, developers can build these APIs quickly while maintaining strong performance and clean code architecture. FastAPI uses Python type hints and modern asynchronous features to simplify both request validation and response handling. In a typical CRUD API, developers define models representing resources such as users, posts, or products. These models describe the structure of the data and help ensure that requests contain valid information. FastAPI integrates with libraries like Pydantic to automatically validate incoming data, reducing the risk of incorrect or malformed requests reaching the database. Beyond simplicity, FastAPI provides automatic API documentation using OpenAPI and Swagger UI. This allows developers to test endpoints directly in the browser without needing external tools. As a result, FastAPI not only speeds up development but also improves collaboration between backend developers, frontend developers, and API consumers. #FullStackDeveloper #WebEngineering #TechCommunity #BuildInPublic #LearnToCode
To view or add a comment, sign in
-
More from this author
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