Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Create Transaction Log Collection for Database #1480

Closed
lakshz opened this issue Dec 11, 2023 · 12 comments
Closed

Feature Request: Create Transaction Log Collection for Database #1480

lakshz opened this issue Dec 11, 2023 · 12 comments
Assignees
Labels

Comments

@lakshz
Copy link
Contributor

lakshz commented Dec 11, 2023

Is your feature request related to a problem? Please describe.
We don't track when a record is created or updated in the database.

Describe the solution you'd like
Setting up a new collection dedicated to logging all transactions or changes made within the database. This collection will serve as a detailed history of all data interactions, providing an extensive audit trail.

@lakshz
Copy link
Contributor Author

lakshz commented Dec 11, 2023

@xoldyckk Please assign this to me.

@github-actions github-actions bot added the unapproved Unapproved for Pull Request label Dec 11, 2023
@xoldd
Copy link
Contributor

xoldd commented Dec 11, 2023

@LakshyaSatpal Dunno what u mean by a new collection for logging transactions/changes, isn't this something that should be handled by the database provider itself?

@lakshz
Copy link
Contributor Author

lakshz commented Dec 12, 2023

As discussed here, the goal was to log the CRUD operations on the database. However, I get your point about database-level logging.

I see MongoDB does provide some auditing features https://www.mongodb.com/docs/manual/core/auditing/. But, it's not exactly a collection in the database, I believe. So, I'm not sure if this solves our purpose. @palisadoes Thoughts on this?

@Cioppolo14 Cioppolo14 removed the unapproved Unapproved for Pull Request label Dec 12, 2023
@palisadoes
Copy link
Contributor

Yes, that would work and should be enabled by default in our setup to a well known location outside of our code base tree that would be installed on the system.

Copy link

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

@github-actions github-actions bot added the no-issue-activity No issue activity label Dec 23, 2023
@palisadoes
Copy link
Contributor

Unassigning due to no issue activity and no submitted pull request

@lakshz
Copy link
Contributor Author

lakshz commented Dec 23, 2023

Still working on it. Will raise a PR this weekend. Please assign this to me. Thanks.

Apologies for the delay.

@lakshz
Copy link
Contributor Author

lakshz commented Dec 23, 2023

Based on the previous discussion, seems to me, that there are 2 possible solutions to this:

  1. If we want to implement database-level logging, then we have to just edit the MongoDB configuration on the server. So, MongoDB will listen to all events and log to some place (a JSON file or something) on the server. So, this will be related to server configuration and not to the application codebase. (or maybe we write a script that executes only in production environment)
    reference: https://severalnines.com/blog/audit-logging-mongodb/

  2. We create a new collection, and we manually update that collection on every mutation, storing everything according to our requirements. This is something we can implement and add to the codebase.

@palisadoes @xoldyckk Could you please suggest which path should we take?

@github-actions github-actions bot removed the no-issue-activity No issue activity label Dec 24, 2023
@lakshz
Copy link
Contributor Author

lakshz commented Dec 26, 2023

@noman2002 @aashimawadhwa Can you please check this?

@palisadoes
Copy link
Contributor

palisadoes commented Dec 28, 2023

  1. We should consider updating our documentation to show how to log transactions with MongoDB first
  2. Then we should add a collection to store all the transaction logs for mutations. I say this because I'm assuming that this would be more readable and accessible via the Admin Portal and DevOps teams

@lakshz
Copy link
Contributor Author

lakshz commented Dec 28, 2023

found out that audit logging is only in the MongoDB enterprise edition 😅
Proceeding with the second choice now.

Copy link

github-actions bot commented Jan 8, 2024

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants