Modern coding myths
Micro services or API layer design the most non avoidable design patterns, any product can adopt to evolve into more robust design. It is interesting to look at different patterns from rest or aggregated api with graphql as BFF or server less and working with cloud and Messaging
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Sunday, October 4, 2026
Saturday, April 18, 2026
Scalable application Design - Example app EasyWin
In this application design important design consideration discussed mainly to make sure at least 1k concurrent users can use this app and also required reporting regarding review of content and dashboards. Major design objective is to scale this app to work with more users and more content.
AI First approach is new Design paradigm . Always I will check the patterns from Microsoft and one of their training on Modernizing web apps, the search using vector db and getting data from pdfs related to hotels and facilities in hotels and accepting user voice commands and in some cases text to sql conversion. The present app design also follow same approach to adopt AI in its design and my Favorite repo for design reference is "Eshop container" for API/Micro service design.
- UI developed for both desktop and Mobile
BFF to also other benefits like flexibility of response data fields based on UI requirement . Which can reduce number of end points required . Apollo graphql client can add lot of inbuild capabilities as Talash has many apps so even it is possible to achieve graphql federation and sharing schemas across apps.accept graphql requests from UI. This helps to in both aggregating services and
- Major objective is to make it as framework based on micro services so that all Talash apps can share the services quickly and reusability will be better.
- Operability point of view azure logging and using cloud for deployment can help to scale this app. Come across a tool where logs will show sql fired for that functionality and params passed to that sql Even though the code developed with ORM. that is quite innovative and reduce time to resolve issues quite quickly. These kind of tools integrations makes operability better. My favourite is serilog for logging as it has lot of integrations and data dog which can show response time of each api end point quickly. At some point I am using data dog to compare response time of each api between two releases and find out any performance issues quickly.
- Scalability wise either event driven or service bus processing should be implemented to handle high volumes of request processing wherever possible.
- Lot of analytics tools integration like data bricks , power BI helps to understand the user analytics and trends on the app and can help lot in enhancing the geo based or demographic based useful and prime content which can increase user engagement.
- Objective of all talash apps is not hosting huge content but just hosting prime content and user should be easy to grab prime content from web and can share and save for day to day use.
- App service for BFF can be made higher tier compared to Basic or Free tier. When I try to use function app which process data for 20 sec and scheduled for 5 min. total free cpu time for free tier exhausted. i.e 12 jobs per hour 24 hours running for 20 sec each job. 20*24*12 /60 min. Next app service tier may cost aorund 100$. so if we use data bricks for extraction of data and updating mongo db. It can save lot of cost on hardware.
- Async calls and using Service bus can increase decoupling of components.
- UI will post the upload data to Blob storage. Which can handle most of the calls and some bench marking can be done.
- Major processing is reading the user input and parsing the content and then pushing data to DB. This could be quite time consuming processing . Mongo DB can handle concurrent requests pretty well and the Back end component should use Tasks and update DB with bulk updates.
- Logging should use non blocking calls as well with proper tags so that session stitching quickly and retrieve required logs for analysis
- Additional component where user can give email and upload content.
- Admin can monitor the content and can delete based on some exceptions.
- As given above the content for review can use some of the AI features where
- the content can be analysed offline and mark content for ready for review.
- Using AI components will be costing bit more compared to manual work but
- can automate lot of review process.
- No user data will be saved at this stage as User login functionality is not attached to
- private data . This will be major enhancement once complete functionality is working fine.
1. AI Engine: Objective is to evaluate different AI capabilities related to image, video and should be able to get classification data correctly so that review can be automated as much as possible. Google lense api and Azure cognitive service custom vision are used in this POC. so any url for image should get right classification and if it matches any of the categories defined content can be promoted automatically otherwise will be left in manual review queue.
First POC is based on Zero-Shot Classification
In talash.azurewebsites.com unique thing is getting some key functionality based on AI capabilities so that they can give better results. First POC is getting trends on AI based fucntionality. Here any content viewed or liked or downloaded will be added to queue for further processing if it can match any of the trending content. Here Azure AI computervision will do classfication and then hugging face alogorithem zero shot classfication(LLM) will do categoriezation and filtering. If every thing gives good results it will be added to the trending topics and then new trends will be calculated.
Similar exercise also done for bring relevant videos from YouTube based on PDF content. Here AI text analyzer used to summarize document and more algorithms used to match YouTube videos and all scenarios first filtering of unwanted content is done before really linking the pdf to videos or content to show it as tending.
Above approach basically make sure that capability based on right content instead of spending more time later to filter spam and other processing which may not be possible after some time.
All trending data will be passed to this LLM and get category and save them. Top category tending data can be shown as top trending category to user.
The same categorization will be used to filter content before adding it to trending to avoid any unwanted data. So same data will be processed on labels which can filter spam then actual label to capture trends in category like art, fashion or cars.
2. Contest Wizard: Very simple Wizard/UI where User can use it to join contest and upload content and get information related to contest details and results.
3. Rule engine: a simple rule engine where it can detect users activity and find some spam like duplicating data or some spam data detection or other rules related to geography or demographic.
4. Rule engine: to configure contest rules dynamically for each contest. Instead of adding thorough code for changes in contest.
5.Notification engine: A Batch job which can send information about contests and track analytics regarding about contests.
Important new components. are the following.
- Validation of email if possible one time password.
- Save file content and user details .
- Validation of Data using AI services and manual services
- Validation rules implementation.
- Major AI services including
- Getting content description like image related data e.g. description..
- Getting copy rights of the content.
- Scanning for adult content.
- Checking duplicates .
- Separating premium and well classified data.
- Review UI
- Implementing approval stages for the content from ingest, review, final .
- Promoting data based on criteria.
- Analytics and dashboards using Data bricks.
- Enhance BFF and make it more modular by creating library for feature.
- Loggin in to Azure.
- Module should be pluggable into system so separate Data base, separate angular component and separate function app and service bus. Only BFF will be shared component from the talash.azure.com.au components.
Friday, January 16, 2026
Design Upgrade X1: performance , cold starts in cloud and tools
In this article we will look in to finetuning aspects of application design which are different from horizontal and vertical scaling.
Use case is my portal www.talash.azurewebsites.net where loading time for landing page is around 19 sec. and reduced to 500ms.
How to fine tune and optimize loading time depends on application. But there are general guide lines to achieve it as well. Like db indexing, multi threading / multi tasking , avoiding sync calls. Once we follow best coding practices above few things can be achieve. But in the above use case still I am getting 19sec as response time for the landing page. I started looking at what else required to achieve better performance. Come across "cold starts" and added latency in cloud. Try to avoid high resolution pictures in landing page and used Cloudanary to get some help from CDN aspect and then Cache design for Graphql calls. and other techniques working as expected. Let us get in to more details of each technique and use case .
ref: How to Conquer Cold Starts for Better Performance - The New Stack
- Deploy your function as a .zip (compressed) package. Minimize its size by removing unneeded files and dependencies, such as debug symbols (.pdb files) and unnecessary image files.
- For Windows deployment, run your functions from a package file. To do this, use the
WEBSITE_RUN_FROM_PACKAGE=1 app setting. If your app uses Azure Storage to store content, deploy Azure Storage in the same region as your Azure Functions app and consider using premium storage for a faster cold start.
- When deploying .NET apps, publish with ReadyToRun to avoid additional costs from the JIT compiler.
- In the Azure portal, navigate to your function app. Go to Diagnose and solve problems, and review any messages that appear under Risk alerts. Look for issues that may impact cold starts.
- If your app uses an Azure Functions Premium or App Service plan, invoke warmup triggers to preload dependencies or add custom logic required to connect to external endpoints. (This option isn’t supported for apps on consumption plans.)
- Try the “always ready instances” feature in our newest hosting option for event-driven serverless functions, Flex Consumption, which is in early access preview. This plan supports long function execution times and includes private networking, instance size selection, concurrency control, and fast and large scale-out features on a serverless model.
WEBSITE_RUN_FROM_PACKAGE=1 app setting. If your app uses Azure Storage to store content, deploy Azure Storage in the same region as your Azure Functions app and consider using premium storage for a faster cold start.Monday, July 28, 2025
Design Uplift VIII - Trends and Analytics
Design Objectives:
1. User should be able to see trending content as landing page content. Which also should consider user preferences.
2. User clicks processed using service bus and function app to scale up the processing to more clicks and also prioritizing user actions and if required process them offline. It can enhance scalability of processing User clicks.( likes, delete, comment , share etc)
3. Data bricks to bring near real time analytics and trends.
4. Signal R for real time notification of content.
5. Spam detection done by audit user clicks and then promote content or block content.
6. Azure AI for creating prompts and getting more user interaction to define prefences instead of static list of preferences.
So above addition of technologies can scale up the application to more number of concurrent user, can trigger back ground processing of data if needed and provide real time update to user regarding trending data. , which should help not scaling hardware horizontally incremental way as users/user clicks increase and increase cost of infrastructure. We can look in to more details .
Lot of samples and examples mentioned before are mostly used in my web sites. ( talash.azurewebsites.net or TalashPDFDrive or other) This time I am also planning to create separate repo which can be used by others and also for my web sites. Should be good attempt to create some thing generic and open source. Again Talash will be a platform byitself with quite generic components to process all types of consent and advanced functionality like content promotion and spam detection.
Thursday, July 10, 2025
Design Uplift: VII - Using Design patterns Part 1
Using Design patterns is one of the core element in making any application design robust and scalable.
I will give in this article few examples which are quite generic and useful for most of web development, These are my favorites and this one is quite challenging skill for any architect/developer to bring best design pattern in the application development. But few patterns are not very complex which can be discussed and may be few references I can mention to understand more about it.
One of my favorite pattern is strategy pattern. As shown below just there many features which can be selected based on the Execute strategy inputs. There are many other patterns are very useful in apps like singleton or facade. or factory.. and others. I need to start with some thing. One interesting example when I am learning this design pattern is one of Ecommerce product has a folder. If we move any code in that folder ex show recommendations function to that folder feature will be enabled in that ecommerce site .
As it is open source product I could go though implementation and finally saw the following code implementation but done exceptionally well.
There are many interesting facts about design pattens. In one product the return object / structure from Facade layer is BOject and company name is Business Objects. After couple of days of working with that code i realize that it is best way to implement Facade. So we can go though lot of these implementations one by one.
A strategy pattern is use to perform an operation (or set of operations) in a particular manner. In the classic example, a factory might create different types of Animals: Dog, Cat, Tiger, while a strategy pattern would perform particular actions, for example, Move; using Run, Walk, or Lope strategies.
In fact the two can be used together. For example, you may have a factory that creates your business objects. It may use different strategies based on the persistence medium. If your data is stored locally in XML it would use one strategy. If the data were remote in a different database, it would use another.
same way many operational patterns depends on deletgate
Several design patterns use delegation. The State (338), Strategy (349), and Visitor (366) patterns depend on it. In the State pattern, an object delegates requests to a State object that represents its current state. In the Strategy pattern, an object delegates a specific request to an object that represents a strategy for carrying out the request. An object will only have one state, but it can have many strategies for different requests. The purpose of both patterns
is to change the behavior of an object by changing the objects to which it delegates requests. In Visitor, the operation that gets performed on each element of an object structure is always delegated to the Visitor object.
So some times design can use multiple patterns for depends on use case.
class MealBuilder:
def __init__(self):
self.builder = Builder()
def prepare_veg_meal(self):
self.builder.build_part1("Salad")
self.builder.build_part2("Vegetable Curry")
self.builder.build_part3("Rice")
return self.builder.get_product()
def prepare_non_veg_meal(self):
self.builder.build_part1("Chicken Soup")
self.builder.build_part2("Grilled Chicken")
self.builder.build_part3("Chicken Tikka")
return self.builder.get_product()
Pizza pizza = new Pizza.Builder(12)
.cheese(true)
.pepperoni(true)
.bacon(true)
.build();NET StringBuilder class is a great example of builder pattern. It is mostly used to create a string in a series of steps. The final result you get on doing ToString() is always a string but the creation of that string varies according to what functions in the StringBuilder class were used. To sum up, the basic idea is to build complex objects and hide the implementation details of how it is being built.
Sql Query Builder. API like fluent also uses above pattern to build the fluent API and pass different values to construct .I like the following summrization of creational patterns
L Let us look in to more complex use cases and some of important aspects we need to consider while using these creational patterns.
Cloud reselling options - Design
It is interesting topic when we try to understand this concept from application design point of view. Few technology companies never re i...
-
Ref:https://aws.amazon.com/blogs/mobile/backends-for-frontends-pattern/ Interesting points and differnt approch to design BFF: AWS AppSync ...
-
Can you design Netflix in 45 minutes? What??? Are you serious ?? (I can watch it for the whole night, but…). It’s impossible to explain even...
-
Post Views: 669 Software design and architecture, generally refer to the foundation, structure, and organization of the solution. Whil...