Recently we started working with a healthcare company that was facing slow API response time causing a bad user experience. The customer is a US-based Healthcare company solving the lack of healthcare interoperability with its patient-centered mobile platform, from where patients can engage, communicate and participate in their healthcare across various providers that might be using different PM/EHR/EMR products.
The product includes a SaaS platform for healthcare providers to share and communicate patient health information along with its cutting-edge point-of-service patient check-in app for waiting rooms.
Due to the complex nature of the product, one of the requirements of the product team was to solve this issue without changing a lot of existing code. The client had already evaluated a couple of paid tools that were working great but very costly, so another challenge was to find an open-source tool that can serve the purpose. Hence, we had a two-pronged challenge- Improve performance and reduce cost.
We started doing some research and found tools like Solr which seemed like a good fit for us initially, but while we were almost close to setting it up, we thought to get some detailed insights from API response times which opened up new revelations for us making Solr insignificant. Some of the stats from different APIs were like this –
API | TOTAL TIME | DATABASE CALL | % TIME CAN BE OPTIMISED USING SOLR |
---|---|---|---|
PCP | 2192 ms | 662 ms | 30% |
Allergy | 3758 ms | 475 ms | 12% |
So after looking at low level timings, it was found that database call was not that a bigger culprit, there were some calculations happening on backend which were causing the major delays along with SSL handshake and a few other things. So we started rethinking about a new approach to solve this problem.
Few months back I had seen Slack case study on AWS and how they improved their API performance using Cloudfront. This triggered me to go back and check AWS documentation for the same. I started playing around with Cloudfront for custom origins. Till now, we had used CloudFront alongside S3 for static website hosting which had worked well.
After configuring cloudfront for one API we were able to achieve almost 233% improvements in API response time without changing single line of code on backend. Below figure depicts the results after using Cloudfront.
API | BEFORE CF | AFTER CF | % IMPROVEMENT |
---|---|---|---|
PCP | 2192 ms | 14 ms | 197% |
Allergy | 3758 ms | 16 ms | 233% |
So far all good, but how to configure Cloudfront to achieve such results? Below are the steps which can help anyone to configure Cloudfront with existing APIs.
At Mindbowser, I and my CEO teamed together to build an agency that can bring the best of tech and knowledge for founders.
In case you would like to discuss your options further, feel free to get in touch at pravin@mindbowser.com or book a 30 minutes free consultation call!
Get Free Consultation!Assuming Cloudfront is deployed, it’s time to configure behaviors for caching. I am using the above example to configure two APIs /search/pcp and /search/allergy to cache the content based on our needs. Here are the steps for same –
Once the distribution is ready, you can copy the Cloudfront URL and hit the API. Note down the response time. Now hit the same API again and compare the response time. You will see a big difference in the response time which means caching is working. Follow the above steps for adding multiple behaviors.
While implementing one of the challenges was that we needed to cache the response only when certain request parameter value is available. In our case, our backend was sometimes hitting our own database or hitting third party depending on request parameter value. Whenever we are hitting third-party API we don’t want to cache the result. We have handled this using max-age=1 parameter in API response, so whenever Cloudfront finds max-age=1 it caches for 1 second and overrides default settings. Now backend has control on what to cache and when.
One of the requirements was to update the cache whenever the backend database is updated, so we wrote the AWS Lambda function to invalidate specific cache entries using Cloudfront invalidate API. We exposed this lambda function using AWS API gateway so that our backend can call the API and invalidate the specific cache entries based on which DB values are updated. I will cover this in our upcoming blogs.
The new architecture turned the response time down to less than half of the original resulting in faster responses which in turn made the end-user delighted. All this was done without having to change any aspects of the core application or any downtime for the application.
In the end, the customer was happy to see savings for a time as well as cost.
Register Now for the Masterclass to Epic Integration with SMART on FHIR Webinar on Thursday, 10th April 2025 at: 11:00 AM EDT
Register NowMindbowser played a crucial role in helping us bring everything together into a unified, cohesive product. Their commitment to industry-standard coding practices made an enormous difference, allowing developers to seamlessly transition in and out of the project without any confusion....
CEO, MarketsAI
I'm thrilled to be partnering with Mindbowser on our journey with TravelRite. The collaboration has been exceptional, and I’m truly grateful for the dedication and expertise the team has brought to the development process. Their commitment to our mission is...
Founder & CEO, TravelRite
The Mindbowser team's professionalism consistently impressed me. Their commitment to quality shone through in every aspect of the project. They truly went the extra mile, ensuring they understood our needs perfectly and were always willing to invest the time to...
CTO, New Day Therapeutics
I collaborated with Mindbowser for several years on a complex SaaS platform project. They took over a partially completed project and successfully transformed it into a fully functional and robust platform. Throughout the entire process, the quality of their work...
President, E.B. Carlson
Mindbowser and team are professional, talented and very responsive. They got us through a challenging situation with our IOT product successfully. They will be our go to dev team going forward.
Founder, Cascada
Amazing team to work with. Very responsive and very skilled in both front and backend engineering. Looking forward to our next project together.
Co-Founder, Emerge
The team is great to work with. Very professional, on task, and efficient.
Founder, PeriopMD
I can not express enough how pleased we are with the whole team. From the first call and meeting, they took our vision and ran with it. Communication was easy and everyone was flexible to our schedule. I’m excited to...
Founder, Seeke
Mindbowser has truly been foundational in my journey from concept to design and onto that final launch phase.
CEO, KickSnap
We had very close go live timeline and Mindbowser team got us live a month before.
CEO, BuyNow WorldWide
If you want a team of great developers, I recommend them for the next project.
Founder, Teach Reach
Mindbowser built both iOS and Android apps for Mindworks, that have stood the test of time. 5 years later they still function quite beautifully. Their team always met their objectives and I'm very happy with the end result. Thank you!
Founder, Mindworks
Mindbowser has delivered a much better quality product than our previous tech vendors. Our product is stable and passed Well Architected Framework Review from AWS.
CEO, PurpleAnt
I am happy to share that we got USD 10k in cloud credits courtesy of our friends at Mindbowser. Thank you Pravin and Ayush, this means a lot to us.
CTO, Shortlist
Mindbowser is one of the reasons that our app is successful. These guys have been a great team.
Founder & CEO, MangoMirror
Kudos for all your hard work and diligence on the Telehealth platform project. You made it possible.
CEO, ThriveHealth
Mindbowser helped us build an awesome iOS app to bring balance to people’s lives.
CEO, SMILINGMIND
They were a very responsive team! Extremely easy to communicate and work with!
Founder & CEO, TotTech
We’ve had very little-to-no hiccups at all—it’s been a really pleasurable experience.
Co-Founder, TEAM8s
Mindbowser was very helpful with explaining the development process and started quickly on the project.
Executive Director of Product Development, Innovation Lab
The greatest benefit we got from Mindbowser is the expertise. Their team has developed apps in all different industries with all types of social proofs.
Co-Founder, Vesica
Mindbowser is professional, efficient and thorough.
Consultant, XPRIZE
Very committed, they create beautiful apps and are very benevolent. They have brilliant Ideas.
Founder, S.T.A.R.S of Wellness
Mindbowser was great; they listened to us a lot and helped us hone in on the actual idea of the app. They had put together fantastic wireframes for us.
Co-Founder, Flat Earth
Ayush was responsive and paired me with the best team member possible, to complete my complex vision and project. Could not be happier.
Founder, Child Life On Call
The team from Mindbowser stayed on task, asked the right questions, and completed the required tasks in a timely fashion! Strong work team!
CEO, SDOH2Health LLC
Mindbowser was easy to work with and hit the ground running, immediately feeling like part of our team.
CEO, Stealth Startup
Mindbowser was an excellent partner in developing my fitness app. They were patient, attentive, & understood my business needs. The end product exceeded my expectations. Thrilled to share it globally.
Owner, Phalanx
Mindbowser's expertise in tech, process & mobile development made them our choice for our app. The team was dedicated to the process & delivered high-quality features on time. They also gave valuable industry advice. Highly recommend them for app development...
Co-Founder, Fox&Fork