Thursday, 24 August 2023

How to improve applications performance which is hosted in cloud ?

Improving the performance of an application hosted in Microsoft Azure involves a combination of optimizing your application code, leveraging Azure services, and following best practices for cloud-based deployments. Here are some specific steps you can take to enhance the performance of your Azure-hosted application:

Choose the Right Azure Services: Select Azure services that align with your application's needs. For example, Azure App Service, Azure Functions, Azure Kubernetes Service (AKS), and Azure Virtual Machines offer different levels of control and scalability. Choose the appropriate service based on your workload.

Scale Horizontally: Leverage Azure's scaling capabilities to handle increased traffic. Implement auto-scaling for your application to dynamically adjust resources based on demand.

Content Delivery Network (CDN): Use Azure CDN to distribute content globally, reducing latency for users by caching static assets closer to them.

Azure Front Door or Azure Traffic Manager: Utilize services like Azure Front Door or Azure Traffic Manager for load balancing and to route traffic to the nearest and healthiest endpoint, improving availability and response times.

Azure SQL Database Optimization: If you're using Azure SQL Database, optimize query performance by creating appropriate indexes, partitioning tables, and leveraging features like query performance insights.

Azure Redis Cache: Implement Azure Redis Cache to store frequently accessed data in-memory, reducing the need to query the database for every request.

Azure Application Insights: Integrate Application Insights for real-time monitoring, performance tracking, and identifying bottlenecks in your application.

Use Managed Services: Azure offers a range of managed services like Azure Cosmos DB, Azure Search, and Azure Functions that are optimized for performance and scalability.

Geo-Replication: If your application is used across different regions, use Azure's geo-replication features to replicate data and ensure low-latency access for users.

Azure Blob Storage: Store static assets, media files, and other large objects in Azure Blob Storage to offload the web server and improve load times.

Optimize Network Traffic: Use Azure ExpressRoute for dedicated private network connections between Azure and your on-premises infrastructure to minimize latency and improve data transfer rates.

Use Azure Availability Zones: Deploy resources across Azure Availability Zones for high availability and redundancy, reducing the risk of downtime due to infrastructure failures.

Azure Managed Kubernetes (AKS): If using AKS, optimize your containerized applications by configuring appropriate resource limits, managing pod scaling, and monitoring performance.

Compress Data: Enable data compression for web resources to reduce transfer times and improve page load speed.

Azure Functions Cold Starts: If using Azure Functions, implement strategies to minimize cold starts by using warm-up requests or utilizing Premium Plan features.

Azure Virtual Network: Use Azure Virtual Network to isolate your application from other resources and optimize network traffic.

Regular Performance Testing: Conduct regular performance testing and load testing to identify performance bottlenecks and validate your optimizations.

Azure Cost Management: Optimize resource utilization to avoid overprovisioning and control costs while maintaining performance.

Remember that performance optimization is an ongoing process. Continuously monitor your application's performance using Azure monitoring tools and make adjustments as needed. Each application is unique, so tailor these recommendations to your specific requirements and architecture.

Wednesday, 23 August 2023

How to improve web applications performance?

Improving application performance is a critical aspect of software development, ensuring that your application runs smoothly, responds quickly, and provides a positive user experience. Here are several strategies and best practices you can consider to enhance your application's performance:

Identify Bottlenecks: Begin by profiling your application to identify performance bottlenecks. Use profiling tools to pinpoint areas of your code that consume the most time and resources.

Optimize Algorithms and Data Structures: Choose efficient algorithms and data structures for your application's operations. Using the right algorithms can significantly improve execution speed.

Caching: Implement caching mechanisms to store frequently used data in memory. This reduces the need to fetch data from slower data sources, such as databases.

Database Optimization: Optimize database queries by ensuring they are properly indexed, avoiding unnecessary joins, and using query optimization techniques provided by your database management system.

Minimize Network Latency:Reduce the number of network requests and minimize data transferred between the client and server. Use techniques like data compression and HTTP/2 to optimize network performance.

