📜 ⬆️ ⬇️

nopCommerce CMS on ASP.NET MVC: review of the functionality of the new version

nopCommerce is an open source online shopping engine written in ASP.NET MVC. The project is being developed by our compatriots from the city of Yaroslavl, and today more than 20,000 sites operate on its basis, including such brands as Volvo, Turkish Airlines, Reebok.


A few days ago, a new version of the product 3.70 was released, in which developers added full support for Windows Azure. In previous versions, store owners could use only one instance in Azure, but now support has been added for several. Therefore, in fact, this functionality can be used on web farms. This opens up excellent opportunities for scaling the application.

Suppose that you have already downloaded ( http://www.nopcommerce.com/downloads.aspx ) and installed ( http://docs.nopcommerce.com/display/nc/Installing+nopCommerce ) nopCommerce in Azure. So, what was done to support Azure, and how to set it up and enable it:

Blob storage


Now you can configure the storage of resources (for example, images of products and categories) as blobs, and not just store on the file system, as is done by default. You can read more about the storage service in Azure here ( https://azure.microsoft.com/ru-ru/documentation/articles/storage-introduction/ ).
')
How to configure in nopCommerce:


Caching and distributed sessions


Of course, in any distributed application we need to have support for distributed caching and sessions. Otherwise, different instances of the application will use different data. We chose Redis ( http://redis.io/ ) to implement this functionality, since Azure and many other cloud services already support it.

How to configure in nopCommerce:


<sessionState mode="Custom" customProvider="MySessionStateStore"> <providers> <add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="localhost" accessKey="" ssl="true" /> </providers> </sessionState> 

Schedule tasks


And the last step. nopCommerce uses background tasks for various actions that should be performed automatically. For example, sending mail or updating currency rates. Of course, when we have several instances (instances) of an application, such tasks should be performed only on one of them. Otherwise, a situation may occur when the same letter comes to the buyer twice (from each of the application copies).

nopCommerce

All also open the web.config file. Find the XML element “WebFarms” and set its attribute “MultipleInstancesEnabled” to “True”. For a web farm this will be enough, but in Windows Azure you will also need to set the attribute "RunOnAzureWebsites" to "True"

That's all. Now nopCommerce is ready to fully work in Azure on multiple instances. You no longer have to think about whether there is enough server capacity to serve a large number of customers.

Source: https://habr.com/ru/post/276641/


All Articles