I built a simple key-value store (Node.js + TypeScript) to understand how databases work under the hood. I started as just Map wrapper and turned into: - write-ahead logging (WAL) - snapshots + compaction -TTL using a min-heap - a basic TCP protocol A few things clicked while building this: - In-memory is easy. Durability is not. - Every performance gain comes with a tradeoff - Logs grow forever unless you manage them - Even TTL needs the right data structure to scale This is far from production-ready (no replication, no strong durability guarantees), but that wasn’t the goal. The goal was to learn by building. And it definitely changed how I look at systems like Redis and RocksDB.
Building a Simple Key-Value Store with Node.js and TypeScript
More Relevant Posts
-
Adding a database to your stack shouldn't be a chore, which is why we've streamlined the MongoDB Node.js driver experience for maximum efficiency. This 60-second walkthrough demonstrates how to pull in the driver via npm, connect to Atlas, and execute find operations with minimal code. It’s a clean, straightforward process that ends with a simple terminal command to see your results in real-time. If you're looking for the path of least resistance for your next project, this is it. https://lnkd.in/diNM9hZ2
MongoDB Node.js Quick Start: Connect in Under 60 Seconds
https://www.youtube.com/
To view or add a comment, sign in
-
My Node.js API started slowing down as traffic increased — here’s what actually fixed it. At first, I assumed it was just “Node being single-threaded.” Wrong. After profiling, I found: • Event loop was getting blocked by heavy JSON processing • Some DB queries were unindexed and slow • Repeated API calls were hitting the database unnecessarily Fixes that made the difference: • Moved CPU-heavy work to worker threads • Added Redis caching for repeated queries • Optimized SQL queries and added indexes Result: ~40% reduction in response time under load. Biggest lesson: Performance issues are usually architectural, not language limitations. Where do you usually start when debugging performance issues? #NodeJS #BackendEngineering #WebPerformance #APIDesign #PerformanceOptimization #SystemDesign #Scalability
To view or add a comment, sign in
-
Adding a database to your stack shouldn't be a chore, which is why we've streamlined the MongoDB Node.js driver experience for maximum efficiency. This 60-second walkthrough demonstrates how to pull in the driver via npm, connect to Atlas, and execute find operations with minimal code. It’s a clean, straightforward process that ends with a simple terminal command to see your results in real-time. If you're looking for the path of least resistance for your next project, this is it. https://lnkd.in/gzJTMxE9
MongoDB Node.js Quick Start: Connect in Under 60 Seconds
https://www.youtube.com/
To view or add a comment, sign in
-
Adding a database to your stack shouldn't be a chore, which is why we've streamlined the MongoDB Node.js driver experience for maximum efficiency. This 60-second walkthrough demonstrates how to pull in the driver via npm, connect to Atlas, and execute find operations with minimal code. It’s a clean, straightforward process that ends with a simple terminal command to see your results in real-time. If you're looking for the path of least resistance for your next project, this is it. https://lnkd.in/gEhZaDXe
MongoDB Node.js Quick Start: Connect in Under 60 Seconds
https://www.youtube.com/
To view or add a comment, sign in
-
🚀 ShieldGate – Day 3 & Day 4 Update Building my own API Rate Limiter & Monitoring System (MERN + Redis) from scratch. After setting up the basics, I focused on the core backend logic and performance 👇 ⚙️ Day 3: Sliding Window Rate Limiting (Core Logic) Implemented a Sliding Window Log Algorithm using Redis Sorted Sets ✔ Tracks requests per IP in real-time ✔ Removes outdated requests automatically ✔ Ensures accurate rate limiting within a time window 📊 Result: Backend can decide in <50ms whether to allow or block a request 🛡️ Day 4: Middleware Integration + Performance Optimization Built a reusable Express Middleware (shieldGate) and optimized it for real-world performance. 🔹 Middleware (Plug & Play System) ✔ Automatically intercepts every request ✔ Calls central rate limiter service ✔ Blocks excessive requests (429 status) ✔ Fail-safe design (continues even if limiter fails) ⚡ Performance Optimization (Caching) Enhanced middleware using in-memory caching ✔ Reduced unnecessary API calls ✔ Implemented Cache HIT / MISS strategy with TTL ✔ Improved response time from ~600ms → ~7ms ⚡ 🧠 Key Learnings Middleware execution order is critical Avoid infinite loops in internal API calls Caching significantly improves performance System design is about how components communicate efficiently 🛠️ Tech Stack Node.js • Express • Redis • MongoDB • Docker • Axios 🔗 GitHub Repository 👉 https://lnkd.in/gcEpiMsp . . . . . #BackendDevelopment #SystemDesign #Redis #NodeJS #MERN #SoftwareEngineering #100DaysOfCode
To view or add a comment, sign in
-
-
Github :- https://lnkd.in/dVUnVVBB Developed a full-stack CRUD application using Node.js, Express, MongoDB, and EJS. Implemented Create, Read, Update, and Delete operations with server-side rendering and real-time data storage, updating, and deletion.
To view or add a comment, sign in
-
I usually just spin up MongoDB and call it a day. However, I wanted to explore how databases work under the hood, so I built a mini-database from scratch using Node.js and a plain .txt file. This project initially seemed a bit crazy, but it forced me to learn about: - Using Node streams to prevent memory crashes - Safely updating and deleting records in a flat file - The importance of basic indexing as a lifesaver You don't truly understand a tool until you attempt to build a basic version of it yourself. I wrote a quick breakdown of the code and what I learned. #Nodejs #Backend #SystemDesign https://lnkd.in/gcdZ2yQj
To view or add a comment, sign in
-
Most backend problems don’t come from APIs… They come from data consistency over time. Recently, we faced an issue while handling multi-currency support. We were: • Fetching exchange rates from an external API • Storing them in our database • Using Redis to cache values for performance Everything worked fine… until it didn’t. The problem: Exchange rates change daily (e.g., 1 USD = 91 → 92 INR), but our system was still using old cached data. This led to incorrect calculations. 🔧 Solution we implemented: • Introduced a Cron Job (runs every 1 hour) • Fetch latest exchange rates from API • Update values in database • Clear Redis cache • Re-cache fresh data on next request 💡 Key takeaway: Caching improves performance, but without proper invalidation → it breaks correctness. Cron jobs helped us keep: ✔ Data fresh ✔ Cache in sync ✔ System reliable Backend is not just about storing data… It’s about keeping it accurate over time. #BackendDevelopment #NodeJS #Redis #CronJobs #SystemDesign #LearningInPublic
To view or add a comment, sign in
-
Lightstream 0.6.0-beta.1 is here: Real-time sync + Historical Backfills. 🚀 This version makes it easier than ever to move data between different systems without the typical headache(I mention them below). What’s new? -> Backfills: You can now move old data just as easily as new data. Whether you want to move a whole table or just a specific date range, Lightstream handles it in configurable "chunks" so it doesn't overwhelm your destinations. -> Target Diversity: You can now stream data from Postgres into Postgres, MongoDB, or even HTTP Webhooks all at once. -> Debugging: Ever wonder why a sync failed? We now save the "Executed Query" + plus the error for every failed record-change. You can see the exact SQL, Mongo command, or CURL request that was sent, making debugging incredibly fast. Give it a spin: The latest version is available now on Docker Hub. docker pull lightstreamdotsh/engine:0.6.0-beta.1 #DataEngineering #Postgres #MongoDB #Golang #ETL #CTO #Lightstream
To view or add a comment, sign in
-
Backend systems look simple… until you think about how they behave with real users, retries, and concurrent requests ⚡ I built a ride-sharing backend using Spring Boot, MySQL, Redis, and Flyway to explore what actually goes into designing a system like this beyond basic APIs 🚖 The system supports: • Rider and driver management 👤 • Real-time driver location updates 📍 • Nearest-driver matching 🚗 • Idempotent ride requests using request IDs 🔁 • Concurrency-safe driver assignment to prevent double booking 🔒 • Redis caching for faster driver lookups ⚡ • Database indexing and query optimization for efficient matching 📊 I also used k6 to simulate concurrent traffic and see how the system behaves when multiple requests hit at the same time. Working on this gave me a much clearer understanding of how backend systems are designed to stay consistent and reliable under real-world conditions. Github: https://lnkd.in/gZh_f4TS Would love to hear your thoughts or feedback 👍 #BackendEngineering #SystemDesign #SpringBoot #JavaBackend
To view or add a comment, sign in
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