Code Profiling and Analysis: Regularly profile your code to identify performance bottlenecks, memory leaks, and other issues. Tools like profilers and performance analysis tools can help you diagnose problems.

Parallelism and Concurrency: Utilize parallel processing and concurrency to take advantage of multi-core processors. This can improve execution speed for tasks that can be performed simultaneously.

Asynchronous Programming: Employ asynchronous programming techniques, especially for I/O-bound tasks. This prevents blocking and allows your application to continue processing other tasks while waiting for I/O operations to complete.

Resource Management: Properly manage resources like memory, file handles, and database connections. Release resources when they are no longer needed to prevent resource leaks.

Optimize UI Rendering: For graphical applications, optimize UI rendering by reducing unnecessary redraws and leveraging techniques like virtualization and lazy loading.

Reduce External Dependencies: Minimize external dependencies that might introduce performance overhead. Be cautious with third-party libraries and services that could slow down your application.

Load Testing: Conduct load testing to simulate heavy user traffic and identify how your application performs under stress. This can help you uncover performance issues that might only occur in high-demand scenarios.

Content Delivery Networks (CDNs): Use CDNs to serve static assets like images, CSS, and JavaScript files. CDNs distribute content across multiple servers to improve load times for users.

Continuous Monitoring: Implement monitoring tools to continuously monitor the performance of your application in real-time. This allows you to identify and address performance issues promptly.

Regular Code Reviews: Encourage regular code reviews to ensure that performance considerations are part of the development process. Peer review can help catch potential performance issues early.

Optimize Front-End Performance: Minimize the use of large images, optimize CSS and JavaScript files, and reduce the number of HTTP requests to improve page load times.

Remember that performance optimization is an ongoing process. Regularly monitor your application's performance, gather user feedback, and be prepared to make optimizations as your application evolves. Prioritize the most impactful changes based on the specific performance challenges your application faces

What is your role in the ongoing project as an Engineering Manager?

In the ongoing project, my role as the Engineering Manager involves overseeing and coordinating various aspects of the project's technical development. I work closely with the project team, including developers, designers, and other stakeholders, to ensure that the project progresses smoothly and efficiently.

My responsibilities include:

Team Management: I lead and manage the engineering team of 42 engineers including tech lead, tech architect and solution architect, ensuring that each member understands their responsibilities and is working cohesively toward project goals. I provide guidance, support, and mentorship to help the team succeed.

Project Planning: I collaborate with other departments to define project goals, scope, and milestones. I work to create a clear project plan that outlines tasks, deadlines, and resource allocation.

Technical Guidance: I provide technical expertise and guidance to the team when they encounter challenges or need assistance. I help make decisions about architecture, technology choices, and implementation strategies.

Communication: I facilitate effective communication within the team and with stakeholders. Regular status updates, meetings, and reports keep everyone informed about the project's progress and any potential issues.

Problem Solving: I'm involved in troubleshooting and resolving technical issues that may arise during the project. I encourage creative problem-solving and collaborate with the team to find solutions.

Risk Management: I identify potential risks to the project's success and develop mitigation strategies. This involves anticipating challenges and taking proactive steps to address them.

Quality Assurance: I ensure that the team follows best practices for code quality, testing, and documentation. This contributes to the overall reliability and maintainability of the project.

Performance Evaluation: I conduct performance reviews and provide feedback to team members, helping them identify their strengths and areas for improvement.

Adaptation: Projects can change direction due to various factors. I help the team adapt to changes, whether they're related to requirements, timelines, or priorities.

Stakeholder Management: I liaise with project stakeholders, including upper management and non-technical teams, to keep them informed about progress and to address any concerns.

What is latency and throughput in performance testing?

 Latency and throughput are two important metrics used to assess the performance of software applications or systems. They provide insights into how well an application functions under different loads and conditions.

Latency: It refers to the time it takes for a request to travel from the source to the destination and receive a response. In the context of software or application performance testing, latency measures the delay or time lag between sending a request and receiving a response. It is typically measured in milliseconds (ms) or microseconds (µs). Low latency is desirable because it indicates that the application can quickly respond to user requests.

There are different types of latency, including:

