Skip to content

About

EV Charging Network — MongoDB NoSQL extension of an Oracle database assignment

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

EV Charging Network - MongoDB NoSQL Extension

MongoDB implementation of an EV charging network analytics workload, migrated from an Oracle relational schema and documented for a Database + Models NoSQL assignment.

Project Context

Item Details
Course Database + Models, Semester 2
Faculty ELTE Faculty of Informatics
Date April 2026
Source DBMS Oracle Database
Target DBMS MongoDB Community Server
MongoDB database ev_charging_nosql
Primary tools Python, PyMongo, MongoDB Compass, mongosh

Overview

This repository contains the NoSQL extension of an EV Charging Network database project. It converts operational data from the Oracle source schema into MongoDB collections, then evaluates the resulting document model through index creation, document updates, and analytical aggregation pipelines.

The full submitted report is available as docs/EV_Charging_NoSQL_Project_Documentation.docx. It contains the migration rationale, screenshots, query outputs, Oracle vs MongoDB comparison, references, code listings, and language-model usage disclosure.

What This Repository Demonstrates

  • Oracle-to-NDJSON export using Python.
  • MongoDB bulk import using PyMongo.
  • A nine-collection MongoDB model for EV charging operations.
  • Ten MongoDB operations covering DDL, DML, simple aggregation, and complex aggregation.
  • Evidence-backed comparison between the relational Oracle design and the MongoDB implementation.

Data Model

EV Charging NoSQL Relationship Model

The MongoDB database keeps the main Oracle entities as separate collections so that the migration remains traceable to the original relational design while still supporting document-oriented query patterns.

Collection Documents
charging_sessions 100,000
meter_readings 110,000
customers 10,000
vehicles 12,000
maintenance_tickets 3,000
stations 120
connectors 360
tariffs 12
session_audit_log 2

Generated NDJSON files and local execution logs are not committed because they are large or reproducible from the scripts.

Repository Structure

.
|-- scripts/
|   |-- export_oracle_to_json.py
|   `-- import_to_mongo.py
|-- queries/
|   |-- 00_run_all_queries.js
|   |-- 01_ddl_dml.js
|   |-- 02_simple_queries.js
|   `-- 03_complex_queries.js
|-- docs/
|   |-- EV_Charging_NoSQL_Project_Documentation.docx
|   `-- figures/
|-- EV Charging NoSQL Relationship Model.png
`-- README.md

Prerequisites

  • Python 3.9 or newer.
  • Oracle client access to the source database.
  • MongoDB Community Server running locally on port 27017.
  • MongoDB Compass or mongosh for query execution.
  • Python packages:
pip install oracledb pymongo

Reproducibility Workflow

1. Export Oracle Tables

python scripts/export_oracle_to_json.py

The exporter writes one NDJSON file per source table into data/. Oracle credentials can be supplied with environment variables or entered interactively.

Variable Default Purpose
ORACLE_USER prompted Oracle username
ORACLE_PASSWORD prompted Oracle password
ORACLE_HOST localhost Oracle host
ORACLE_PORT 2001 Oracle port
ORACLE_SERVICE aramis Oracle service name

2. Import Into MongoDB

python scripts/import_to_mongo.py
Variable Default Purpose
MONGO_URI mongodb://localhost:27017 MongoDB connection string
MONGO_DB ev_charging_nosql Target database name

3. Run The MongoDB Workload

Run the complete workload with mongosh:

mongosh mongodb://localhost:27017 queries/00_run_all_queries.js

Alternatively, open MongoDB Compass, connect to mongodb://localhost:27017, select ev_charging_nosql, and load the query scripts from the embedded shell.

Query Workload

# Category Operation
Q1 DDL Create a compound index on charging_sessions(session_status, session_start)
Q2 DDL Create a compound index on meter_readings(session_id, reading_time)
Q3 DML Update one charging session by _id
Q4 DML Run a conditional bulk update plus reversible insert/delete verification
Q5 Aggregation Count sessions by status
Q6 Aggregation Rank stations by connector count
Q7 Complex aggregation Calculate monthly completed-session energy totals
Q8 Complex aggregation Rank connectors by usage and revenue
Q9 Complex aggregation Enrich unpaid sessions with customer details
Q10 Complex aggregation Calculate average energy and cost by tariff

The query scripts are split by purpose, while queries/00_run_all_queries.js provides a single entry point for running the full sequence.

Documentation And Evidence

Data And Security Notes

  • Exported data files under data/ are intentionally ignored by Git.
  • Local logs and regenerated artifacts should be treated as reproducible outputs, not source files.
  • Database credentials are not stored in the repository.

Related Repository

The Oracle source project is maintained separately:

ev-charging-network-oracle-project - EV Charging Network Management System, Oracle Database implementation.

This MongoDB repository references the Oracle schema entities by name but does not import code from the Oracle repository directly.

About

EV Charging Network — MongoDB NoSQL extension of an Oracle database assignment

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages