Revolutionizing Digital Pharmacy: The Farmazon API Gateway Integration Case Study

Alperen Ruhbaş
bestcloudforme
Published in
3 min readNov 24, 2023

Executive Summary

Founded in 2014 as the first B2B marketplace for pharmacies, Farmazon is the leading software company with a vibrant community of 26.000 pharmacists out ot 30.000 all over the country. Farmazon’s infrastructure runs on AWS. Auto-scalable services such as AWS Lambda, Amazon EKS are preferred according to incoming traffic which increases during work hours and decreases after work hours.

About customer

Farmazon has the richest product portfolio of the OTC sector and it aims to provide a marketplace for it’s users where all products are accessible with lower unit prices no matter where the pharmacy is located. It also gives its users the opportunity to sell which opens a whole new chapter for pharmacies economically. Scalability, accessibility, high availability, customer satisfaction, ease of use, fast delivery, secure payment and sustainability are key structures Farmazon is built upon.

Customer Challenge

Farmazon has developed a feature for its customers to shop at affordable prices. High availability and performance are essential as this feature is part of the checkout step. This feature was created to meet only 1 request, moreover, it should handle the incoming traffic during working hours and should not create any additional burden. In addition, the solution proposal to be implemented should include REST API support and should be able to respond to the answers received by the client, again over REST.

Partner Solution

Considering the performance and usability criteria for the requirements here, Bestcloudforme suggested that REST support is provided with API Gateway and that it is appropriate to run the application on AWS Lambda in a serverless way in the background.

Bestcloudforme has supported Farmazon in performing the following parts:

  • Positioning ApiGateway before Lambda
  • Positioning Lambda in a Private Subnet with security in mind.

The related application setup has been created in a serverless way in order to respond quickly to the client side. The aim here is to reduce the dependency on the Kubernetes side and to benefit from the speed efficiency in the AWS serverless structure by getting rid of the processes on Kubernetes. In this way, the client side can be answered quickly. The customer’s need here was resolved through API Gateway and Lambda services.

A Lambda function was created using .net for the related smart basket application. This Lambda function was deployed and API Gateway was added in front of it. The purpose of API Gateway here is to provide REST API support to the structure. In the “Resources” section on API Gateway, an endpoint definition has been made to meet the customer’s needs. A structure has been designed to respond to the POST requests following this endpoint definition. Incoming POST requests are defined under “Method Request” and then configured to be forwarded to the Lambda function via “Integration Request”. After the lambda function processes the incoming requests, it is transmitted to the “Method Response” section over the “Integration Response”. Thus, the necessary information is returned to the client side.

Results and Benefits

There is no maintenance cost.

Response times are reduced as the system is auto-scalable

The system is cost-effective thanks to automatic scalability.

Since this feature is located on Lambda, it is isolated from other components.

Deployments can be performed quickly, including rollback scenarios.

Thanks to API Gateway, the customer’s REST API support is provided without any problems and there is no need for additional development in the application.

Thank you so much for taking the time to read this article. I hope you found the information helpful and valuable. If you have any questions, comments, or feedback, please feel free to reach out.

Contact E-Mail: hello@bestcloudfor.me

--

--