Tuesday, January 31, 2017

Getting Started with Azure CDN

For a better user experience and a faster delivery of content from server to client, both caching and CDN (content delivery network) comes hand in hand. When considering performance it is important to use both of  these techniques for better user experience (See Caching vs CDN - Stackoverflow).

CDN can be used to cache static web content to provide content faster to end users. It caches content in physical nodes across the globe.

Watch this video to understand how to link a storage account with Azure CDN.



Resources
https://azure.microsoft.com/en-us/blog/enabling-cdn-for-azure-websites/
https://docs.microsoft.com/en-us/azure/cdn/cdn-create-new-endpoint

Wednesday, January 25, 2017

Catch these things in EF Core

            var b = _context.Tasks.Include(j => j.TaskItems).Include(j => j.Creator);

TaskItems is an ICollection in Task object, hence it'll execute separately in SQL Server. Since Creator is a 1 to 1 mapping, It'll do a inner join with Task.


            var a = _context.Tasks.Include(j => j.TaskItems).ThenInclude(j => j.Status);

First tasks will be queried. Then in another query, TaskItems will be left joined with Workflow status. To map with Tasks, Where query will be appended with Exists, which will map Tasks and TaskItems


Thursday, January 12, 2017

Microservices what is it really

Image Credit : Contentful

Microservices is a architectural pattern where a structure of an application is decomposed as collection of loosely coupled services. These services are responsible for handling separate business capabilities.

Microservices helps software teams to continuously deliver large scale complex application in pieces. (Should you use microservices)

We all can search and find theories of microservices, but practical use cases and practical issues are what most of us will be interested in espeically when such resources are rare. So I thought of organizing this page to list some concerns involved.

Image Credits : Bhagwati Malav (via. Medium)

Problems with Monolithic Architecture

Traditionally monolithic architecture is used for many software's but it generates bigger problems with time.

  • Involves a single code base which increases code complexity, learning curve, maintainability, dependencies
  • Overloads IDE since there's only single code base
  • Difficult continuous integration since all application is a single one
  • Scaling is linear. Since there is no modularity all modules comes as a single package. Cannot scale different modules separately based on the requirement (Even if module A gets used 99% and B 1% both will be handled via. same infrastructure) 
For smaller teams most of the time monolithic will be the way to go. Consider microservices if you  have previous experience but not because you want to try it. If your application tends to get bigger , much complex or if you encounter a non-functional business requirement such as one part of the application need higher performance consider using microservices. This is because separate services can scale independently. Note that what can be done in monolithic can be done in microservices as well.

Patterns in Microservices

There are patterns which can be used with Microservices.

API Gateway (source)

There could be requirements from front-end to have an API which would access multiple microservices to retrieve data. Solution here is to create a separate API Gateway which would access required microservices and give what you need. 

API Composer is when you need to query multiple services where services uses Database per service pattern. API Gateway often does API composition as well. 


Microservices in Azure - Service Fabric

https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-overview-microservices
https://azure.microsoft.com/en-us/blog/microservices-an-application-revolution-powered-by-the-cloud/
https://docs.microsoft.com/en-us/azure/service-fabric/

Case studies
https://blogs.msdn.microsoft.com/azureservicefabric/tag/case-study/

Authentication in Microservices

https://stackoverflow.com/questions/29644916/microservice-authentication-strategy

Microservices - Case Studies






Sunday, January 1, 2017

ASP.NET Core Request Pipeline

With ASP.NET to ASP.NET Core lot of things has changed. ASP.NET had a request processing pipeline with lots of events such as BeginRequest, EndRequest etc. With Core the architecture was changed.

This is how ASP.NET Core application is initialized



ASP.NET Core now has the concept of Middlewares. You can have many middlewares as you need and each of them will execute one after the other.

Fundamentals of Middleware

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-2.2

You can also write your own custom middleware

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/middleware/write?view=aspnetcore-2.2
Powered by Blogger.


Software Architect at Surge Global/ Certified Scrum Master

Experienced in Product Design, Software Engineering, Team management and Practicing Agile methodologies.

Search This Blog

Facebook