I have an ASP.NET 4.6 web API. The app does not have a standalone DB, and it is a micro-service designed for searching files. I want to implement a CRON job in the background and utilize HangFire. The problem is, seems like storage is mandatory, and Memory Storage is not reccomended for production.
What options do I have?
There isn't any solution to use in production environment but a nuget package exists that help you to use HangFire, it can be useful for testing purpose like check the behavior and use it in a development environment.
Source: Hangfire.MemoryStorage
nuget package : Hangfire.MemoryStorage
GlobalConfiguration.Configuration.UseMemoryStorage();
Above package can't cover in-memory jobs in production environment, but below library provided conditions that can be used in production mode:
Hangfire.InMemory
This is an attempt to create an efficient transactional in-memory storage for Hangfire with data structures close to their optimal representation. The result of this attempt should enable production-ready usage of this storage implementation and handle particular properties of in-memory processing like avoiding OutOfMemoryException at any cost and moderate load on garbage collection. Of course we can't avoid them entirely, but at least can control them somehow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With