8 SQL database integrations
This chapter covers
- Integrating .NET Aspire with a SQL Server component
- Working with Oracle Aspire integration
- Using PostgreSQL inside a distributed Aspire application
- Using MySQL inside .NET Aspire
.NET Aspire can be integrated with SQL-based relational database management systems (RDBMS) via Aspire integration libraries. At the time of writing, the following relational database types are supported:
- SQL Server (including a bespoke Azure version)
- Oracle
- PostgreSQL
- MySQL
Any enterprise-grade application relies on data; therefore, it has data storage technologies integrated with it. SQL-based relational databases are the most popular category of databases used in these types of applications.
As we shall see in this chapter, .NET Aspire integrations make it significantly easier to add an RDBMS to your application. For example, you no longer have to manage database connection strings yourself. The .NET Aspire service discovery mechanism will do it all for you! In this case,
Moreover, the integration libraries work both with and without the object-relational mapper, like Entity Framework. Therefore, you can use the SQL-based databases in the way that you prefer and are accustomed to.
In this chapter, we will go through all the main SQL integrations available with .NET Aspire. But before we talk about the individual SQL database types, we will talk about the general principles that all the RDBMS integrations follow.