0% found this document useful (0 votes)
82 views7 pages

Cep Sere

The document discusses a scenario where the Diners website is experiencing slow response times due to high traffic and order volumes. It analyzes the technology stack used by Diners and identifies several potential reasons for the slow performance, including large page sizes, server configuration issues, slow database queries, network latency, and inefficient code. To address this, it recommends various software re-engineering changes like horizontal scaling, database optimization, caching, asynchronous processing, and frontend code optimization. It also outlines strategies like scalability, caching, asynchronous processing, load testing and monitoring to manage huge traffic loads. Finally, it notes that while refactoring code could help performance if issues relate to code quality, it may not be sufficient on its own and should be

Uploaded by

Milton
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views7 pages

Cep Sere

The document discusses a scenario where the Diners website is experiencing slow response times due to high traffic and order volumes. It analyzes the technology stack used by Diners and identifies several potential reasons for the slow performance, including large page sizes, server configuration issues, slow database queries, network latency, and inefficient code. To address this, it recommends various software re-engineering changes like horizontal scaling, database optimization, caching, asynchronous processing, and frontend code optimization. It also outlines strategies like scalability, caching, asynchronous processing, load testing and monitoring to manage huge traffic loads. Finally, it notes that while refactoring code could help performance if issues relate to code quality, it may not be sufficient on its own and should be

Uploaded by

Milton
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Software Re-engineering (SW-415)

Dept of Software Engineering


Mehran University of Engineering and Technology, Jamshoro

Complex Engineering Problem

Submitted to: Sir Salahuddin Saddar

