
Join the Conversation!
Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.
"Please login to view comments"
Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.
By logging in, you'll unlock full access to this and other free tutorials on JSM Pro.
Why? Logging in lets us personalize your learning experience, track your progress, and keep you in the loop with new workshops, coding tips, and platform updates.
You'll also be the first to know about upcoming launches, events, and exclusive discounts.
No spam—just helpful content to level up your skills.
If that sounds fair, go ahead and log in to continue →
Enter your name and email to get instant access
##Looks like we found a thief monkey By the way, I liked the trick how you reached till here. You have a good sense of humor. You will improve a lot if you join our course with this passion.
var
(function-scoped, outdated)let
(block-scoped, modern and recommended)const
(block-scoped, cannot be reassigned)_
, or $
let let = 5;
is invalid)myVar
and myvar
are different)string
, number
, boolean
, null
, undefined
, bigint
, symbol
Objects
, Arrays
, Functions
Subscribing gives you access to a brief, insightful summary of each lecture to stay on track.
00:00:02 Now that you know how APIs work, let's dive into one of the most critical parts of backend development, databases.
00:00:09 At its core, a database is just a system that stores, organizes, and manages data.
00:00:16 But let's break it down into simpler terms.
00:00:19 Think of a database as a specialized software that lives on a computer somewhere, whether that's your laptop, a company server,
00:00:27 or a powerful machine in a remote data center.
00:00:30 Just like your laptop stores files on a hard drive or an SSD, databases store data.
00:00:37 But here's the difference.
00:00:39 Databases are optimized for speed, security, and scalability.
00:00:44 So whenever you log into Instagram, check out your bank account balance, or book a movie ticket, a database is working behind the scenes to fetch,
00:00:54 update, or store that information.
00:00:57 And databases come in different flavors, but they're broadly classified into two main types, relational and non-relational databases.
00:01:06 Relational databases store data in structured tables with rows and columns.
00:01:12 Much like a spreadsheet, relational databases use something known as SQL, a structured query language, which allows you to query and manipulate data.
00:01:23 And most popular SQL databases are MySQL or Postgres.
00:01:27 You might want to use those when your data is highly structured and relationships between entities are important.
00:01:35 Think banking systems, e-commerce platforms, or inventory management.
00:01:40 And if you're looking to learn SQL with the latest ORMs like Prisma, check out my SQL Databases course on jsmastery.pro.
00:01:48 I'll leave the link down below.
00:01:50 But with that said, let's explore non-relational databases, also referred to as noSQL databases.
00:01:57 They offer more flexibility and don't rely on a rigid structure of tables.
00:02:04 They handled unstructured or semi-structured data, making them perfect when data relationships are less complex.
00:02:11 There are also subtypes of NoSQL databases, such as DocumentBase, like MongoDB, which stores data in JSON-like documents.
00:02:20 And there's also some like Redis, which store data in simple key value pairs.
00:02:25 NoSQL databases are great when handling large volumes of data, real-time analytics, or flexible data models.
00:02:33 Think social media apps, IoT devices, or big data analytics.
00:02:38 And like with the SQL course, I also have a short and sweet course on MongoDB with Mongoose that covers everything from database basics to building a cool app.
00:02:48 So if you're into NoSQL databases, check it out.
00:02:51 Once again, the link is down below.
00:02:53 So let's be honest, which one is better?
00:02:56 Well, unfortunately, there's no one size fits all here.
00:03:00 It depends on your business needs, but let me keep it simple.
00:03:04 If you need structured data with clear relationships, go with relational or SQL database.
00:03:10 And if you're handling massive unstructured data or need flexibility, go for non-relational or non-SQL databases.
00:03:18 How would you actually make your backend application interact with that database?
00:03:24 Well, the flow is the same for both.
00:03:27 First, the client or your device sends a request to the backend.
00:03:31 For example, give me all my subscriptions.
00:03:35 Then, the server processes the request and determines what data is needed.
00:03:40 Then, the backend sends a query to the database to fetch, update, or delete that data.
00:03:47 For example, in SQL, that might look something like this, where you select everything from subscriptions where user ID is equal to something.
00:03:55 And in NoSQL, like MongoDB, it'll look something more similar to what you're used to.
00:04:00 db.subscriptions.find, and then you pass in the user ID.
00:04:05 Either way, the database will return the requested data to the server, and then the server formats that data, usually as JSON,
00:04:14 and sends it back to the client.
00:04:16 So that's it.
00:04:17 You just learned how your server or your app interacts with a database, and that is through queries.
00:04:24 We use queries to store, retrieve, update, or delete data in databases.
00:04:30 You could use raw queries like these ones here, and writing those gives you full control, but also it can get a bit tedious and error-prone as your project grows.
00:04:40 That's why many developers decide to use ORMs, Object Relational Mappers.
00:04:46 ORMs simplify database interactions by letting you write queries in a syntax of your programming language of choice, instead of writing raw SQL.
00:04:56 For SQL databases, popular ORMs are Prisma and Drizzle, or even SQLize.
00:05:02 And for no SQL like MongoDB, there's Mongoose.
00:05:06 Here's how it would look like to fetch a user using Postgres, and here's how it looks like to fetch it by using Mongoose.
00:05:15 These ORMs speed up the development and help you prevent errors, especially in larger projects.
00:05:21 And remember those database courses that I mentioned not that long ago?
00:05:24 Well, in those, I teach you how to use an ORM no matter which database you choose.
00:05:29 So, if you want to learn how to use an ORM, definitely bookmark them and then revisit them after watching this course.
00:05:36 But with that in mind, let's do a quick databases recap.
00:05:41 Databases are specialized software for storing, organizing, and managing data.
00:05:47 They come in two main types, relational SQL and non-relational NoSQL.
00:05:55 Relational databases use structured tables and SQL queries, while NoSQL offers flexibility with formats like documents and key value pairs.
00:06:05 And you can interact with both databases using either raw queries or simplify things using ORMs.
00:06:13 That was a lot to comprehend, right?
00:06:15 Don't worry, you don't have to get it at once.
00:06:18 From understanding clients and servers to APIs, backend logic and databases, there's a lot of moving parts.
00:06:26 and if it feels overwhelming, don't worry.
00:06:29 Take your time, revisit these concepts, and let them sink in.
00:06:33 It's all a part of building a solid foundation as a backend developer.
00:06:37 So, before we wrap up this course, there's one final piece to cover.
00:06:42 Backend architectures.
00:06:44 Because how you design your backend is just as important as the tools you use.
00:06:49 So, let's dive into that next.