fullstackhero / dotnet-starter-kit

Production Grade Cloud-Ready .NET 8 Starter Kit (Web API + Blazor Client) with Multitenancy Support, and Clean/Modular Architecture that saves roughly 200+ Development Hours! All Batteries Included.
https://fullstackhero.net/dotnet-webapi-boilerplate/
MIT License
5.19k stars 1.56k forks source link

Hangfire Dedicated Database #295

Closed Maedhr0s closed 2 years ago

Maedhr0s commented 2 years ago

If you specify different databases in hangfire.json and database.json configuration files, Hangfire tables will not be created. Hangfire expect the database is existing.

Is it possible for FSH to have a dedicated database for hangfire? And possible different DB Provider as well? Say for example, Main Database in SQL Server and Hangfire database is in Postgres?

Not sure if this is a bug or new request.

Thanks.

frankyjquintero commented 2 years ago

The database must exist previously, in any project it is not recommended that the user with whom it executes the solution has such power, my recommendation is to always create users with the minimum required permissions (it should always be managed with a dba). as for the separation it is possible you can have hangfire in any different storage

frankyjquintero commented 2 years ago

https://github.com/fullstackhero/dotnet-webapi-boilerplate/blob/51c591c9383a291ae84e9d1b9e791c563113b40a/src/Infrastructure/HangFire/Startup.cs#L43

At the moment these are the supported ones, it would also be considered as a future storage option (Redis) and a more adjusted one (entityframework)

Redis(performance) https://github.com/frankyjquintero/Hangfire.Redis.StackExchange https://www.nuget.org/packages/Hangfire.Redis.StackExchange2/1.8.6 https://www.nuget.org/packages/Hangfire.Redis.StackExchange2/1.9.0-beta1

EntityFrameworkCore https://www.nuget.org/packages/Hangfire.EntityFrameworkCore/ https://github.com/sergezhigunov/Hangfire.EntityFrameworkCore