⚠️ Note: This is only a development version.
This project provides a UI to compare database operation speeds between MongoDB and PostgreSQL. It uses Owner and Pet entities to represent typical application data models.
Overview
- Frontend built with Svelte in
/petfinder
💻
- Java backend API with Spring Boot in
/backend
☕
- Databases provisioned via Docker Compose:
- Supports creating test data and timing the following operations:
- Provides visual result comparison with D3 bar chart 📊
Running the Project
To start the project:
- Clone the repository
- Navigate to the root directory with the
docker-compose.yml
file
- Run
docker-compose up
to launch MongoDB, PostgreSQL
- With an IDE of your choice start the Java Spring Application
- In a separate terminal, navigate to
/petfinder
- Run
npm install
to install dependencies
- Run
npm run dev
to launch the Svelte frontend on localhost
- Access the app at
http://localhost:5173
🌐
The homepage provides controls to:
- Specify insert or find operation
- Toggle between native MongoDB and MongoDB with references for object mapping
- Input parameters like amount to insert or name to find
- Display performance comparison chart with D3
Database-Model
erDiagram
Owner ||--|{ Pet : Owns
Owner {
string id
string name
int mana
}
Pet {
string id
string name
string type
int age
float weight
float height
}
- More details on the performance test flows 📈
Areas for Enhancement (Please PR🥺)
Some areas that could be expanded on:
Frontend CRUD Functionality
- Support updating existing owners 🔄
- Implement deleting owners ❌
- CRUD operations for pets 🐾
- Manage relationships between owners and pets 💑
Additional ideas could include:
- Visualize performance over time as additional records are inserted 📈
- Compare indexing approaches like MongoDB compound indexes vs PostgreSQL B-trees 🌲
- Containerization of frontend and deployment optimizations 🐳