In-memory

Use the JobRunr InMemoryStorageProvider for testing and lightweight, instance-local tasks.

On this page

JobRunr ships with an InMemoryStorageProvider that keeps all jobs in process memory. It is ideal for tests and for lightweight, server-instance-specific tasks where persistence does not matter.

Warning

The InMemoryStorageProvider is not persistent: jobs do not survive a restart. Because the storage is not shared, you cannot scale horizontally - run only a single instance. For most production workload, you want to use a persistent SQL or NoSQL database.

Configuration

No dependency is required - the InMemoryStorageProvider is part of JobRunr core.

JobRunr.configure()
    .useStorageProvider(new InMemoryStorageProvider())
    .useBackgroundJobServer()
    .initialize();

Next steps

Looking for another database? Back to the Storage overview.