How to store the last 100 searches made to a site (PHP / MYSQL) divided by country (eg store the last 100 searches for Macedonian books). Search is a simple simple field:
<input type="text" id="search" name="search" placeholder="Search" />
What is the best way to "collect" this information that does not compromise the performance (I think that each new search has to be inserted in the bank is too expensive), and the best way to structure this information in tables in the bank? and how to create a limitation to 100 searches per country and work similarly to a queue (keeping the 100 searches always up to date)? This list should be accessible to all users and updated in real time as do the application level as well.
Country Table:
CREATE TABLE pais(
id INTEGER NOT NULL AUTO_INCREMENT,
codigo CHAR(2) NOT NULL UNIQUE,
nome VARCHAR(70) NOT NULL,
PRIMARY KEY(id));
Note: This code is the ISO country code.