The Journey of #100DaysOfCode(@ZahraaElhek)

Hello community!

I’ve been challenged to start the #100DayCodeChallenge, and guess what?! Challenge Accepted!! So for the next 100 days, I’ll be sharing my knowledge, learning, and experiences.

Below is my progress from previous days, and I’ll now be updating regularly from today. If you’re up for it, join me on this adventure!

Yay! That’s so great to hear @Zahraa_HeK. I wish you the very best on this challenge, and can’t wait to see you reach day 100 :tada:

2 Likes

Day 1: MongoDB: The Modern Database Powering Next-Gen Apps

In today’s data-driven world, MongoDB has emerged as one of the most popular NoSQL databases , offering unmatched flexibility, scalability, and performance. But what makes it stand out from traditional databases? And why should you consider it for your next project?

What is MongoDB?

MongoDB is a non-relational (NoSQL) database that stores data in flexible, JSON-like documents (in a format called BSON). Unlike rigid table structures in SQL databases like MySQL, MongoDB uses collections of documents, allowing dynamic schemas—perfect for rapidly evolving applications.

Key Features of MongoDB

1. Flexible Data Structure

No fixed schema means you can modify data fields on the fly without complex migrations.

2. Blazing-Fast Performance

Thanks to advanced indexing and optimized storage, MongoDB delivers high-speed queries even with large datasets.

3. Horizontal Scalability (Sharding)

Easily distribute data across multiple servers to handle massive workloads—ideal for high-traffic apps.

4. Powerful Querying & Analytics

Supports rich queries, full-text search, and Aggregation Pipelines for complex data processing.

5. High Availability

Replica Sets ensure zero downtime by automatically failing over if a server crashes.

Day2: Relational vs. NoSQL Databases: Choosing the Right Tool for the Job

Part 1: Relational Databases (RDBMS) – The Structured Foundation

  • What Are Relational Databases?
    Relational databases, such as MySQL, PostgreSQL, and Microsoft SQL Server, organize data into structured tables with predefined schemas. They use SQL (Structured Query Language) to manage and query data efficiently.*

Key Advantages:

ACID Compliance – Ensures data integrity with Atomicity, Consistency, Isolation, and Durability.
Complex Queries – SQL allows powerful joins, aggregations, and transactions.
Mature & Well-Documented – Decades of optimization and community support.

When to Use Relational Databases?

:heavy_check_mark: Financial systems (banks, accounting software)
:heavy_check_mark: Applications requiring strict data consistency (e.g., inventory management)
:heavy_check_mark: Projects with well-defined, unchanging data structures

Part 2: NoSQL Databases – The Flexible Alternative

What Are NoSQL Databases?

NoSQL databases (MongoDB, Cassandra, Redis, DynamoDB) offer schema-less data storage, making them ideal for unstructured or rapidly changing data.

Types of NoSQL Databases:

  • Document Stores (MongoDB) – JSON-like documents
  • Key-Value Stores (Redis) – Simple, high-speed lookups
  • Column-Family Stores (Cassandra) – Optimized for large-scale data
  • Graph Databases (Neo4j) – For highly connected data

Key Advantages:

Scalability – Horizontally scalable to handle massive traffic.
Flexibility – No rigid schema; adapts to changing data needs.
Performance – Optimized for high-speed read/write operations.

When to Use NoSQL?

:heavy_check_mark: Big Data & real-time analytics (e.g., IoT, social media feeds)
:heavy_check_mark: Rapidly evolving applications (startups, MVPs)
:heavy_check_mark: Distributed systems needing high availability

Day 3: NoSQL Data Types in MongoDB

Introduction

MongoDB is one of the most popular NoSQL databases that follows the document model. It stands out for its flexibility in handling unstructured or semi-structured data, thanks to the diverse data types it supports. In this article, we will explore the main data types in MongoDB and how they are used.

Basic Data Types in MongoDB

1. String

The primary type for storing textual data, used for names, addresses, and other text-based information.

example:

 { "name": "John Doe",
 "email": "john@example.com" }

2. Numbers

MongoDB supports several numeric types:

  • Integer: For whole numbers (32-bit or 64-bit)
  • Double: For decimal numbers
  • Decimal128: For high-precision decimals (important for financial values)
    example :
{
  "age": 30,
  "price": 99.99,
  "salary": NumberDecimal("1250.50")
}

3. Boolean

Accepts only two values: true or false.
example:

 {
   "isActive": true,
   "hasDiscount": false
 }

4. Date

Used to store dates and timestamps.
example:

{
  "createdAt": ISODate("2023-05-24T10:30:00Z"),
  "updatedAt": ISODate("2023-05-24T11:45:00Z")
}

5. Arrays

Allows storing multiple values of different types in a single field.
example:

{
  "tags": ["technology", "databases", "NoSQL"],
  "scores": [85, 92, 78]
}

6. Embedded Documents

One of MongoDB’s most powerful features, enabling documents to be nested within other documents.
example:

{
  "user": {
    "firstName": "Jane",
    "lastName": "Smith",
    "address": {
      "city": "New York",
      "country": "USA"
    }
  }
}

7. ObjectId

A unique identifier automatically generated for each document.
example:

{
  "_id": ObjectId("507f1f77bcf86cd799439011")
}

8. Null

Represents a non-existent or unknown value.
example:

{
  "middleName": null
}

9. Binary Data

For storing binary data like images or files.
example:

{ "image": BinData(0, "SGVsbG8gd29ybGQ=") }

10. Regular Expressions

Allows storing text search patterns.
example:
{ "pattern": /^MongoDB/i }

1 Like