chapter three

3 Using database and storage components

 

This chapter covers

  • Connecting Aspire to an existing database instance using connection strings
  • Integrating SQL Server and consuming data with both raw SQL and Entity Framework.
  • Working with other relational databases, including Oracle, PostgreSQL, and MySQL
  • Using NoSQL databases such as MongoDB and Azure Cosmos DB
  • Connecting to Azure Storage services such as Table Storage and Blob Storage

Aspire can be integrated with many database types, including SQL-based relational database management systems (RDBMS) and various categories of NoSQL databases, such as document stores and key-value stores. All this can be done via Aspire integration libraries.

This chapter covers both database categories, with examples showing a range of specific data storage technologies in SQL and NoSQL areas. Before we start, however, let’s talk about connecting Aspire to an existing database instance. We'll do so by continuing to build our e-commerce app. Our app needs data, such as the products we sell, the orders customers place, and so on. This is what databases are for.

3.1 Connecting Aspire to an existing database

Before we look at how to build database resources and let the Aspire host manage them, let's look at how to connect Aspire instances to existing resources. After all, we may already have a fully managed instance of a SQL Server, Oracle, or MongoDB database that we want to connect our system to.

3.2 SQL database components basics

3.2.1 Working with the SQL data model

3.2.2 Displaying the DTO information in the UI

3.3 Hosting an SQL Server component

3.3.1 Consuming an SQL Server integration

3.3.2 Using Entity Framework

3.3.3 Integrating with Azure SQL Server

3.4 Hosting an Oracle component

3.4.1 Oracle client integration

3.5 Hosting a PostgreSQL component

3.5.1 PostgreSQL client integrations

3.6 Introduction to NoSQL

3.6.1 Introduction to MongoDB

3.6.2 Hosting a MongoDB component

3.6.3 Working with a MongoDB client

3.6.4 Other NoSQL components

3.6.5 Hosting a Cosmos DB component

3.6.6 Connecting to Cosmos DB

3.7 Azure Storage integration

3.7.1 Hosting Azure Storage components

3.7.2 Interacting with Azure Table Storage

3.7.3 Integrating with Azure Blob Storage

3.8 Summary