Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support/Guidance for .NET Aspire Integration #41

Open
Matthewsre opened this issue Jan 30, 2025 · 2 comments
Open

Support/Guidance for .NET Aspire Integration #41

Matthewsre opened this issue Jan 30, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@Matthewsre
Copy link

Purpose of the feature.
I'd like to be able to integrate DocumentDB (PostgreSQL extension) into ASP.NET projects more easily using .NET Aspire. The goal is to enable .NET developers to easily try DocumentDB or replace/augment their existing MongoDB/PostgreSQL usage with DocumentDB in a smooth, "drop-in" manner.

Describe the solution you'd like
An official or documented approach that shows how to configure and use DocumentDB alongside PostgreSQL in .NET Aspire. Ideally, this would look similar to existing Aspire integrations for PostgreSQL and MongoDB, including any recommended connection string formats, sample configuration files, or code examples.

Describe alternatives you've considered

  • Manually configuring Docker containers and connection strings without official guidance.
  • Continuing to run separate MongoDB instances instead of consolidating data storage under PostgreSQL + DocumentDB.
  • Using a FerretDB configuration outside the context of .NET Aspire.

Additional context

  • Having explicit Aspire documentation or integration support would make it easier for .NET developers to adopt this new extension.
  • My current ASP.NET solution uses both PostgreSQL and MongoDB (previously migrated from CosmosDB).
  • DocumentDB promises a PostgreSQL extension approach that could simplify my infrastructure and allow me to drop MongoDB.
  • A typical scenario might involve spinning up a Docker container for PostgreSQL + DocumentDB, then referencing it in the .NET Aspire configuration, much as we do with existing providers.
  • Aspire GitHub repo: https://github.com/dotnet/aspire
  • Feature request opened for DocumentDB integration on the Aspire repo: Add DocumentDB support in .NET Aspire dotnet/aspire#7320
  • Feature request opened for FerretDB integration on the Aspire repo: Add FerretDB support in .NET Aspire dotnet/aspire#7322
@Matthewsre Matthewsre added the enhancement New feature or request label Jan 30, 2025
@safern
Copy link
Member

safern commented Jan 30, 2025

@Matthewsre thanks for your request. Sounds something interesting. I see 2 scenarios here:

  1. Aspire + PostgreSQL with DocumentDB extension

For this one I think either providing a docker container that contains both would work or even using the PostgreSQL Hosting plugin in the Aspire service and then adding a .withCommand to run a command at startup that downloads a tar with the documentDB extension, installs it and then runs:
CREATE EXTENSION documentdb CASCADE; on the PostgreSQL database.

  1. Aspire + MongoDriver + FerretDB + DocumentDB

For this one I think we would need a FerretDB Hosting and Client plugins to do the right hosting and setup on the client side for the mongo driver to connect to FerretDB. Seems like more work would be needed and probably would need to be orchestrated on the FerretDB side.

Let us discuss this and see what we can plan/do.

@Matthewsre
Copy link
Author

Matthewsre commented Jan 30, 2025

@safern ,

For the first scenario (Aspire + PostgreSQL with DocumentDB extension):
Both proposals seem important and valid, but for my use case I already have a PostgreSQL configured with Aspire, so I would be in favor of extending that instead of a separate docker container.
(The feature request on the Aspire repo for DocumentDB integration was added to the Backlog)

For the second scenario (Aspire + MongoDriver + FerretDB + DocumentDB):
Depending on how this is implemented, I could see this having a dependency on the first scenario.
The feature request I opened on the Aspire repo for FerretDB has been closed (dotnet/aspire#7322) and I have opened a new issue on the Aspire Community Toolkit: CommunityToolkit/Aspire#432.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants