π Backend Project: Same Application Built Using Different Data Storage Approaches
I built a post-based web application and implemented it using three different data storage approaches to understand how backend systems behave with different database models.
βββββββββββββββββββββββ
πΉ MongoDB Version (Document-Based)
β’ Designed schema using embedded documents (images & comments inside post) β’ Implemented CRUD operations using Mongoose β’ Handled image uploads with Multer β’ Used MongoDB operators like "$push", "$pull" for updating arrays β’ Dynamic rendering with EJS templates β’ Efficient handling of nested data structures
βββββββββββββββββββββββ
πΉ SQL Version (Relational Database)
β’ Designed normalized schema (posts table, images table, comments structure) β’ Implemented one-to-many relationships using foreign keys β’ Inserted and managed related data across multiple tables β’ Built queries for create, update, delete, and fetch operations β’ Handled image deletion using SQL DELETE queries β’ Managed JSON parsing for comments where required β’ Understood difference between relational vs document modeling
βββββββββββββββββββββββ
πΉ Local Memory Version (No Database)
β’ Stored data using in-memory arrays β’ Focused on core backend logic without database dependency β’ Implemented routing, middleware, and request handling β’ Helped in understanding how backend works at a fundamental level
βββββββββββββββββββββββ
π§ Core Features Across All Versions
β’ Create, edit, and delete posts β’ Upload multiple images per post β’ Upload profile pic by Default, in every user (can be edited) β’ Delete individual images β’ Comment system for each post β’ Dynamic UI rendering using EJS β’ Theme toggle using cookies (light/dark mode) β’ REST-style routing (GET, POST, PATCH, DELETE)
βββββββββββββββββββββββ
- Key Learning
Building the same application with different data storage systems helped me in understand:
β’ How data modeling changes application design β’ Difference between embedded vs relational data β’ How backend logic adapts to database structure β’ Importance of schema design in scalability
βββββββββββββββββββββββ
π GitHub: []
#NodeJS #ExpressJS #MongoDB #SQL #BackendDevelopment #WebDevelopment