3 Using Database and Storage Components
This chapter covers
- Connecting Aspire to an existing database instance using connection strings.
- Integrating SQL Server and consuming it 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 like Table Storage and Blob Storage.
Aspire can be integrated with any database types, including both SQL-based relational database management systems (RDBMS) and various categories of NoSQL databases, such as document stores, key-value stores, etc. All of this can be done via Aspire integration libraries.
In this chapter, we will cover both database categories with examples showing a range of specific data storage technologies in both SQL and NoSQL areas. However, before we start, let’s talk about connecting Aspire to an existing database instance.
We will do so by continuing to build our e-commerce app. Our app needs some data, such as products we sell, orders the customers made, 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, we will look at how to connect Aspire instances to the existing resources. After all, you may already have a fully managed instance of a SQL Server, Oracle, or MongoDB database that you want to connect your system to.