logo
  • Home
  • Services
    • Application Development
    • Legacy Modernization
    • Business Intelligence
    • Internet of Things (IoT)
    • Artificial Intelligence
    • DevOPS & NextOPS
    • Machine learning
    • Quality Automation
  • Resources
    • Blogs
    • Case Studies
    • News & Articles
  • About Us
  • Contact
logo
logo

  • Home  
  • Performance Improvements In APIs : Significant improvement in the API

Categories

  • Blogs
  • Case Studies
  • News & Articles

Recent Posts

How Telecoms Can Lead The Future With IoT Services

  • By Admin
  • March 20, 2023

Top 10 Must-Have Features For Online Survey Tool

  • By Admin
  • March 2, 2023

How To Choose The Best Migration Service Provider?

  • By Admin
  • February 21, 2023

Why Should You Migrate Your Software From Legacy System To Cloud?

  • By Admin
  • February 20, 2023

DWP Global Wins “Dream Companies to work for” at WORLD HRD CONGRESS

  • By Admin
  • February 19, 2023

DWP Global Corp. being featured on Cover page of Insights Success Magazine

  • By Admin
  • February 14, 2023

Performance Improvements In APIs : Significant improvement in the API

  • By Admin
  • February 14, 2023

DWP Global signs a large IoT project with a UK Giant

  • By Admin
  • February 6, 2023

DWP Global signs a Global Implementation Partnership with KOFAX

  • By Admin
  • February 6, 2023

Leveraging Big Data Analytics In Manufacturing To Drive Value

  • By Admin
  • December 16, 2022

Opening Hours

  • 9:00AM to 06:00PM
  • 9:00AM to 06:00PM
  • 9:00AM to 06:00PM
  • 9:00AM to 06:00PM
  • Closed
  • 9:00AM to 06:00PM
  • 9:00AM to 06:00PM
Case Studies

Performance Improvements In APIs : Significant improvement in the API

  • By: Admin
  • February 14, 2023

Case Study

1. Title: Performance Improvements in APIs

2. Sub-Title: Significant improvement in the API responses after effectively changing the query structure.

3. Client background:
DWP Global Corp, a pioneer in Legacy application modernization services worked closely with a UK based company who is a leader in ground penetration detection devices. The client had legacy applications build on Microsoft Technologies which also used non-relational databases like MongoDB along with Azure Active Directory.

4. Challenges:
•Modernizing the Legacy Applications
•Improving the Application performance through effectively querying the Data bases.
•Fetch the data from multiple databases.

Detailed Description of the Problem Statement:
Requirements:
In the client’s application User Interface, the list of all users is to be displayed in a grid with a default sorting option. License, First Name, Last Name, User Name, Role, Time/Date Filter, and Account Status were few fields on the filter. Based on the application of the selected filter elements, the system shall display the results in a gird format.

Description:
The legacy application deployed an API service that has to retrieve the data from the Database (i.e., MongoDB and Azure Active Directory). The requirement was to retrieve a list of users who are in both MongoDB and Azure Active Directory. As we have sorting and filters on User Interface, an endpoint with the POST method was implemented to retrieve data from the database. When tested for efficiency in local environment, the implemented endpoint POST method took 31.40 seconds to retrieve just 99 records. Thus making the application tedious and slow.

5. Solution
1. Bearer Token: Every time the API made a call to the Microsoft endpoint to generate a new token. This token expires every one hour. Hence there was a need to call this endpoint and store the token in local variable to re-use it within 1 hour. This was we could reduce the Microsoft endpoint execution times in an hour for token generation.
Before changes: 3 seconds (each time execution)
After changes: 0 seconds

2. Calling the DB Multiple Times:
Multiple calls were made to MongoDB to get data specific records. This led to lower performance of APIs. Hence, instead of making multiple calls to the database, we could modify the query which would make just one single call to get all records from MongoDB / Azure AD and store it in a local variable. Used local variable whereverrequired with LINQ query on specific user id. A script “UsersValidFromAD“ was designed to frequently retrieve data from Azure AD. This wasconfigured in AppSetting file.
Before changes: 2 seconds (each time execution)
After changes: 0 seconds

3. To List () in MongoDB query:
Once a query is properly built with all filters and sorting then we used ToList () on the query to retrieve a list of records.
Before changes: 7 seconds
After changes: 3 seconds

4. Find in LINQ query:
Indexing will not work for the Find method on MongoDB collection, so we preferred to use the Where Method. Before changes: 4 seconds
After changes: 1 seconds

API Execution Times: 

Load Test:
POST {{base_url}}/v1/API_ServiceName/users
Performance testing for above endpoint using JMeter and below are the Performance test results.

6. Key benefits:
• Bearer Token:
Before changes: 3 seconds (each time execution)
After changes: 0 seconds

• Calling the DB Multiple Times:
A single call was made to both MongoDB and Azure AD to retrieve and store the data in a local variable.
Before changes: 2 seconds (each time execution)
After changes: 0 seconds

•To List () in MongoDB query:
Before changes: 7 seconds
After changes: 3 seconds

•Find in LINQ query:
Before changes: 4 seconds
After changes: 1 seconds

7. Factors that contributed to Performance Improvement:
Below are the steps that were followed to improve the Performance
1.Logs: Implemented logs to find the code where it takes more time in execution.
2.In detailed Logs: Based on logs, we go into deep logs which methods take more time in execution.
3.Identifying a line of code that takes more time in execution: Identifying which line of code takes more time in execution ,to enhance the performance of those lines.
4.Alternative solution: Looking for alternative ways to improve performance on Identified lines.
5.Verify logs after changes: Need to check logs after code change

Previous Post
Next Post

Leave A Comment Cancel reply

DWPGLOBAL CORP

Corporate Office (USA)
500 College Road East, Suite 205, Princeton NJ 08540
Offshore Development Center (INDIA)
Sandhya Techno -I, 5th Floor
Raidurg, Gachibowli
Hyderabad -500081
  • Call us
    +91 9390509080
    +1 (732) 374-9123
  • contact@dwpglobalcorp.com

What We Offer

  • Artificial Intelligence
  • Machine learning
  • DevOPS & NextOPS
  • Quality Automation
  • Business Intelligence

About Us

  • Services
  • About Us
  • Case Studies
  • Blog

Support

  • News and Events
  • Privacy Policy
  • Terms Of Use
  • Contact Us

Get In Touch

Get the latest news & updates
© 2022 DWP Global Corp.. All rights reserved.