Wednesday, May 7, 2025

Bank dm data model diagram and sql

 




-- MySQL Script generated by MySQL Workbench

-- Thu May  8 12:17:48 2025

-- Model: New Model    Version: 1.0

-- MySQL Workbench Forward Engineering


SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;

SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;

SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';


-- -----------------------------------------------------

-- Schema mydb

-- -----------------------------------------------------

-- -----------------------------------------------------

-- Schema bankdb

-- -----------------------------------------------------


-- -----------------------------------------------------

-- Schema bankdb

-- -----------------------------------------------------

CREATE SCHEMA IF NOT EXISTS `bankdb` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci ;

USE `bankdb` ;


-- -----------------------------------------------------

-- Table `bankdb`.`branch`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`branch` (

  `BranchID` INT NOT NULL AUTO_INCREMENT,

  `BranchName` VARCHAR(100) NULL DEFAULT NULL,

  `Location` VARCHAR(255) NULL DEFAULT NULL,

  `ManagerName` VARCHAR(100) NULL DEFAULT NULL,

  `ContactNumber` VARCHAR(15) NULL DEFAULT NULL,

  PRIMARY KEY (`BranchID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`customer`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`customer` (

  `CustomerID` INT NOT NULL AUTO_INCREMENT,

  `FullName` VARCHAR(100) NULL DEFAULT NULL,

  `DateOfBirth` DATE NULL DEFAULT NULL,

  `Gender` VARCHAR(10) NULL DEFAULT NULL,

  `Address` VARCHAR(255) NULL DEFAULT NULL,

  `ContactNumber` VARCHAR(15) NULL DEFAULT NULL,

  `Email` VARCHAR(100) NULL DEFAULT NULL,

  `BranchID` INT NULL DEFAULT NULL,

  PRIMARY KEY (`CustomerID`),

  INDEX `BranchID` (`BranchID` ASC) VISIBLE,

  CONSTRAINT `customer_ibfk_1`

    FOREIGN KEY (`BranchID`)

    REFERENCES `bankdb`.`branch` (`BranchID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`account`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`account` (

  `AccountID` INT NOT NULL AUTO_INCREMENT,

  `CustomerID` INT NULL DEFAULT NULL,

  `BranchID` INT NULL DEFAULT NULL,

  `AccountType` VARCHAR(50) NULL DEFAULT NULL,

  `Balance` DECIMAL(15,2) NULL DEFAULT NULL,

  `OpenDate` DATE NULL DEFAULT NULL,

  `Status` VARCHAR(20) NULL DEFAULT NULL,

  PRIMARY KEY (`AccountID`),

  INDEX `CustomerID` (`CustomerID` ASC) VISIBLE,

  INDEX `BranchID` (`BranchID` ASC) VISIBLE,

  CONSTRAINT `account_ibfk_1`

    FOREIGN KEY (`CustomerID`)

    REFERENCES `bankdb`.`customer` (`CustomerID`),

  CONSTRAINT `account_ibfk_2`

    FOREIGN KEY (`BranchID`)

    REFERENCES `bankdb`.`branch` (`BranchID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`card`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`card` (

  `CardID` INT NOT NULL AUTO_INCREMENT,

  `CustomerID` INT NULL DEFAULT NULL,

  `CardType` VARCHAR(50) NULL DEFAULT NULL,

  `CardNumber` VARCHAR(20) NULL DEFAULT NULL,

  `ExpiryDate` DATE NULL DEFAULT NULL,

  `CVV` INT NULL DEFAULT NULL,

  `Status` VARCHAR(20) NULL DEFAULT NULL,

  PRIMARY KEY (`CardID`),

  INDEX `CustomerID` (`CustomerID` ASC) VISIBLE,

  CONSTRAINT `card_ibfk_1`

    FOREIGN KEY (`CustomerID`)

    REFERENCES `bankdb`.`customer` (`CustomerID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`atmtransaction`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`atmtransaction` (

  `ATMTransactionID` INT NOT NULL AUTO_INCREMENT,

  `CardID` INT NULL DEFAULT NULL,

  `AccountID` INT NULL DEFAULT NULL,

  `TransactionDate` DATETIME NULL DEFAULT CURRENT_TIMESTAMP,

  `Amount` DECIMAL(15,2) NULL DEFAULT NULL,

  `TransactionType` VARCHAR(20) NULL DEFAULT NULL,

  PRIMARY KEY (`ATMTransactionID`),

  INDEX `CardID` (`CardID` ASC) VISIBLE,

  INDEX `AccountID` (`AccountID` ASC) VISIBLE,

  CONSTRAINT `atmtransaction_ibfk_1`

    FOREIGN KEY (`CardID`)

    REFERENCES `bankdb`.`card` (`CardID`),

  CONSTRAINT `atmtransaction_ibfk_2`

    FOREIGN KEY (`AccountID`)

    REFERENCES `bankdb`.`account` (`AccountID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`employee`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`employee` (

  `EmployeeID` INT NOT NULL AUTO_INCREMENT,

  `FullName` VARCHAR(100) NULL DEFAULT NULL,

  `Position` VARCHAR(50) NULL DEFAULT NULL,

  `BranchID` INT NULL DEFAULT NULL,

  `ContactNumber` VARCHAR(15) NULL DEFAULT NULL,

  `Email` VARCHAR(100) NULL DEFAULT NULL,

  PRIMARY KEY (`EmployeeID`),

  INDEX `BranchID` (`BranchID` ASC) VISIBLE,

  CONSTRAINT `employee_ibfk_1`

    FOREIGN KEY (`BranchID`)

    REFERENCES `bankdb`.`branch` (`BranchID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`transaction`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`transaction` (

  `TransactionID` INT NOT NULL AUTO_INCREMENT,

  `AccountID` INT NULL DEFAULT NULL,

  `TransactionDate` DATETIME NULL DEFAULT CURRENT_TIMESTAMP,

  `Amount` DECIMAL(15,2) NULL DEFAULT NULL,

  `TransactionType` VARCHAR(20) NULL DEFAULT NULL,

  `Description` TEXT NULL DEFAULT NULL,

  PRIMARY KEY (`TransactionID`),

  INDEX `AccountID` (`AccountID` ASC) VISIBLE,

  CONSTRAINT `transaction_ibfk_1`

    FOREIGN KEY (`AccountID`)

    REFERENCES `bankdb`.`account` (`AccountID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`audit`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`audit` (

  `AuditID` INT NOT NULL AUTO_INCREMENT,

  `TableName` VARCHAR(50) NULL DEFAULT NULL,

  `Action` VARCHAR(50) NULL DEFAULT NULL,

  `ActionDateTime` DATETIME NULL DEFAULT CURRENT_TIMESTAMP,

  `EmployeeID` INT NULL DEFAULT NULL,

  `TransactionID` INT NULL DEFAULT NULL,

  PRIMARY KEY (`AuditID`),

  INDEX `EmployeeID` (`EmployeeID` ASC) VISIBLE,

  INDEX `TransactionID` (`TransactionID` ASC) VISIBLE,

  CONSTRAINT `audit_ibfk_1`

    FOREIGN KEY (`EmployeeID`)

    REFERENCES `bankdb`.`employee` (`EmployeeID`),

  CONSTRAINT `audit_ibfk_2`

    FOREIGN KEY (`TransactionID`)

    REFERENCES `bankdb`.`transaction` (`TransactionID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`creditscore`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`creditscore` (

  `CreditScoreID` INT NOT NULL AUTO_INCREMENT,

  `CustomerID` INT NULL DEFAULT NULL,

  `Score` INT NULL DEFAULT NULL,

  `LastUpdated` DATE NULL DEFAULT NULL,

  PRIMARY KEY (`CreditScoreID`),

  INDEX `CustomerID` (`CustomerID` ASC) VISIBLE,

  CONSTRAINT `creditscore_ibfk_1`

    FOREIGN KEY (`CustomerID`)

    REFERENCES `bankdb`.`customer` (`CustomerID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`forex`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`forex` (

  `ForexID` INT NOT NULL AUTO_INCREMENT,

  `CustomerID` INT NULL DEFAULT NULL,

  `ExchangeRate` DECIMAL(10,4) NULL DEFAULT NULL,

  `FromCurrency` VARCHAR(10) NULL DEFAULT NULL,

  `ToCurrency` VARCHAR(10) NULL DEFAULT NULL,

  `AmountExchanged` DECIMAL(15,2) NULL DEFAULT NULL,

  `ExchangeDate` DATETIME NULL DEFAULT CURRENT_TIMESTAMP,

  PRIMARY KEY (`ForexID`),

  INDEX `CustomerID` (`CustomerID` ASC) VISIBLE,

  CONSTRAINT `forex_ibfk_1`

    FOREIGN KEY (`CustomerID`)

    REFERENCES `bankdb`.`customer` (`CustomerID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`frauddetection`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`frauddetection` (

  `FraudID` INT NOT NULL AUTO_INCREMENT,

  `AccountID` INT NULL DEFAULT NULL,

  `DetectionDate` DATETIME NULL DEFAULT CURRENT_TIMESTAMP,

  `FraudType` VARCHAR(50) NULL DEFAULT NULL,

  `AmountFlagged` DECIMAL(15,2) NULL DEFAULT NULL,

  `Description` TEXT NULL DEFAULT NULL,

  `Status` VARCHAR(20) NULL DEFAULT NULL,

  PRIMARY KEY (`FraudID`),

  INDEX `AccountID` (`AccountID` ASC) VISIBLE,

  CONSTRAINT `frauddetection_ibfk_1`

    FOREIGN KEY (`AccountID`)

    REFERENCES `bankdb`.`account` (`AccountID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`insurance`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`insurance` (

  `InsuranceID` INT NOT NULL AUTO_INCREMENT,

  `CustomerID` INT NULL DEFAULT NULL,

  `InsuranceType` VARCHAR(50) NULL DEFAULT NULL,

  `CoverageAmount` DECIMAL(15,2) NULL DEFAULT NULL,

  `Premium` DECIMAL(15,2) NULL DEFAULT NULL,

  `StartDate` DATE NULL DEFAULT NULL,

  `EndDate` DATE NULL DEFAULT NULL,

  PRIMARY KEY (`InsuranceID`),

  INDEX `CustomerID` (`CustomerID` ASC) VISIBLE,

  CONSTRAINT `insurance_ibfk_1`

    FOREIGN KEY (`CustomerID`)

    REFERENCES `bankdb`.`customer` (`CustomerID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`investment`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`investment` (

  `InvestmentID` INT NOT NULL AUTO_INCREMENT,

  `CustomerID` INT NULL DEFAULT NULL,

  `InvestmentType` VARCHAR(50) NULL DEFAULT NULL,

  `Amount` DECIMAL(15,2) NULL DEFAULT NULL,

  `InterestRate` DECIMAL(5,2) NULL DEFAULT NULL,

  `StartDate` DATE NULL DEFAULT NULL,

  `EndDate` DATE NULL DEFAULT NULL,

  PRIMARY KEY (`InvestmentID`),

  INDEX `CustomerID` (`CustomerID` ASC) VISIBLE,

  CONSTRAINT `investment_ibfk_1`

    FOREIGN KEY (`CustomerID`)

    REFERENCES `bankdb`.`customer` (`CustomerID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`loan`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`loan` (

  `LoanID` INT NOT NULL AUTO_INCREMENT,

  `CustomerID` INT NULL DEFAULT NULL,

  `BranchID` INT NULL DEFAULT NULL,

  `LoanType` VARCHAR(50) NULL DEFAULT NULL,

  `LoanAmount` DECIMAL(15,2) NULL DEFAULT NULL,

  `InterestRate` DECIMAL(5,2) NULL DEFAULT NULL,

  `LoanTerm` INT NULL DEFAULT NULL,

  `Status` VARCHAR(20) NULL DEFAULT NULL,

  PRIMARY KEY (`LoanID`),

  INDEX `CustomerID` (`CustomerID` ASC) VISIBLE,

  INDEX `BranchID` (`BranchID` ASC) VISIBLE,

  CONSTRAINT `loan_ibfk_1`

    FOREIGN KEY (`CustomerID`)

    REFERENCES `bankdb`.`customer` (`CustomerID`),

  CONSTRAINT `loan_ibfk_2`

    FOREIGN KEY (`BranchID`)

    REFERENCES `bankdb`.`branch` (`BranchID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



-- -----------------------------------------------------

-- Table `bankdb`.`loanpayment`

-- -----------------------------------------------------

CREATE TABLE IF NOT EXISTS `bankdb`.`loanpayment` (

  `PaymentID` INT NOT NULL AUTO_INCREMENT,

  `LoanID` INT NULL DEFAULT NULL,

  `PaymentDate` DATE NULL DEFAULT NULL,

  `PaymentAmount` DECIMAL(15,2) NULL DEFAULT NULL,

  PRIMARY KEY (`PaymentID`),

  INDEX `LoanID` (`LoanID` ASC) VISIBLE,

  CONSTRAINT `loanpayment_ibfk_1`

    FOREIGN KEY (`LoanID`)

    REFERENCES `bankdb`.`loan` (`LoanID`))

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8mb4

COLLATE = utf8mb4_0900_ai_ci;



SET SQL_MODE=@OLD_SQL_MODE;

SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;

SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;


Wednesday, April 2, 2025

Steps for Optimizing a data model

 

Optimizing a data model involves refining its structure and processes to improve performance, scalability, and usability. Here are the key steps:

1. Understand Business Requirements

  • Identify the specific goals and objectives of the data model.
  • Ensure alignment with business needs and reporting requirements.

2. Analyze Current Data Model

  • Review the existing model for inefficiencies or bottlenecks.
  • Identify redundant data, unnecessary complexity, or outdated structures.

3. Simplify Data Structures

  • Remove unused columns, tables, or relationships.
  • Normalize or denormalize data as needed to balance performance and usability.

4. Optimize Queries

  • Refine SQL queries to reduce execution time.
  • Use indexes to speed up data retrieval.

5. Implement Partitioning

  • Divide large datasets into smaller, manageable partitions.
  • Optimize storage and retrieval for high-volume data.

6. Enhance Data Quality

  • Cleanse data to remove duplicates and inconsistencies.
  • Validate data accuracy and completeness.

7. Monitor Performance

  • Use tools to track query execution times and resource usage.
  • Identify areas for further improvement.

8. Test and Validate

  • Test the optimized model with real-world scenarios.
  • Ensure it meets performance and reliability standards.

9. Document Changes

  • Maintain clear documentation of the optimized model.
  • Include details on structure, relationships, and processes.

10. Plan for Scalability

  • Design the model to accommodate future growth and changes.
  • Incorporate flexibility for new data sources or requirements.

 

Tuesday, April 1, 2025

gathering requirements for a banking dimensional data model

 

When gathering requirements for a banking dimensional data model, it's essential to ask questions that cover business needs, data sources, and technical aspects. Here are some key areas to focus on:

Business Requirements

  • What are the primary business objectives for this data model?
  • What types of reports or analyses will this model support (e.g., customer segmentation, transaction trends)?
  • Who are the end-users of this data model (e.g., analysts, managers)?
  • What key performance indicators (KPIs) should the model track?

Data Sources

  • What are the main data sources (e.g., transaction systems, customer databases)?
  • Are there any external data sources (e.g., market data, regulatory data)?
  • What is the frequency of data updates (real-time, daily, weekly)?
  • Is historical data required? If so, how far back should it go?

Technical Considerations

  • What is the existing technical architecture? Are there any constraints?
  • What data formats and structures are used in the source systems?
  • Are there specific security or compliance requirements for the data?
  • What is the expected volume of data, and how should it be handled?

Dimensional Modeling Specifics

  • What are the key dimensions (e.g., customer, product, time)?
  • What measures or metrics should be included (e.g., transaction amounts, account balances)?
  • Are there any hierarchies within dimensions (e.g., geographic regions, product categories)?
  • How should the model handle changes over time (e.g., slowly changing dimensions)?

Validation and Maintenance

  • How will the model be validated to ensure accuracy?
  • Who will be responsible for maintaining the model after implementation?
  • Are there any anticipated changes or expansions to the model in the future?

These questions can help ensure that the dimensional data model aligns with business goals and technical requirements. If you'd like, I can dive deeper into any specific area!

Sunday, December 15, 2024

How to Choose The Right Database for Your Application?

 https://www.geeksforgeeks.org/how-to-choose-the-right-database-for-your-application/


How to Choose The Right Database for Your Application?

Last Updated : 07 Jun, 2024

“I’ll just choose X, it’s the DB I know and worked with”. 

Most of the developers and students use this statement when it comes to choosing a database for a project. Working with a database you’re already familiar with is perfectly fine if performance is not an important requirement for your system, but consider a situation when your application grows and after a couple of years your app starts facing some issues. It will become a headache for developers and administrators to fix the issue. It doesn’t matter if you are working on a project from scratch or you’re already working on a mature project, it’s important to know the limitations of the database and identify when to add another type of DB to your project. 

How-to-Choose-The-Right-Database-for-Your-Application

There are more than 300 database management systems available in the market and choosing the one can be overwhelming for developers. You have a variety of options available in relational (MySQL, PostgreSQL, Oracle DB, etc) and non-relational (MongoDB, Apache HBase, Cassandra, etc) databases but you need to understand none of them fits all kinds of project requirements. Each one of them has some strengths and weaknesses. Let’s look at some case study that illustrates how you should choose the right database for your application. 

How do you make this decision when you’re architecting a given system?

There are so many databases are available and picking up one database over another is a complicated decision. Well, there is no real formula you can follow but there are a few things you should think about. It’s not an easy decision but people who are good at it make the big bucks. Firstly set aside the idea that you are going to find the one true database that is better than everything else. Now before considering a specific database take some time and ask a few important questions related to your project.

  • How much data do you expect to store when the application is mature?
  • How many users do you expect to handle simultaneously at peak load?
  • What availabilityscalabilitylatencythroughput, and data consistency does your application need?
  • How often will your database schemas change?
  • What is the geographic distribution of your user population?
  • What is the natural “shape” of your data?
  • Does your application need online transaction processing (OLTP)analytic queries (OLAP), or both?
  • What ratio of reads to writes do you expect in production?
  • What are your preferred programming languages?
  • Do you have a budget? If so, will it cover licenses and support contracts?
  • How strict are you with invalid data being sent to your database? (Ideally, you are very strict and do server-side data validation before persisting it to your database)

How to Choose The Right Database for Your Application?

Now let’s talk about some key aspects that will answer the above questions and will help you to choose the right database for your application .

1. Integration

The most important thing to consider while choosing the right database is what system you need to integrate together? Make sure that your database management system can be integrated with other tools and services within your project. Different technologies have different connectors for different other technologies. For example, if you have a big analytics job that’s currently running an Apache Spark then probably you want to limit yourself to external databases that can connect easily to Apache Spark. Now suppose you have some frontend system that actually depends on having a SQL interface to a backend and you’re thinking about moving from a monolithic database to a non-relational database.

It will be only a good choice if the non-relational database you’re moving to offer some sort of SQL like interface that can be easily migrated to from your frontend application. So think about the pieces that need to talk together in your system and see if they can actually talk together or not with existing off-the-shelf components and whether those components are actually well maintained and up-to-date.  Another example is ArangoDB which has excellent performance but libraries for this DBMS are still young and lack support. Using ArangoDB in combination with other tools may be risky, so the community suggests avoiding ArangoDB for complex projects

2. Scaling Requirement

It’s important to know the scaling requirement before installing your production database. How much data are you really talking about? Is it really going to grow unbounded over time? if so then you need some sort of database technology that is not limited to the data that you can store on one PC. You need to look at something like Cassandra or MongoDB or HBase where you can actually distribute the storage of your data across an entire cluster and scale horizontally instead of vertically. Many databases can’t handle thousands of users querying terabytes or petabytes of data, because of scaling issues. 

While choosing a database you also need to think about the transaction rate or throughput which means how many requests you intend to get per second. Databases with high throughput can support many simultaneous users. If we are talking about thousands then again a single database service is not going to work out. This is especially important when you are working on some big websites where we have a lot of web servers that are serving a lot of people at the same time. You will have to choose a database that is distributed and allows you to spread out a load of those transactions more evenly. In those situations, NoSQL databases are a good choice instead of RDBMS

3. Support Consideration

Think about the supports you might need for your database. Do you have the in-house expertise to spin up this new technology and actually configure it properly? It’s going to be harder than you think especially if you’re using this in the real world or any sort of situation where you have personally identifiable information in the mix from your end-users. In that case, you need to make sure you’re thinking about the security of your system. The truth is most of the NoSQL database we’ve talked about if you configure them with their default settings there will be no security at all.

Anybody at all can connect to these things and retrieve data and write data into them. So make sure you have someone available who knows what they’re doing for setting this up in a secure manner. If you are in a big organization that has these experts in-house then it’s great, but if you’re in a smaller organization you may have to choose the technology that offers professional paid support who can guide you through initial setup decisions in the initial administration of your server over time. You can also outsource the administrators for support. A more corporate solution like MongoDB has paid support and if we talk about the Apache projects then there are some companies that offer paid professional support. 

4. CAP Consideration

CAP stands for Consistency, Availability, and Partition tolerance. The theorem states that you cannot achieve all the properties at the best level in a single database, as there are natural trade offs between the items. You can only pick two out of three at a time and that totally depends on your prioritize based on your requirements. For example, if your system needs to be available and partition tolerant, then you must be willing to accept some latency in your consistency requirements. 
Traditional relational databases are a natural fit for the CA side whereas Non-relational database engines mostly satisfy AP and CP requirements. 
 

CAP Consideration

 

  • Consistency means that any read request will return the most recent write. Data consistency is usually “strong” for SQL databases and for NoSQL database consistency may be anything from “eventual” to “strong”.
  • Availability means that a non-responding node must respond in a reasonable amount of time. Not every application needs to run 24/7 with 99.999% availability but most likely you will prefer  a database with higher availability.
  • Partition tolerance means the system will continue to operate despite network or node failures.

The type of application will determine what you want there and only you know the actual requirements. Is it actually ok if your system goes down for a few seconds or a few minutes, if not then availability should be your prime concern? If you’re dealing with something with real transactional information like a stock transaction or financial transactions you might value consistency above all. Try to choose the technology that is best suited to the trade-offs that you want to make.

5. Schemas or Data Model

Relational databases store data in a fixed and predefined structure. It means when you start development you will have to define your data schema in terms of tables and columns. You have to change the schema every time the requirements change. This will lead to creating new columns, defining new relations, reflecting the changes in your application, discussing with your database administrators, etc.  NoSQL database provides much more flexibility when it comes to handling data. There is no requirement to specify the schema to start working with the application.

Also, the NoSQL database doesn’t put a restriction on the types of data you can store together. It allows you to add more new types as your needs change. In the application building process, most of the developers prefer high coding velocity and great agility. NoSQL databases have proven to be a much better choice in that regard especially for agile development which requires fast implementation.

Conclusion

You really need to take care of all the 5 points mentioned but above all, the most important advice is to keep everything simple. Don’t choose a database just because it is shiny and trendy in the market. If you don’t need to set up a highly complex NoSQL cluster or something that needs a lot of maintenance like MongoDB or HBase where you have all these external servers that maintain the configuration don’t do it if you don’t need to. Think about the minimum requirements that you need for your system. If you don’t need to deal with the massive scale then there is no need to use a NoSQL database, you can choose MySQL and somewhere it’ll be fine. There is no point to deploy a whole new system that does not have good expertise within your organization unless you really need to. Simple technologies and simple architectures are going to be a lot easier to maintain. After all, you’re not going to be happy when you wake up in the morning at 3:00 am because some random server went down on this overly complex database system that you set up for no good reasons. So keep everything simple as much as possible.


Get ready to boost your rank and secure an exceptional GATE 2025 score with confidence!

Our GATE CS & IT Test Series 2025 offers 60 PYQs Quizzes60 Subject-Wise Mock Tests4500+ PYQs and practice questions, and over 20 Full-Length Mock Tests that ensure you’re well-prepared to tackle the toughest questions and secure a top-rank in the GATE 2025 exam. Get personalized insights with student rankings based on performance and benefit from expert-designed tests created by industry pros and GATE CS toppers.

Plus, don’t miss out on these exclusive features:

--> All India Mock Test
--> Live GATE CSE Mentorship Classes
--> Live Doubt Solving Sessions 

Join now and st

Bank dm data model diagram and sql

  -- MySQL Script generated by MySQL Workbench -- Thu May  8 12:17:48 2025 -- Model: New Model    Version: 1.0 -- MySQL Workbench Forward En...