Jurnal - Event Driven Architecture
Jurnal - Event Driven Architecture
net/publication/363541167
CITATIONS READS
0 2,814
4 authors, including:
All content following this page was uploaded by Bhimraj Yadav on 14 September 2022.
A PROJECT REPORT
SUBMITTED TO THE DEPARTMENT OF COMPUTER AND ELECTRONICS &
COMMUNICATION ENGINEERING IN PARTIAL FULFILLMENT OF THE
REQUIREMENTS FOR THE DEGREE OF BACHELOR IN COMPUTER
ENGINEERING
Project Members
Bhimraj Yadav (075/BCT/004)
Kiran Shrestha (075/BCT/010)
Sirjan Baral (075/BCT/023)
Sudip Adhikari (075/BCT/009)
APRIL, 2022
KATHFORD INTERNATIONAL COLLEGE OF ENGINEERING AND
MANAGEMENT
( Affiliated to Tribhuvan University )
Balkumari, Lalitpur
A PROJECT REPORT
SUBMITTED TO THE DEPARTMENT OF COMPUTER AND ELECTRONICS &
COMMUNICATION ENGINEERING IN PARTIAL FULFILMENT OF THE
REQUIREMENTS FOR THE DEGREE OF BACHELOR IN COMPUTER
ENGINEERING
Submitted By
Bhimraj Yadav(075/BCT/004)
Kiran Shrestha(075/BCT/010)
Sirjan Baral(075/BCT/023)
Sudip Adhikari(075/BCT/009)
Submitted To
DEPARTMENT OF COMPUTER AND ELECTRONICS & COMMUNICATION
ENGINEERING
APRIL, 2022
Acknowledgement
We use this opportunity to express our sincere gratitude to everyone who supported us
throughout the course of this project. We are thankful for their aspiring guidance,
invaluably constructive criticism and friendly advice during the project work. We are
grateful to them for sharing their views on issues related to the project.
Thanks are also due to all our colleagues and everyone who has helped us out for the
betterment of the project.
i
Abstract
This project is an event-driven based rental system where the renter can list out their
services like rooms and vehicles for the consumers and the consumers can make
reservations for the available services. This event-driven approach is commonly found
in modern applications that use microservices or any application that has decoupled
applications. Event-driven architectures are ideal for improving agility and moving
quickly. The main motive behind this project is to provide a platform for users and
owners to use rental services in an effective and efficient manner. Renting or finding
vehicles, rooms, etc on rent has not been easy anywhere. So, to overcome this gap we
have created a Rental System based on Event-Driven architecture which provides an
interface as a platform to make reservations for the services they want to rent. This
project uses Kafka as an event streaming platform for the event-driven architecture
and base64 algorithm for encoding and decoding images so as to produce and
consume media files flowing in our system. Our target audience is mainly anyone
who prefers renting out products just to those whom they prefer rather than random
people coming at the door. This application aims to rent out products for a duration
ranging from a day to weeks or months and also recommend products to them as per
their wish. The use of our Rental System can benefit the renter to rent their vehicles,
rooms/flats and rentee to get better rental services.
Keywords: Online rental system, Event-driven architecture, Producer, Consumer,
Encoding, Decoding, Microservice
ii
Table of Contents
Acknowledgement………………...…………………………………………………..i
Abstract…………………………...…………………………………………………..ii
Table of Contents………………………………...……………………..……………iii
List of Figures…………………………...…………………………………………....v
List of Tables..…………………………...…………………………………………...vi
List of Abbreviations…………………………...……………………………...……vii
Chapter 3: Methodology….……………………...…………………………………..8
3.1 Development Model…………………...…………..……..………………………..8
3.2 Process Model…..…………………..………..……………………………………9
iii
4.1 Block Diagram...…………………………………....……………………………10
4.2 ER Diagram...………………………………………..……..…………………….11
4.3 Schema Diagram...……………….…………………..…………..………………12
4.4 Use Case Diagram..…………………………………..………………..…………13
4.5 Sequence Diagram..…………………………………..……………………..……15
4.5.1 Sequence Diagram For Creating Services…………..…...………………...…15
4.5.1 Sequence Diagram For Making Reservation…………....………………...…17
4.6 Class Diagram…....………………………………………..……………..………18
Chapter 6: Conclusion……...….………………...…………………………………21
References………………....……………………...…………………………………23
Appendices...……………....……………………...…………………………………24
iv
List of Figures
v
List of Tables
Table 5.2 List of Renter users along with no. of created services………………...…20
vi
List of Abbreviations
AP Accounts Payable
AR Accounts Receivable
GL General Ledger
vii
Chapter 1: Introduction
1.1 Background
Nowadays many people are shifting from one city to another for education purposes,
exploring new places, for jobs, etc. In this situation, A Rental system like ours might
help the people searching for rooms & flats. And also to the people who want to rent
vehicles for a short period of time for their personal riding, visiting new places, etc.
The rental industry spans many different types of equipment from tools to heavy
construction equipment, aerial to vehicles, computers and tech things, test and
measurement equipment and highly specialized areas such as Hotels, Flats and
Temporary Accommodation rental [1]. Like most software development, initial rental
software systems were developed in the 1970s and 1980s as custom or bespoke
solutions provided for individual rental companies and occurred in parallel in
locations across the globe. In the last two decades, a number of leading players have
emerged providing solutions for everything from one or two user systems in a single
store to international, multi-company and multi-location organisations.
Rental management software should cover all aspects of a rental business in a
systematic way including Financials (GL, AR and AP), Equipment Servicing, CRM
and reporting functionality allowing rental businesses to achieve all their business
analytics from within a single package [1]. Rental management software that
integrates with 'off-the-shelf' accounting software can provide a viable alternative to
the 'all-in-one' solutions. There are distinct industry requirements that need to be
managed within the software, with Utilization one of the most important.
1
1.2 Problem Statement
It’s not an easy job to find and rent new rooms/flats for people easily at any time
anywhere. And also for the people who want to rent their rooms/flats to someone who
they prefer. Scammers are everywhere charging a lot for just finding and listing
rooms. Not everybody affords everything e.g hiring vehicles as needed and just for
the needed hours is not easy.
1.3 Objectives
1.4 Scopes
2
Chapter 2: Literature Review
As technology has evolved, it has made the life of every individual easier. Nowadays,
people have options and they try to choose the best one. So, we researched about the
rental system[2] and some of the related projects. Some of the related services
available in Nepal like easyvehiclerental.com,himalyancarrental.com, gharbeti.com,
roomfindersnepal.com, etc. All of these services were simple in nature on the digital
platforms. But as the technology is growing, people need more ease and features all at
the same place.
We found a paper “A Prototype of a Mobile Car Rental System” [3] which describes a
system that is secured and enables users to reserve the vehicle they wanted. The app
also allowed users to view the rental car available, make payment for the rental car
using a credit card that ensures that users do not have to be physically present at the
rental company just to see what rental car they want to rent.
Moreover, we also studied some of the international and national related projects and
platforms like Airbnb, Zillow, Olx, Roomster, Oyo, rental Nepal, etc to take a view
and understand the mechanism used by them in this modern world. Airbnb is a
website that operates an online marketplace and hospitality service for people to lease
or rent short-term lodging. The challenges for the engineering team include high
availability, quick-scaling, etc. We researched its data architecture[4].
As we have also used a modern architecture for the development of the application,
So for that, we reviewed some of the architectures like API based architecture[5],
Event-driven architecture,container-based applications, Recommender System[6], etc.
Along with all these, recommending products[7] to users according to their needs is
also a matter of great concern to attract users and improve the user experience. So, for
that also we researched several papers and books related to content-based filtering and
collaborative filtering in the context of user’s rating and without user’s rating along
with AB testing methods for new datas[8].
As we have also focused our application architecture on processing massive amounts
of data so we researched processing stream & batch data. We studied the concept of
Data Lakes and Data Warehousing for storing massive data. For tracking location in
real-time with event-driven architecture, storing and processing massive amounts of
data for analytics purposes using big data processing frameworks, we studied and
3
researched cloud computing, distributed processing and tools like Spark, Hadoop, and
kafka[9].
Web-based applications have come a long way since we used to serve static
HTML content from servers. Nowadays, applications are much more complex
and use multiple frameworks, data centres, and technologies. In EDA, the
focus is shifted towards the events and how they are flowing through the
system. This shift allowed us to completely change the way we design
applications tackling the problems. A typical event-driven architecture
comprises four key stakeholders: a publisher, an event, a mediator, and a
consumer. The publisher is the source of the event. The second stakeholder,
the event, is typically modelled as an object containing semantic information
about the situation that occurred. An event signalling a low ink level, for
instance, may provide an estimate of the remaining number of printable pages
before ink completely runs out. The third stakeholder, the consumer, is the
4
party that reacts to the event. Finally, the mediator or event bus is the fourth
stakeholder that manages relations between consumers and publishers[12].
● Collaborative filtering
● Content-based filtering
● Hybrid filtering
2.2.1 Django
● Ridiculously fast.
● Reassuringly secure.
● Exceedingly scalable.
5
real-time data feeds. Kafka can connect to external systems (for data
import/export) via Kafka Connect and provides Kafka Streams, a Java stream
processing library. Kafka uses a binary TCP-based protocol that is optimised
for efficiency and relies on a "message set" abstraction that naturally groups
messages together to reduce the overhead of the network round trip. This
"leads to larger network packets, larger sequential disk operations, contiguous
memory blocks which allows Kafka to turn a burst stream of random message
writes into linear writes.
2.2.3 PostgreSQL
2.2.4 SQLite
2.2.5 Next.js
6
iOS, macOS, tvOS, Web, Windows and UWP by enabling developers to use
the React framework along with native platform capabilities.
Tailwind CSS is a utility-first CSS framework for rapidly building custom user
interfaces.
2.3 Algorithms
The Base64 algorithm is one of the algorithms for Encoding and Decoding an
object into ASCII format, which is meant for the base number 64 or one of the
methods used to encode the binary data. The encoding principle is to select a
collection of 64 printable characters, so data can be stored and transferred
across media designed to handle text data, another use of Base64 encoding is
to obfuscate or randomize data. The term Base64 originates from a specific
MIME content transfer encoding.
Base64 encoding schemes are commonly used when there is a need to encode
binary data that needs to be stored and transferred over media that are
designed to deal with ASCII. This is to ensure that the data remain intact
without modification during transport. Base64 is commonly used in a number
of applications including email via MIME, and storing complex data in XML.
The characters generated by this Base64 transformation consist of A.Z, a..z
and 0..9, and attached to the last two characters symbolized + and/and one
character equal to (=) used for adjustment and fitting Binary data or the term is
applied to as filler fitting. The character of the symbol to be generated will
depend on the running algorithm process. Base64 cryptography is widely used
in the internet world as a medium data format to send data, this is because the
result of Base64 form is plaintext, then this information will be much easier to
send, compared to the format of information in the form of binary.
7
Chapter 3: Methodology
8
the life cycle. The process starts by interviewing the customers and developing the
incomplete high-level paper model. This document is used to build the initial
prototype supporting only the basic functionality as desired by the customer. Once the
customer figures out the problems, the prototype is further refined to eliminate them.
The process continues till the user approves the prototype and finds the working
model to be satisfactory.
As shown in the above diagram, three different processes have been listed. In the first
process, the steps for the creation of services by the renter have been shown.
Similarly, in the second process, the steps for making the reservation by any user have
been shown. In the third process, it shows the steps which occur for the creation and
consumption of the event. Here in this case, after the event is produced, it gets queued
in Kafka broker and then consumed by the consumer to process the tasks like
inserting/ updating database records, sending emails, uploading files, etc.
9
Chapter 4: System Design
A block diagram is a diagram of a system in which the principal parts or functions are
represented by blocks connected by lines that show the relationships of the blocks.
They are heavily used in engineering in hardware design, electronic design, software
design, and process flow diagrams.
Block diagrams are typically used for higher-level, less detailed descriptions that are
intended to clarify overall concepts without concern for the details of implementation.
Contrast this with the schematic diagram and layout diagrams used in electrical
engineering, which show the implementation details of electrical components and
physical construction.
Description: This project is an event-driven based rental system that can be used to
create room and vehicle services and make reservations for the available services. The
10
renter can use the web interface to create their services which are later displayed on
the respective listing pages. When the request for service creation arrives in the API
the system creates an event to create that service which is consumed by the consumer
to insert into the database, send emails and upload files to storage. Event-driven is the
core working principle of this system.
4.2 ER Diagram
In the above ER Diagram, we have five entities i.e. User, Room, Vehicle, Media and
Reservation shown in the rectangular boxes with their respective attributes in the
ellipse and relations in the diamond boxes. User and Room is one to many as a
rentee(user) can have many rooms however a room might belong to only one
owner(renter) at the same time. Similarly, User and Vehicle and Reservation are one
11
to many relationships. Here, the Media model belongs to both the Room and Vehicle
models. Similarly, the Reservation model belongs to both the Room and Vehicle
models.
As in the ER and Schema Diagram, we have five entities which are also shown in the
above figure.
12
Entities
● User
● Room
● Vehicle
● Media
● Reservation
We have used a new concept for the relationships i.e Polymorphic Relations which
can be noticed in the above figure 4.3. A polymorphic relationship is a relationship
where a model can belong to more than one other model on a single association. Here,
the Media model belongs to both the Room and Vehicle models. Similarly, the
Reservation model belongs to both the Room and Vehicle models. Following relation
convention is followed:
1. Users can create many Reservations.
2. A Renter(User) can create many Room and Vehicle Services.
3. Room and Vehicle can have one or many media files.
4. Room and Vehicle can have one or many reservations associated with it.
13
Figure 4.4 Use Case Diagram
14
Use Case: Update Profile
Actor: Rentee/Renter
Description: User can update their profile from the dashboard.
15
Figure 4.5.1 Sequence Diagram For Creating Services
database.
16
Figure 4.5.2 Sequence Diagram For Making Reservation
17
4.6 Class Diagram
18
Chapter 5: Results and Discussion
The project was completed with the creation of a rental system web app and mobile
app, where renters could create services for the rooms and vehicles respectively and
users or rentees can make reservations for the available services and view the
analytics part in the dashboard.
During the system implementation To test the system, we conducted manual creation
of the services by filling all the fields and uploading one image in order to record the
system response time in localhost.
Internet Speed: 25 Mbps
From the above table it can be seen that for most of the time the avg response time
was around between 0.1 to 1 second but in the case, without using event-driven
approach and it was more than 2 seconds.
19
To further test the analytics part of the system, we conducted the survey by creating
the user accounts, services and reservations.
Five Renter users were created along with the creation of services.
Table 5.2: List of Renter users along with no. of created services.
1 Bhimraj Yadav 2 3
2 Sudip Adhikari 2 3
3 Sirjan Baral 3 2
4 Kiran Shrestha 3 2
5 Elite Automobiles 0 2
Then after that two users named Ramesh and Hari were created for making the
reservation and visualizing the analytics part.
Ramesh reserved a room for 5 days with a per-day price of Rs.850 and a bike for 3
days with a per-day price of Rs.1000 which were owned by Sudip and Sirjan
respectively. Similarly, Hari reserved a room for 2 days with a per-day price of Rs.950
and a car for 1 day with a per-day price of Rs.8500 which were owned by Sudip and
Elite respectively.
Analytics for Renters:
Sudip:
a) Total Sales Item: 2 Elite:
b) Total Sales Amount: 6150 a) Total Sales Item: 1
Sirjan: b) Total Sales Amount: 8500
a) Total Sales Item: 1
b) Total Sales Amount: 3000
20
Chapter 6: Conclusion
The project aims to create a rental system web app and mobile app based on an
event-driven architecture with the help of immensely growing technology like Kafka
and various other frameworks. This study was designed to understand event-driven
architecture and how it can be implemented to create a rental system. This has also
helped in a better understanding of how an event flows and is streamed. With this
project, through a web interface renters can create rooms/vehicles services and also
visualize the analytics from the dashboard. Similarly, users/customers can make
reservations for the respective services and also see the analytics of the reservations.
21
Chapter 7: Limitations and Future Works
Limitations:
The limitations of the project are:
● This type of system can get costlier for small scale business as it comprises
several services.
● Creation of services might get interrupted if the proper flow of
messages/events breaks.
● The system’s architecture can increase the complexity of API/Backend.
Future Enhancements:
22
References
[3] C.S. Mon, T.K. Tee and A.A. Hussin, “A Prototype of a Mobile Car Rental
System”, Journal of Physics: Conference Series,2020.
[9] K. Waehner, “Use Cases and Architectures for Apache Kafka across
Industries”[Online].Available:https://www.kai-waehner.de/blog/2020/10/20/apac
he-kafka-event-streaming-use-cases-architectures-examples-real-world-across-i
ndustries
[12] S.D. Labey, E. Steegmans, “On the promises and challenges of event-driven
service-oriented architectures.”, JOUR,2008.
[13] B. Schiffer, C. Deotte etc. “Using Deep Learning to Win the Booking.com
WSDMWebTour21 Challenge on Sequential
Recommendations”,http://ceur-ws.org,2021.f
23
Appendices
24
Figure A3 Making Reservation
25
Figure A5 Renter Dashboard
26
View publication stats
27