infisical
infisical copied to clipboard
Audit log batching
Description 📣
This PR is for performance improvement with Infisical.
- A batching strategy is introduced for reducing our database load in audit log generation. The system will first insert data to redis list and then after each 5 seconds or when the number of entries crosses a threshold its saved to database. The present cycle is 5 seconds.
- Removed FK from audit log with project id and org id. This removes the complete dependency of audit log with other tables. Thus given the shear size of audit log it becomes an append only log. Audit log clean up will handle removing orphan rows. This will also boost performance in other query and also no more locks will cause other operation to be in stuck.
Type ✨
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation
Tests 🛠️
# Here's some code block to paste some code snippets
- [ ] I have read the contributing guide, agreed and acknowledged the code of conduct. 📝