Show HN: Visit tracking for Rails
ankane.github.io
ankane.github.io
It's amazing to have all of your data in one database, you can do so much with that data. I can answer virtually any question about how people interact with our sites without needing to closely integrate with 3rd party services.
Sure, if you have thousands of visits a second, you need to put some thought into handling that load, but it's definitely doable and not too hard. Once we get to that point, we'll probably have the page views going to another dedicated databases and use postgres_fdw to handle the queries across the two databases.
I haven't had a chance to dig too deeply into it yet, but is the info stored in a session cookie and then you can decide if/when to write it to the db? For example, if I didn't want to write every unique visit to the db, but only when a user signs up, or signs in, or takes some action x, do I have the flexibility of when I write to the db?
Could this send to redis or a delayed job and be eventually consistent to database for non-logged in users?
I haven't benchmarked it specifically but I'd have to guess your time savings to store the information in a postgresql job queue vs the visits table would be negligible at best.
I would have no idea how to add the data if you hadn't been tracking it already though.