0

Every time someone hits an API route I want to store that information in database, connected with req. IP. Afther I would like to find some association rules based on similar searches. Should I store some information in cookies or to use local dartabase?

Example on some hotels site: I want to store info that i got a lot of request for cheap hotels in some specific area.

Thnaks.

1 Answers1

1

Definitely in a database. Cookies wouldn't make sense because

  • You cannot rely on cookies for persistent data. They can expire, be cleared, etc.
  • Cookies can hold a very limited amount of data (4093 bytes usually)
  • Cookies are stored locally on your client's browser, you want information across all of your clients.

Tracking user behavior data is very common web feature. You may want to use a web analytics service such as Google Analytics rather then implement your own.

Antoine Vo
  • 559
  • 4
  • 10