Network Latency: The time taken for data to travel across a network from the sender to the receiver.

Server Latency: The time taken for a server to process a request and generate a response.

Database Latency: The time taken for a database to process a query and return the results.


Throughput: It is also known as "bandwidth" or "capacity," measures the rate at which a system can process and handle a certain number of requests or transactions over a given period of time. It is usually measured in requests per second (RPS) or transactions per second (TPS). High throughput indicates that the system can handle a large number of requests efficiently.

Throughput can be affected by factors such as network bandwidth, server processing power, and the efficiency of the software architecture.

In software or application performance testing:

Latency Testing: This involves measuring the time it takes for individual requests to complete and analyzing the distribution of response times. It helps identify bottlenecks and areas where improvements are needed to reduce delays.

Throughput Testing: This involves stressing the system with a predefined load and measuring how many requests or transactions the system can handle per unit of time. It helps determine the system's capacity and its ability to scale under various loads.

Both latency and throughput are crucial metrics for assessing the user experience and overall health of an application. In some cases, a trade-off might be necessary between low latency and high throughput, as optimizing for one metric could affect the other. Performance testing helps ensure that an application meets the performance expectations of its users and provides insights into areas that may need optimization.

Thursday, 16 February 2023

What is Project Traceability?

 Project traceability is the ability to trace and link requirements, design, development, testing, and deployment artifacts across the software development lifecycle. Traceability ensures that each requirement is met by a corresponding design element, implementation code, test case, and deployment artifact.

The primary goal of project traceability is to establish a clear relationship between various stages of the software development lifecycle and to enable stakeholders to trace back any change or issue in the software product to its origin. Traceability ensures that all requirements are met, and any changes in the requirements are appropriately tracked and managed.

Project traceability is often achieved through a traceability matrix, which is a table that links each requirement to its corresponding design element, implementation code, test case, and deployment artifact. The traceability matrix allows stakeholders to trace the progress of a requirement through each stage of the software development lifecycle and to ensure that all requirements are met.

Traceability is crucial in highly regulated industries, such as healthcare and aerospace, where software products must meet strict regulatory requirements. However, project traceability is also important in any software development project to ensure that the product meets the customer's needs and requirements and to enable effective tracking and management of changes throughout the development process.




High level vs low level design ?

High-level design and low-level design are two stages in the software design process that are used to define the architecture and functionality of a software system.

High-level design refers to the early stages of the design process where the overall architecture and requirements of the software system are defined. This includes defining the system's modules, interfaces, and data structures, as well as its overall functionality and user interface. High-level design provides an abstract view of the system and focuses on the system's major components and their interactions.

On the other hand, low-level design involves the detailed design of individual modules or components within the software system. This includes defining the algorithms, data structures, and programming language constructs to be used in each component. Low-level design focuses on the specific implementation details of the system and provides a more detailed view of how the system will function.

In summary, high-level design focuses on the overall architecture and functionality of the system, while low-level design focuses on the specific details of individual components within the system. Both are important stages in the software design process and contribute to the development of a high-quality, efficient software system.




Tuesday, 7 February 2023

What happens when you type a URL into your browser?

URL stands for Uniform Resource Locator. URL is the address of the website which you can find in the address bar of your web browser.

Example : https://www.debuggersspace.com/ 

DNS : DNS is short for Domain Name System. Like a phonebook, DNS maintains and maps the name of the website, i.e. URL, and particular IP address it links to. Every URL on the internet has a unique IP address which is of the computer which hosts the server of the website requested.

CNAME recordA Canonical Name record is a type of resource record in the Domain Name System that maps one domain name to another. This can prove convenient when running multiple services from a single IP address.

Steps for what happens when we enter a URL :

  1. Browser checks cache for DNS entry to find the corresponding IP address of website.
    It looks for following cache. If not found in one, then continues checking to the next until found.
    • Browser Cache
    • Operating Systems Cache
    • Router Cache
    • ISP Cache
  2. If not found in cache, ISP’s (Internet Service Provider) DNS server initiates a DNS query to find IP address of server that hosts the domain name.
    The requests are sent using small data packets that contain information content of request and IP address it is destined for.
  3. Browser initiates a TCP (Transfer Control Protocol) connection with the server 
  4. Browser sends an HTTP request to the web server. GET or POST request.
  5. Server on the host computer handles that request and sends back a response. It assembles a response in some format like JSON, XML and HTML.
  6. Server sends out an HTTP response along with the status of response.
  7. Browser displays HTML content
  8. Finally, Done.

