keep tracking of EDIT method

Options

Hello, before publishing my application, I am looking for a method to track data changes (CRUD EDIT). For example, a user changed their name or phone number in a table but I want to keep track of what they changed. Which method is correct and economical?

Tagged:

Best Answer

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    I would create a custom function to wrap the edit record for that particular table. That function would have the job of tracking what changes were being made and log them (often to an audit table) along with updating the record in question.

  • thierry
    thierry Member
    Options

    Thanks Ray for this, but this will produce a large amount of data…. but is there any tutorial around about this with xano?

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    You could store it in a Xano table for audit record keeping (a common practice I've found) or use a TP logging system like datadog or sentry. The right answer depends on what you mean to use the data for!

  • thierry
    thierry Member
    Options

    yes que question was: HOW TO ?
    I looked on https://docs.xano.com/metadata-api, maybe I could use the request history linked to another service to store with cron changes along the time… my question is "is there a tutorial for a less effort method to do that ?" I don't want to use these data really, just to look on if/when a customer did bad things from his account...

  • Ambroise
    Ambroise Member
    Options

    @Ray Deck How would you go about integrating Xano and Sentry?

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    I'd probably implement outbound logging requests to Sentry using external API request wrapped into a custom function to improve the ergonomics. I would also set up a background task monitoring the request history via the metadata API, and when it sees new errors, remit those to Sentry.

    A lot of sentry's pitch is in the tight integration and error introspection. As a warming, you won't get as much of that from an integration with Xano because the connection will be on the surface, not embedded into the error handling subsystem.

  • Ambroise
    Ambroise Member
    Options

    Thanks for the warning, I was considering Sentry because:

    • It helps centralizing all errors
    • It acts as a hub for notification into other systems (Slack, etc.) without having to code everything
    • It offers a lot of features regarding what should generate alert and what should be kept silenced

    But I agree that most of the magic will have to be done by hand, it won't automatically detect which Xano user made the request and such, those will need to be configured specifically for Xano.