PHPackages                             mohit-yogi/async-db-helper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mohit-yogi/async-db-helper

ActiveLibrary

mohit-yogi/async-db-helper
==========================

Save the model data to redis &amp; then move them to DB later

v1.0.0(4y ago)04MITPHP

Since Mar 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mohitYogi/async-db-helper)[ Packagist](https://packagist.org/packages/mohit-yogi/async-db-helper)[ RSS](/packages/mohit-yogi-async-db-helper/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Async DB Helper
===============

[](#async-db-helper)

Introduction
------------

[](#introduction)

Sometimes it happens that we use either logger or some special models to log the user data, which is critical to collect but not so much that waste our precious DB connection &amp; resource on it. Like Auditing records for a model.

To help in such scenario, you can use this package. This package stores the records which were meant for DB into redis &amp; moves them to DB on scheduled basis.

How to use
----------

[](#how-to-use)

use the trait ***AsyncDBHelpingTrait*** in the models where you want them to be in async mode. It will override the create &amp; save methods for the model.

- In case of save, if model doesn't exists than only it will be put in async mode.
- There are two methods available which you can define in you model, where you are using the AsyncDBHelpingTrait, ***beforeMoveToRedis*** &amp; ***afterMoveToRedis***
- ***beforeMoveToRedis*** : As the name suggest, this function runs before moving the data from redis to DB. While running this function, model will be holding the same data as saved into redis.
- ***afterMoveToRedis*** : this function runs after moving the data from redis to DB. The model at this point will hold all the data as saved into redis and primary key value (id).

***Move data from redis to DB***:

- You can run the command ***move-to-db:redis*** periodically to move the data from redis to DB.
- The command receives an optional argument ***batch\_size***, default set to 1000. The batch size is the number of records which will be moved from redis to DB in one go.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1517d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c14be13995681df5861b62264b5e42f1aa5e70263c8ab078aa6bcef5516a9aa1?d=identicon)[mohitYogi](/maintainers/mohitYogi)

---

Top Contributors

[![mohitYogi](https://avatars.githubusercontent.com/u/20014551?v=4)](https://github.com/mohitYogi "mohitYogi (9 commits)")

### Embed Badge

![Health badge](/badges/mohit-yogi-async-db-helper/health.svg)

```
[![Health](https://phpackages.com/badges/mohit-yogi-async-db-helper/health.svg)](https://phpackages.com/packages/mohit-yogi-async-db-helper)
```

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[teamtnt/tntsearch

A fully featured full text search engine written in PHP

3.2k3.0M28](/packages/teamtnt-tntsearch)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[pdffiller/qless-php

PHP Bindings for qless

29113.2k1](/packages/pdffiller-qless-php)[concrete5/core

Concrete core subtree split

19159.3k48](/packages/concrete5-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
