MongoDB

MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemata.

Overview

MongoDB is an open source database management system (DBMS) that uses a document-oriented database model which supports various forms of data. It is one of numerous non relational database technologies which arose in the mid-2000s under the NoSQL banner for use in big data applications and other processing jobs involving data that doesn't fit well in a rigid relational model. Instead of using tables and rows as in relational databases, the MongoDB architecture is made up of collections and documents.

How it works

A record in MongoDB is a document, which is a data structure composed of field and value pairs. MongoDB documents are similar to JavaScript Object Notation objects but use a variant called Binary JSON (BSON) that accommodates more data types. The fields in documents are akin to the columns in a relational database, and the values they contain can be a variety of data types, including other documents, arrays and arrays of documents, according to the MongoDB user manual.

Documents, which also must incorporate a primary key as a unique identifier, are the basic unit of data in MongoDB. Collections contain sets of documents and function as the equivalent of relational database tables. Collections can contain any type of data, but the restriction is the data in a collection cannot be spread across different databases. The mongo shell is an interactive JavaScript interface to MongoDB which allows users to query and update data, and conduct administrative operations. The shell is a standard component of the open source distributions of MongoDB. Once MongoDB is installed, users connect the mongo shell to their running MongoDB instances.

Being a NoSQL tool means it does not use the usual rows and columns that we so much associate with the relational database management. It is an architecture that is built on collections and documents. The basic unit of data in this database consists of a set of key-value pairs. To be connected to the project mongodb you need to create SSH connection with IP address and port number (0.0.0.0:27017) using privet key for establishing that connection. All communication and tasks in the application server done using service called mongoose.

mongoose.connect('mongodb://localhost/CareBudDb');
mongoose.Promise = global.Promise; // avoid promise deprecation

When the application connected to the database; any process for storing or retrieving the user data will be triggered using Express.js, see the below architecture.

CAREBUD SERVER BACKEND

Server Application is a Node.js application created to operate and manage all data and services required by CareBud Front-end applications. More information about Node.js and CareBud Node.js application.

CareBud Data Model

CareBud backend has nine modules which shown below in CareBud Data Module and each module represents functionality in the application, thus modules explained as follow:

CAREBUD BACKEND MODEL(DATA MODEL)

The above diagram illustrates all the relation between the existing modules in CareBud backend and each module has its own data schema and attributes. The following example shows the schema for users’ module:

Users: user module includes all information about all user accounts.

Patient: contains information about patient accounts and health reports for that patient, along with list that contains information about contacted doctors and relatives.

Doctors: contains information about a particular doctor and along with list contains information about the contacted patients.

Relatives: contains information about a particular relative and contain information about the contacted patients.

Health Status: contains all current health status only for a particular patient which includes a status array of (Blood Pressure, Body Temperature and Heart Beat Reports) that will be taken be virtual Smartwatch.

PatientGeneralHealthReport: is a report that contains health reports and diagnosis provided by a patient or his doctor also any advises written by him.

PatientHealthReportHistory: this module will store old health reports for a patient that can be called for reviewing to help doctors diagnosing patient health well.

Notification: This module will contain all notifications running through the application, for example when patient select specific doctor, a direct notification will be fired to the doctor for approving that, also if the patient health status gets critical, the system will fire real time notification upon that to the available doctors and relative list for fast responding. On that action, the information required for that patient will be provided along with the notification.

Chat: this module is available only between patients and doctors, for any advises and related health status reports.

Same structure for all module’s schema with different attributes and data types, which make it easy to build and code in the front end application also when the data process for encryption and decryption. For more details about CareBud Backend Application.

Last updated

Was this helpful?