Understanding service lifetimes

Let’s take a look at the following points to better understand service lifetimes:

  • Transient, great for lightweight, stateless services are created each time they are requested
  • Scoped, created once per request.
  • Singleton, created the first time they are requested or when ConfigureService is run. Every call subsequent call leverages the same instance.

As we discussed and looked at earlier in the chapter, selecting of your data source is a decision to be based on what you are looking to get out of it. Let’s take another look below. This is how I recommend which system to use, based on functional needs:

Azure SQL becomes your default relational data system for Azure, because it is fully managed and offers you automatic tuning and monitors. You can also leverage other systems, such as MySQL, PostgreSQL, and MariaDB as manager service,s if you are more familiar with those. In an Azure schemaless database, such as CosmosDB, have been operationalize and can be leveraged in solutions. I always challenge developers to think more deeply and understand better where they can take their development processes.

I feel it is also good to mention that, in Azure, you should make sure not to leverage traditional storage mechanisms for files, images, and so on. Often, these are things we store in file systems that may be served better in one of the Azure systems shown here:

For me, I usually store images and B2C templates in Blob storage; for instance, in my Azure projects. When I need a messaging structure, I use Queues or Services Bus. If is important to understand the FTP services in Azure have been more to more secure files management system and protocol to get these files in Azure and share them.

At the end of the day, you need to pick the right repository for your needs, try not to follow the cool thing with understanding, as this is the biggest danger in Azure. I can't tell you how many time I have heard that it didn’t do this when we tested it, or it worked on my machine, when the known issues or things you needed to consider were skipped.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.237.131