Databases and mongoDB
In computer science, a database is an organized collection of data, a structured way of collecting and storing information. It is based on the DBMS (Database Management System), which means you can create, delete, edit, and retrieve data. The DBMS software manages everything, including the storage.
Create a http server using Node JS
We covered a lot of theory, investigating Node.js from its beginnings to 2025, and now it’s time to take action. But be patient — we'll start with some theory to set the context of what a server is, and then write something. Today, your VS Code or code editor won’t be alone. Node.js will be part of your code base, and we will write something. So, what are we waiting for? Let's begin! We'll read about servers, what development means, what a proxy server is, and what DNS is. Then, we’ll create a server
LibUV Thread Pool: Deep Dive
Welcome back! If you haven’t read the previous blog about the two friends, go and check that out first because things are getting more interesting. We’ve received an official FIR against Node.js, and when Node.js faced trouble, it called in its two best friends for help. One of them, V8, was already investigated in our last episode. Now, it’s time to bring in the second friend: Libuv.
libuv & Event Loop
As we know, Node.js has two main parts, like the duo Jai and Veeru: the V8 engine and libuv. Let’s take a closer look at libuv. Just like the V8 engine has its hidden parts, you can learn more about it by clicking here. Now, let’s focus on libuv. Whenever V8 (Jai) can’t handle something—like file access, network calls, or timers—it gives the task to libuv. Also, when these tasks run, we often use callback functions, which are executed after libuv finishes the job.
sync, async, setTimeoutZero in Node.js
In the last few sessions, we have seen how Node.js code runs. If something is synchronous, the V8 engine handles it, or in case of asynchronous tasks, libUV steps in. You can think of Node.js having two best friends, like Jai and Veeru. Whenever a problem (or code) comes in, they handle it accordingly.
libuv & async IO in Node.js
If you read Node.js's definition, it mentions an event-driven architecture and its ability to handle asynchronous I/O. These two concepts are crucial to understand, so take your time to read and grasp them thoroughly. We know JavaScript is a synchronous, single-threaded language, meaning the code runs in one direction like a one-way road, with one task executing at a time.
Diving into the NodpeJS Github repo
As we know, each module in Node.js has its own scope. How does Node.js achieve this? In JavaScript, we follow the Principle of Least Privilege (PoLP), which is related to functions and scope. If you're unfamiliar, you can Google it. The idea is to only expose what is necessary to the global scope, keeping everything else private. To achieve PoLP, wrap your code in a function or immediately invoke it (IIFE).
Module.exports & require
As you saw in the last episode, we wrote our first line of code in Node.js. Now, we could just keep adding whatever we want to app.js, and technically, it would work. But that's not the best way to do things because the file would get cluttered and hard to manage. Instead, we need multiple files.So, you'll use require to include different modules into your main file.
Let's write code
Systems Design is the process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. It involves translating user requirements into a detailed blueprint that guides the implementation phase. The goal is to create a well-organized and efficient structure that meets the intended purpose while considering factors like scalability, maintainability, and performance.
JavaScript on Server
Discover how JavaScript powers server-side development with Node.js, transforming the way web applications are built. Node.js is a fast, scalable runtime that enables asynchronous, event-driven programming, making it ideal for real-time applications like chat apps and streaming services. You'll also learn to build server-side applications from scratch, manage dependencies with npm, and use frameworks like Express.js.
Why GraphQL over Rest APIs
Many companies today use GraphQL. In this blog, we’ll explore what GraphQL is, its benefits, and why it’s so popular. Suppose your app needs information about continents, countries, and languages. If you’re using REST APIs, you’ll likely call multiple APIs to fetch this data and then organize it for your frontend. Be patient—it’s not an Instagram Reel, but for serious learners, it’ll be worth the read.
HTTP Headers Methods Status Codes and Rest API Deep Dive
If you are a junior developer, a senior developer, or just a complete newbie, this is going to be a great place to learn about REST APIs—what they are, why they are used, and how they work. This is going to be a long blog, so it’s for serious readers. If you prefer short TikTok-like videos for instant information, this might not be for you. Let’s get started!
10 Proven Strategies to Optimize Web Application Performance
June 1, 2024
- #system-design
- #interview-prep
- #lld
In today's fast-paced digital world, user experience plays a crucial role in the success of any web application. Users expect lightning-fast loading times and seamless interactions, and any lag or delay can lead to frustration and abandonment. Therefore, optimizing the performance of your web application is paramount. In this blog post, we'll explore ten proven strategies to enhance the performance of your web application, ensuring a smoother and more enjoyable user experience.
API Architecture - Design Best Practices for REST APIs
REST which stands for Representational State Transfer is an architectural style that governs how APIs are designed and built. REST’s popularity and ease of implementation make it the most preferred API architectural style for modern-day software development as compared to other protocols such as SOAP (simple object access protocol). REST APIs or RESTful web services have become the backbone for efficient communication between client and server in modern-day software development. However, to build efficient and robust REST APIs, it is crucial to follow some standard best practices. In this blog, we’ll explore REST API best practices that can help you build scalable, maintainable, secure, and robust APIs.
Rate Limiting
Rate limiting runs within an application, rather than running on the web server itself. Typically, rate limiting is based on tracking the IP addresses that requests are coming from, and tracking how much time elapses between each request. The IP address is the main way an application identifies who or what is making the request. A rate limiting solution measures the amount of time between each request from each IP address, and also measures the number of requests within a specified timeframe. If there are too many requests from a single IP within the given timeframe, the rate limiting solution will not fulfill the IP address's requests for a certain amount of time.
Consistent Hashing Algorithm
Consistent hashing is a distributed hashing technique used in computer science and distributed systems to achieve load balancing and minimize the need for rehashing when the number of nodes in a system changes. It is particularly useful in distributed hash tables (DHTs), distributed caching systems, and other distributed storage systems. Consistent hashing is a technique used in computer systems to distribute keys (e.g., cache keys) uniformly across a cluster of nodes (e.g., cache servers). The goal is to minimize the number of keys that need to be moved when nodes are added or removed from the cluster, thus reducing the impact of these changes on the overall system.
ACID TRANSACTIONS
ACID transactions refer to a set of properties that are designed to ensure the reliability and consistency of database transactions. The term “ACID” stands for Atomicity, Consistency, Isolation, and Durability, which are the four key properties of an ACID transaction. Essentially, ACID transactions guarantee that database operations are executed correctly, and if there is any kind of failure, the database can recover to a previous state without losing any data or impacting the consistency of the data. In other words, ACID transactions provide a high level of assurance that database transactions will be processed reliably and that data will be stored accurately and consistently.
What is System Design
Systems Design is the process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. It involves translating user requirements into a detailed blueprint that guides the implementation phase. The goal is to create a well-organized and efficient structure that meets the intended purpose while considering factors like scalability, maintainability, and performance.
What is System Design
Systems Design is the process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. It involves translating user requirements into a detailed blueprint that guides the implementation phase. The goal is to create a well-organized and efficient structure that meets the intended purpose while considering factors like scalability, maintainability, and performance.
What is System Design
Systems Design is the process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. It involves translating user requirements into a detailed blueprint that guides the implementation phase. The goal is to create a well-organized and efficient structure that meets the intended purpose while considering factors like scalability, maintainability, and performance.
What is System Design
Systems Design is the process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. It involves translating user requirements into a detailed blueprint that guides the implementation phase. The goal is to create a well-organized and efficient structure that meets the intended purpose while considering factors like scalability, maintainability, and performance.
What is System Design
Systems Design is the process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. It involves translating user requirements into a detailed blueprint that guides the implementation phase. The goal is to create a well-organized and efficient structure that meets the intended purpose while considering factors like scalability, maintainability, and performance.
E1: History of node js in depth
Systems Design is the process of defining the architecture, components, modules, interfaces, and data for a system to satisfy specified requirements. It involves translating user requirements into a detailed blueprint that guides the implementation phase. The goal is to create a well-organized and efficient structure that meets the intended purpose while considering factors like scalability, maintainability, and performance.
What is System Design?
Systems Design is a critical discipline in software engineering, focused on creating a detailed blueprint for a system’s architecture, components, modules, interfaces, and data. It is a structured approach to designing complex systems that meet specific requirements and perform efficiently under varying conditions. The primary goal of systems design is to translate user needs, business goals, and technical constraints into a well-organized and effective system structure. Systems design bridges the gap between these requirements and the actual implementation, ensuring the system is both usable and efficient.
CAP Theorem for Databases: Consistency, Availability & Partition Tolerance
In computer science, the CAP theorem, sometimes called CAP theorem model or Brewer’s theorem after its originator, Eric Brewer, states that any distributed system or data store can simultaneously provide only two of three guarantees: consistency, availability, and partition tolerance (CAP). During times of normal operations, a data store covers all three. However, according to the CAP theorem, a distributed database system can provide either consistency or availability when it experiences a network failure. In other words, in case of a network failure, it’s a tradeoff between consistency or availability, and that choice must be made in advance.
System Design: Scalability
Scalability is a crucial aspect of system design, especially in today’s world of rapidly growing data and user bases. As applications and services become more popular, they must be able to handle increased traffic and data without compromising performance or reliability. In this article, we will explore what scalability is, why it is important, and how to achieve it in system design. The truth is, many of us don’t dive deep enough into scalability to truly grasp its significance in system design. Consequently, we fail to impress interviewers who are looking for candidates with a comprehensive understanding of this crucial aspect.