Group Members:
19SW27, 19SW29, 19SW111, 19SW115, 18-19SW115
Consider a scenario (your choice website) where B to C application is running. The
application enables the users to buy the products of their choice unlimited time.
After a while when the traffic increases the response of the application becomes
slow. All the customers’ requests take too much time to be completed. This is the
overhead to be addressed.
Chosen website for this scenario: Diners (https://diners.com.pk)
Technology Stack used:
After analyzing the website, inspecting and looking up online technology lookup sites
e.g. BuiltWith, etc, we came to conclusion that the website is completely built with Core
JS. The facebook’s most famous Javascript is used to build this website.
It also uses Shopify module, which is basically a famous e-commerce platform used to
manage online stores and businesses.
Overall, the technology stack used by the Diners website appears to be a combination of
popular and widely used technologies.

Issue Faced: Due to increase in the traffic, orders and requests; the website is
responding so slowing and taking a lot of time to process requests!
Reason:
There are multiple reasons possible for the slow response time. Some of the reasons are
listed below:
 Large page sizes: Websites with large page sizes, such as those with high-quality
images or videos, may take longer to load and result in slow response times.
As in our case, there are a lot of products displayed on the Diners website, thus on
large number of persons hovering the page will result in slow response time.
 Server configuration: The server configuration, such as the amount of memory or
processing power allocated to the server, can impact the website's response time.
In our case, the Diners might be using a low-quality content delivery network or
the server configuration needs to be reconfigured to improve scalability.
 Database performance: If the website relies on a database, poor database
performance, such as slow queries or a lack of indexing, can impact the website's
response time.
In our case, the database consists of a lot of rows and tables due to a marvelous
number of products available in the store.
 Network latency: The speed and reliability of the internet connection between the
user and the website's server can impact the website's response time.
In our case, it is quite possible the users facing the issue might be on a laggy or
slow internet connection.
 Third-party integrations: Third-party scripts or plugins, such as advertising or
tracking scripts, can impact the website's response time if they are poorly
optimized or take too long to load.
In our case, Diners seems to use a lot of third-party integrations to fulfill and
achieve the missions it is built for such as Shopify, CDN, etc.
 Code optimization: Poorly written or inefficient code can impact the website's
response time, especially if the code is executed frequently or in large volumes.
In our case, these can be the reasons for the slow response time. We are going to answer
the questions asked below:

Q1: What Re-Engineering changes do you make to achieve less response time?
As software re-engineering experts, if we were facing a situation where the Diners
website was experiencing slow response times due to high traffic and order volume, we
would consider the following re-engineering changes to improve performance:
 Introduce horizontal scaling: One of the most common ways to handle increased
traffic is to add more servers and distribute the load across them. This can be
achieved through horizontal scaling, which involves adding more servers to the
application architecture and using a load balancer to distribute traffic evenly across
them. This can improve response times by reducing the load on each server and
allowing the application to handle more traffic.
 Optimize database queries: Slow database queries can be a significant bottleneck
for web applications. We would review the database queries used by the
application and optimize them as much as possible. This could include adding
indexes, rewriting queries, or using a caching layer to reduce the number of
queries needed. By optimizing database queries, we can reduce the amount of time
it takes for the application to fetch data from the database and improve overall
response times.
 Implement caching: Caching is an effective way to improve response times by
reducing the load on the server. By caching frequently accessed data, such as
database queries or frequently accessed HTML fragments, we can reduce the
number of requests that the server needs to process and improve response times.
Additionally, using a CDN to cache static assets such as images, CSS, and
JavaScript can reduce the load on the server and improve overall performance.
 Use asynchronous processing: Asynchronous processing can be used to handle
long-running tasks in the background, allowing the server to respond to requests
more quickly. This can be achieved using message queues or background
processing systems such as RabbitMQ or Celery. By offloading long-running tasks
to the background, we can reduce the amount of time it takes for the server to
respond to requests and improve overall response times.
 Optimize frontend code: Optimizing the frontend code can help to improve page
load times and reduce the load on the server. This could include techniques such as
minification, compression, and lazy loading of images and other assets. By
reducing the amount of data that needs to be loaded by the browser, we can
improve page load times and reduce the load on the server.
These are some re-engineering changes that can be considered to improve the response
time of the application.

Q2: What software engineering strategies you plan to manage the huge traffic?
To manage huge traffic, as software engineering experts, We would plan to use the
following strategies:
 Scalability: To handle high traffic, we need to design the system to be scalable.
This involves breaking down the application into smaller, more manageable
components and deploying them across multiple servers. We can use load
balancers to distribute traffic across these servers and ensure that each server is not
overwhelmed with requests. We can also use technologies such as auto-scaling to
automatically add or remove servers based on the traffic load.
 Caching: Caching can be used to improve performance by reducing the load on
the servers. We can cache frequently accessed data, such as database queries or
HTML fragments, to reduce the number of requests that need to be processed by
the server. We can also use a better content delivery network (CDN) like
Cloudflare to cache static assets such as images, CSS, and JavaScript files, which
can reduce the load on the server and improve overall performance.
 Asynchronous processing: Asynchronous processing can be used to handle long-
running tasks in the background and improve the responsiveness of the
application. We can use message queues or background processing systems such
as RabbitMQ or Celery to offload these tasks from the main server and reduce the
amount of time it takes to respond to requests.
 Database optimization: Slow database queries can be a bottleneck for web
applications. We can optimize the database queries by adding indexes, rewriting
queries, or using a caching layer to reduce the number of queries needed. This can
help to reduce the load on the database and improve overall performance.
 Load testing: To ensure that the application can handle high traffic, we need to
perform load testing to simulate the traffic load and identify any performance
bottlenecks. We can use tools such as Apache JMeter or LoadRunner to perform
load testing and identify any issues that need to be addressed.
 Continuous monitoring: We need to continuously monitor the performance of the
application and identify any issues before they become critical. We can use tools
such as New Relic or AppDynamics to monitor the application and identify any
performance issues in real time. We can also set up alerts to notify us if the
performance of the application drops below a certain threshold.
By using these strategies, we can design and build a system that can handle high traffic
and provide a responsive experience to the users.

Q3: Can software refactoring (restructuring) rescue the application from poor
response?
Software refactoring (restructuring) can potentially help rescue an application from poor
response times, but it depends on the specific reasons for the poor response times.
Refactoring is the process of restructuring existing code without changing its behavior to
improve its quality, readability, and maintainability. If poor response times are due to
poorly written or complex code, refactoring may help by simplifying the code, removing
unnecessary code, and improving the overall performance of the application.
However, if the poor response times are due to issues such as scalability or database
performance, refactoring may not be enough on its own to solve the problem. Then, it's
important to note that refactoring can also introduce new bugs or issues, so it should be
done carefully and with appropriate testing to ensure that it does not negatively impact
the application's performance or functionality.
In summary, software refactoring can potentially help rescue an application from poor
response times, but it should be considered as part of a larger strategy that addresses the
specific issues causing the poor response times.

Q4: What different software re-engineering techniques be applied to come out of


this problem?
There are several software re-engineering techniques that can be applied to improve the
performance and response time of an application. Some of these techniques are:
Componentization or Modularization: Componentization involves breaking down the
application into smaller, more manageable components that can be independently
developed, tested, and deployed. This can help improve the maintainability and
scalability of the application, making it easier to manage large traffic volumes.
Microservices: Microservices architecture involves breaking down the application into
smaller, independent services that communicate with each other over an API. This can
help improve the scalability and maintainability of the application by allowing each
service to be independently deployed and scaled as needed.
Parallelization: Parallelization involves breaking down a task into smaller sub-tasks that
can be executed simultaneously across multiple threads or processes. This can help
improve the performance of the application by utilizing multiple resources in parallel.
Caching: Caching involves storing frequently accessed data in memory or on disk to
reduce the number of requests that need to be processed by the server. This can help
improve the performance of the application by reducing the load on the server.
Database optimization: Database optimization involves improving the performance of
database queries by adding indexes, optimizing queries, or using a caching layer to
reduce the number of queries needed. This can help improve the performance and
response time of the application by reducing the load on the database.
Code optimization: Code optimization involves identifying and removing bottlenecks in
the code that are causing poor performance. This can involve optimizing algorithms,
removing unnecessary code, or refactoring code to improve performance.
These are just a few of the software re-engineering techniques that can be applied to
improve the performance and response time of an application.

Q5: How backward and forward slicing on source code could make positive impact?
Backward and forward slicing on source code can potentially make a positive impact by
helping to identify and isolate code that is responsible for poor performance or issues in
the application.
Backward slicing involves identifying the code that directly or indirectly affects a
specific output or result. This can be useful for identifying the code that is responsible for
a specific issue or error in the application. By identifying and isolating the relevant code,
developers can focus on fixing the specific issue without having to navigate through the
entire codebase.
Forward slicing, on the other hand, involves identifying the code that is directly or
indirectly affected by a specific input or condition. This can be useful for identifying the
code that is impacted by changes in the application or in the external environment.
By using backward and forward slicing techniques, developers can more easily identify
and isolate the specific parts of the code that are responsible for issues or performance
problems. This can help reduce the amount of time and effort required to fix issues and
optimize performance, leading to a more efficient and effective development process.
In addition, slicing techniques can also help improve the maintainability and scalability
of the codebase by isolating and modularizing different parts of the code. This can make
it easier to manage and update the code over time, leading to a more stable and reliable
application.

You might also like