Tuesday, 10 January 2023

What is cloud computing?

Cloud computing is the delivery of computing services—including servers, storage, databases, networking, software, analytics, and intelligence—over the Internet (“the cloud”) to offer faster innovation, flexible resources, and economies of scale.

here are several examples of cloud computing applications -

1. Cloud service would be streaming platforms for audio or video, where the actual media files are stored remotely.

2. Data storage platforms like Google Drive, Dropbox, OneDrive

Saturday, 7 August 2021

Can an abstract class have a constructor ?

Yes, an abstract class can have a constructor. 

In general, a class constructor is used to initialize fields. Along the same lines, an abstract class constructor is used to initialize fields of the abstract class.

An abstract class constructor can also be used to execute code that is relevant for every child class. This prevents duplicate code.


You can not create an instance of an abstract class, so what is the use of a constructor in an abstract class?

You can not create an instance of the abstract class, we can create instances of the classes that are derived from the abstract class.

So, when an instance of the derived class is created, the parent abstract class constructor is automatically called.

Note: Abstract class cant be directly instantiated, The abstract class constructors get executed thru a derived class. So, it is a good practice to use a protected modifier with an abstract class constructor,using public doesn't make sense.



Thursday, 5 August 2021

.NET Framework vs .Net Core 3.1

 

Sr. No. Comparison .Net Framework .Net Core 3.1
1 Cross Platforms .Net framework runs only on windows .Net core is cross-platform, it operates on Windows, Linux, and Mac operating systems
2PerformanceSlow Better
3 Application supported the .NET framework is for developing desktop applications, web applications, and web services, WPF, ASP.NET MVC MVC core 3.x
4 WCF/ WPF/WWFYes No
5 Desktop Based WPF, Winforms. Nothing for desktop
6 Packaging Packaged as big framework Delivered via modularity using Nuget
7 Microservice Support NoYes
8 CLI ToolsMore IDE Based Full CLI command supported
9 Mobile Compatibility  No direct support with .Net standard compatible with Xamarin
9 Cloud  Runs only on windows Yes

Wednesday, 4 August 2021

What is the differnece between Abstract class & Interface?

In an abstract class, we can create the functionality and that needs to be implemented by the derived class. The interface allows us to define the functionality or functions but cannot implement that. The derived class extends the interface and implements those functions.

Abstract ClassInterface
Abstract classes are inherited.Interfaces are Implemented.
It is a half-defined parent class.It is a contract.
Share some common logic in child classesPlanning Abstraction.
It contains both declaration and definition parts.It contains only a declaration part.
It contains both declaration and definition parts.It contains only a declaration part.
Multiple inheritance is not achieved by abstract class.Multiple inheritance is achieved by interface.
It contain constructor.It does not contain constructor.
It can contain static members.It does not contain static members.
It can contain different types of access modifiers like public, private, protected etc.It only contains public access modifier because everything in the interface is public.
The performance of an abstract class is fast.The performance of interface is slow because it requires time to search actual method in the corresponding class.
It is used to implement the core identity of class.It is used to implement peripheral abilities of class.
A class can only use one abstract class.A class can use multiple interface.
If many implementations are of the same kind and use common behavior, then it is superior to use abstract class.If many implementations only share methods, then it is superior to use Interface.
Abstract class can contain methods, fields, constants, etc.Interface can only contain methods .
It can be fully, partially or not implemented.
It should be fully implemented.
Sr. No.KeyAbstract ClassInterface
1DefinitionIn terms of standard definition, an Abstract class is, conceptually, a class that cannot be instantiated and is usually implemented as a class that has one or more pure virtual (abstract) functions.On other hand an Interface is a description of what member functions must a class, which inherits this interface, implement. In other words, an interface describes behaviour of the class.
2ImplementationAs like of other general class design in C# Abstract class also have its own implementation along with its declaration.On other hand an Interface can only have a signature, not the implementation. While its implementation is being provided by the class which implements it.
3InheritanceAs per specification in C# a class can extends only one other class hence multiple inheritance is not achieved by abstract class.On other hand in case of Interface a class can implements multiple interfaces and hence multiple inheritance is achieved by interface.
4ConstructorLike other classes in C# for instantiation abstract class also have constructor which provide an instance of abstract class to access its non-static methods.On other hand Interface do not have constructor so we can't instantiate an interface directly although its method could get accessed by creating instance of class which implementing it.
5ModifiersAs abstract class is most like of other ordinary class in C# so it can contain different types of access modifiers like public, private, protected etc.On other hand as Interface needs to be get implemented in order to provide its methods implementation by other class so can only contains public access modifier.
6PerformanceAs abstract class have its method as well as their implementations also for its abstract methods implementation it have reference for its implementing class so performance is comparatively faster as compare to that of Interface.On other hand the performance of interface is slow because it requires time to search actual method in the corresponding class.
Watch video to clear the concept-

