tubackkhoa / gbif-dataportal

Automatically exported from code.google.com/p/gbif-dataportal
0 stars 1 forks source link

Change user logs to go into another DB #86

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This issue goes hand in hand with 
http://code.google.com/p/gbif-indexingtoolkit/issues/detail?id=161

The Data Portal logs some common user activity inside the portal. This is 
written currently to the 
live DB, as seen on the portal.properties file. All user logs are written into 
the "gbif_log_message" 
table. 

As a first step, we need to extract these logs to another DB (that could share 
the same DB 
structure as the one in the live DB). This will essentially make the live DB 
almost read-only (for 
small exceptions) and we can accomplish separation of concerns between logging 
and primary 
biodiversity data.

Would a change in the portal.properties
logDataSource.username=username
logDataSource.password=password
logDataSource.url=jdbc:mysql://LIVE_DB:3306/portal?
autoReconnect=true&useUnicode=true&characterEncoding=UTF8&characterSetResults=UT
F8

be sufficient? This needs to be tested first.

As a second step, the HIT is also going to write to this new DB all the 
indexing logs. So in the 
portal side, there should be special care taken at the moment of reading the 
"indexing history" 
and "user logs" so that this requests get directed to the new DB and not to the 
live or indexing 
DB.

Examples that need special care:
http://data.gbif.org/datasets/provider/308/logs/
http://data.gbif.org/datasets/provider/308/indexing/
http://data.gbif.org/datasets/provider/4/logs/?resource=&event=3001-
3999&logGroup=&logLevel=&sd_day=27&sd_month=05&sd_year=2009&ed_day=27&ed_month
=05&ed_year=2010

etc...

Would a change in portal.properties

harvestingDataSource.username=username
harvestingDataSource.password=password
harvestingDataSource.url=jdbc:mysql://INDEXING_DB:3306/portal?
autoReconnect=true&useUnicode=true&characterEncoding=UTF8&characterSetResults=UT
F8

also be sufficient? Needs to be tested...

Original issue reported on code.google.com by josecua...@gmail.com on 27 May 2010 at 2:30