Question

Which is the best way to implement visitor's logic?

  1. Create visitors table |ip|resource_type|resource_id|
  2. Create serialize field in records (Post, Pet, Event, Ad, etc...)
  3. Use nosql solutions
  4. Any other idea

    • In the 1st case, we have extended the table size for every visit.
    • In the 2nd, we have a long field.
    • In the 3nd, I have trouble with mongoid at production (centOS).
Was it helpful?

Solution

Not sure I'm answering, but I would not implement that myself, but rather take a look at existing solutions. For basic counting :

For more detailed metrics about what each user does, I would go toward cohort.

A totally other option could be using just the log and something like lograge to log each request. It is very easy to add fields (such as the IP). You can then extract all the informations from your logs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top