What is AJAX?

 Asynchronous JavaScript and XML (AJAX) is a development technique used to create interactive web applications or rich internet applications. AJAX uses a number of existing technologies together, including: XHTML, CSS, JavaScript, Document Object Model, XML, XSLT, and the XMLHttpRequest object.


With AJAX, web applications can retrieve data from the server asynchronously, in the background, without reloading the entire browser page. The use of AJAX has led to an increase in interactive animation on web pages.

Advantages
  • Reduces the traffic travels between the client and the server. 
  • No cross browser pain.
  • Better interactivity and responsiveness.
  • With AJAX, several multi purpose applications and features can be handled using a single web page(SPA).
  • API's are good because those work with HTTP method and JavaScrtipt.
Disadvantages
  • Search engines like Google would not be able to index an AJAX application. 
  • It is totally built-in JavaScript code. If any user disables JS in the browser, it won't work.
  • The server information can not be accessed within AJAX.
  • Security is less in AJAX applications as all the files are downloaded at client side.
  • The data of all requests is URL-encoded, which increases the size of the request.

For more details- 

Wednesday, 15 July 2020

Basics of .Net Framework

.Net Framework
  • The .Net framework is a software development platform developed by Microsoft.
  • The .Net framework was meant to create application, which would run on the windows platform.
  • The first version of the .net framework was released in the year 2002.

C# Version History  

 C# Framework  Visual studio     Features                                                                               
 1.0 1.0/1.1               2002    
  1. First Release of C#
 2.0 2.0 2005
  1. Generics
  2. Partial Types
  3. Anonymous method
  4. Null-able types
  5. Iterators
  6. Covariance & Contra-variance 
 3.0 3.0/3.5 2008
  1.  Auto Implemented properties
  2. Anonymous types
  3. Query Expression
  4. Expressions tree
  5. Lambda expression
  6. Extension method  
 4.0 4.0 2010
  1. Dynamic binding
  2. Named/Optional Argument
  3. Generic Covariant & Contra-variant
  4. Embedded Inter-op types 
 5.0 4.5 2012/1013
  1. Asynchronous 
  2. Caller info attributes 
 6.0 4.6 2013/2015
  1. Static imports 
  2. Exceptions filters
  3. Property initializes
  4. Expression bodied members
  5. Null propagator
  6. String Interpolation
  7. Name of operator
  8. Dictionary initializer 
 7.0 .Net Core 2017
  1. Improved performance & productivity
  2. Azure support
  3. AI Support
  4. Game development
  5. Cross platform 
  6. Mobile app development 
  7. Window app development 


Application Execution



The application execution consist 2 steps:
  • Compilation - Source code to IL.
  • JIT Compilation - IL to native code.
