Data Access Layer: Dapper vs EF Core – What Drove the Choice? #389
Replies: 1 comment
-
Simple - dragging EF together with this provider makes little sense, especially since quite many applications don't even use EF at all. Dapper has very little overhead compared to full EF assembly. Not to mention the fact that technically this library can be used in .NET Framework as well (albeit have to build manually), where EF Core does not work. Versioning would be painful as well. Regarding async, it's not supported by Hangfire. The owner of Hangfire said it's coming in v2 (next year from 2015), but we all see how that went. Sadly, it's still not in sight in 2025, which is understandable considering what Hangfire does under the hood, it's not that easy. We certainly don't have any reason to support EF (Core or not) here. Since async improvements are not really possible either, there's nothing to contribute, but thanks for offering! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
👋 Question: Why Dapper over EF Core in this provider?
Hey team — first off, thanks for maintaining this provider! It’s been a reliable piece in our stack. 🙌
I noticed that the codebase (e.g.,
PostgreSqlMonitoringApi.cs
) uses Dapper for data access. I'm curious — is there a specific reason for preferring Dapper over Entity Framework Core?From what I can tell, EF Core could offer:
Whereas Dapper offers:
Are there limitations or design concerns that ruled out EF Core for this provider?
💡 Follow-up: Why are all DB operations blocking?
While exploring the code, I also noticed that all DB access is blocking/synchronous. Given that Hangfire can run in high-throughput environments, wouldn’t async I/O help avoid thread pool starvation, especially under load?
Is the synchronous approach a limitation of Hangfire’s internals, or simply a design choice carried over from the core ADO.NET-based storage model?
🛠 Willing to Contribute
If there’s interest or openness from the maintainers to explore EF Core support, or even consider async improvements for database operations, I’d be happy to help contribute to that effort.
Thanks again for your work on this provider!
Beta Was this translation helpful? Give feedback.
All reactions