- This is a scalable database which is able to handle 5000 queries per second.
- Admin will be able to add Trains along with their properties.
- There is a train recommender system which recommends both direct and indirect trains (with one intermmediate station) between source and destination.
-
Make a config.properties file where you place your database name, username and password of postgreSQL database.
-
To Add Trains: Give the train Number , date of journey and respective number of coaches in Trainschedule.txt.
Format : <Train Number> <Date> <Number of AC Coaches> <Number of SL coaches>
-
Run the Admin.java file to update the train records in the database.
-
Place your booking requests in the INPUT folder following the naming scheme as in the repo.
Format : <No. of Passengers> <Name of Passengers> <Train Number> <Date> <AC or SL>
-
Start the ServiceModule.java.
-
Run the client.java file to simulate multiple clients who will be firing the booking requests simulatneously.
-
Run the SearchProcedure.java file to find train between stations.
-
Run Master.py
-
Select Options to perform the action accordingly.
We have simulated clients using multithreading approach, where many clients try to book tickets simultaneously from the database through through the server. We have created a connection pool where each client is randomly assigned an idle connection to the server ensuring parallelism. Once a client request is connected to database, it locks the table and books tickets of the particular train. Tickets are assigned to each request in a serial fashion and are updated in the ticket_records table.
We have used Live Share Feature of Visual Studio Code and Github to develop the code.