Common language runtime (CLR) -
  • The heart of .Net frame work is a runtime environment called the CLR. 
  • The CLR manages the life cycle and executed .net application. 
  • It converts a MSIL code into the native code, 
  • It is the execution engine for .net framework application. 
  • It is a virtual machine components that manages the execution.
  • Programmers write code in any languages VB.Net, C#, J# then they compile their programs into in intermediate language in a portable execution file (PE), that can be managed & then CLR converts it into native/machine code.
Component of .Net CLR
  1. Class Loader- used to load all classes.
  2. JIT 
  3. Garbage collector - It manages the menory, collect all unused object and deallocate them to reduce memory.
  4. Exception Handler- It handels exception at runtime.
  5. Thread support - It supports multi threading at our application
  6. Interoperability - Suppose if you had an application built in an older version, say 2.0 and if you tried to run the same application on a machine which had the higher version of the .net framework, say 4.5, the application would still work. this is because with every release, microsoft ensure that older framework version get with the latest version.
  7. Portability- Application built on .net can be made to work on any windows platform. 
Benefits of .Net CLR
  1. Performance improvments
  2. The ability to use components developed in other languages.
  3. Support for structured exceptions handling.
  4. SUpports for custom attributes.
  5. Garbage collection.
  6. Support for explicit free threading that allows creation of multithreading application.

Tuesday, 23 June 2020

Design Patterns in .NET

There are three types of  Design Pattern : 

1. Creational - This type deals with the object creation and initialization. 
2. Structural  - This type deals with the class & object composition.
3. Behavioral - This type deals with the communication between class & object.

The four authors Erich Gamma, Richard Helm, Ralph Johnson and John Vlissides are collectively introduced Gang of Four Design Patterns in Software development. In 1994, they published a book (Design Patterns: Elements of Reusable Object-Oriented Software) for explaining the concept of Design Patterns.

The 23 Design patterns are defined by the Gang of Four programmers, These 23 patterns are divided into three groups:

Creational Design Patterns: 
  1. Factory Method : Create instances of derived classes
  2. Abstract Factory : Create instances of several classes belonging to different families
  3. Builder : Separates an object construction from its representation
  4. Prototype : Create a duplicate object or clone of the object
  5. Singleton : Ensures that a class can has only one instance



Structural Design Patterns:
  1. Adapter : Match interfaces of different classes
  2. Bridge : Separates an object’s abstraction from its implementation
  3. Composite : A tree structure of simple and composite objects
  4. Decorator : Add responsibilities to objects dynamically
  5. Façade : A single class that represents an entire complex system
  6. Flyweight : Minimize memory usage by sharing as much data as possible with similar objects
  7. Proxy : Provides a surrogate object, which references to other object


Bhavioural Design Patterns:
  1. Chain of Responsibility: Passes a request among a list or chain of objects.
  2. Command: Wraps a request under an object as a command and passed to invoker object.
  3. Interpreter: Implements an expression interface to interpret a particular context.
  4. Iterator: Provides a way to access the elements of a collection object in sequential manner without knowing its underlying structure.
  5. Mediator: Allows multiple objects to communicate with each other’s without knowing each other’s structure.
  6. Memento: Capture the current state of an object and store it in such a manner that it can be restored at a later time without breaking the rules of encapsulation.
  7. Observer: Allows an object (subject) to publish changes to its state and other objects (observer) that depend upon that object are automatically notified of any changes to the subject's state.
  8. State: Alters the behavior of an object when it’s internal state changes.
  9. Strategy: Allows a client to choose an algorithm from a family of algorithms at run-time and gives it a simple way to access it.
  10. Visitor: Creates and performs new operations onto a set of objects without changing the object structure or classes.
  11. Template Method: Defines the basic steps of an algorithm and allow the implementation of the individual steps to be changed.

Source- 
https://www.dotnettricks.com/learn/designpatterns/gang-of-four-gof-design-patterns-in-net

Youtube -Kudvenkat Sir

https://www.youtube.com/playlist?list=PL6n9fhu94yhUbctIoxoVTrklN3LMwTCmd






How to improve applications performance which is hosted in cloud ?

Improving the performance of an application hosted in Microsoft Azure involves a combination of optimizing your application code, leveraging...