MySQL Forums
Forum List  »  Performance

Best performance stucture
Posted by: Romain MARCHAND
Date: May 18, 2017 02:37AM

I'm working on a database structure for a project and I'm wondering what method use for the footprints table.
Our tool provide a complete and high standing IP filtering service. The purpose is to let our customers filter their advertised traffic, and choose who is seing their website exactly.
The main purpose is to choose excactly which page they want to send Facebook on, while advertising on Facebook for example.
All the traffic of the service is due to the visitor visiting ads of our customers. (1 API call / visit)
Technically we just do a 301 redirect to the good page and we log the user data on our database.

On each visit I need to check if the IP is not on the database. And if it not I write the the user logs on the table.
I'm using Laravel 5.* with Eloquent
This table will contain, user-id, user-agent, IP, DNS, Lang....
We will have around 1-2 Million call everyday (1-2 row everyday).

Method A :

LOGS_TABLE :

| Id | dns | ip | user_agent .... |
|-----|-----------------|----------|---------------------|
| 1 | dns.google.com | 8.8.8.8 | firefox.*........ |

Method B :

LOGS TABLE :

| Id | dns_id | ip_id | user_agent_id | |
|----|--------|-------|---------------|--|
| 1 | 1 | 1 | 1 | |

IP TABLE:

| Id | value |
|----|---------|
| 1 | 8.8.8.8 |


The problem is, there is 10 fields like this and I'm afraid that all the jointures will slowed the requests.

Can I have an explication for, why method A or B please.

Thank's for you help.

Options: ReplyQuote


Subject
Views
Written By
Posted
Best performance stucture
189
May 18, 2017 02:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.