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

Add Analytics to measure usage #29

Open
MCBoarder289 opened this issue May 22, 2024 · 4 comments
Open

Add Analytics to measure usage #29

MCBoarder289 opened this issue May 22, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request infrastructure Deals with the infrastructure/architecture of deployment

Comments

@MCBoarder289
Copy link
Owner

MCBoarder289 commented May 22, 2024

Preface

I'd like to be able to measure usage of the app, but after doing research, also not use any third party analytics because I want to respect privacy as much as possible.

Need to add in the help docs what we're tracking so we're transparent. For the app to be useful at all, your Goodreads data would need to be public anyway, so we are not tracking anything that isn't publicly available. Still want to be transparent though about what is stored.

The solution needs to be:

  • Cheap and scalable (unless it starts to get used a ton, I'd like to keep it free, but also be able to scale with more usage)
  • Privacy-first (care less about an individual, more about overall usage - shelf data may be helpful for ML recommendations as a future-state feature)

Implementation Ideas

  • Supabase Postgres DB
    • Not finding any other great "free tier" databases
    • This would need to be kept alive through usage once a week
    • With postgres, easy to transfer to something I roll on my own if needed.
  • Single "Event" table which simply writes a record when "Get Data" form submission is sent. It should contain:
    • Shelf URL
      • Proxy for users. Nothing preventing a user from picking form other public shelves, but a good anchor value
      • Could be used later to see what books are being searched (obviously a point in time as the shelves can change)
    • Timestamp of the event
      • Could also maybe store the start and end time to get an idea for performance
    • Number of books returned
      • Could be correlated to parsing time
    • Stretch Maybe store the book data too? As well as what was randomly selected?
      • Might be too much data
  • Stretch Track Library Searches
    • What libraries are being searched most?
    • Are people searching Libby or Physical books more often?
  • Aggregate tables to be exposed to a new page on the app (30-60-90 day trends?)
    • Could be a stored procedure? Or simply a view?
    • If a stored proc, then maybe it saves daily counts in an aggregate table
    • Exposed view shows some high level charts that simply pull from the database
@MCBoarder289 MCBoarder289 added the enhancement New feature or request label May 22, 2024
@MCBoarder289 MCBoarder289 self-assigned this May 22, 2024
@MCBoarder289
Copy link
Owner Author

MCBoarder289 commented May 22, 2024

Maybe look into using a free SNS and Lambda architecture, that way we simply fire-and-forget, but don't compute on the BE server?

Invoke a lambda from a SNS topic: https://docs.aws.amazon.com/lambda/latest/dg/example_serverless_SNS_Lambda_section.html

@MCBoarder289
Copy link
Owner Author

Talks about SNS -> SQS -> Lambda for more control over the queuing: https://www.reddit.com/r/aws/comments/11jwjnd/when_to_use_what_sns_sqs_lambda_vs_sns_lambda/

@MCBoarder289
Copy link
Owner Author

MCBoarder289 commented May 22, 2024

Deploying AWS Lambda via Docker (should be free if the repository is the public one and not a private one): https://docs.aws.amazon.com/lambda/latest/dg/python-image.html#python-image-instructions

@MCBoarder289 MCBoarder289 added the infrastructure Deals with the infrastructure/architecture of deployment label May 26, 2024
@MCBoarder289
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request infrastructure Deals with the infrastructure/architecture of deployment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant