[EHPweb] Realtime Database

Eric M Martinez emartinez at usgs.gov
Thu Oct 1 17:46:24 GMT 2009


- All -

After several meetings regarding realtime data and how it interacts  
with the database in the larger scope of the EHP web site, we have  
come to the following solution:

All realtime earthquake applications (RecentEQS, Shakmap, PAGER, DYFI,  
etc...) that uses a database shall run only on EHPMaster and  
EHPBackup; furthermore they will run independently between the two  
servers (no replication).  They will all use a common, "realtime"  
MySQL database.  On the primary server (currently EHPMaster), this  
database will be replicated out to the public web servers (EHP1-4).

Digression: Similarly, file content generated by realtime systems  
should also be generated exclusively on EHPMaster and EHPBackup and  
the current primary server should be configured to replicate file  
content to the public web servers.

Each of the public web servers will be allowed read-only access to  
their local (replicated) copy of the realtime data. A public web  
server is not allowed to write content back to the master database.   
There will be one common, shared user, "web", that will be used for  
all reads on any table in the realtime database.

Each realtime data provider (application) will additionally be given  
an unique application user account that is able to perform read/write  
queries. This account will only have access granted from localhost on  
each of the master servers (i.e. EHPMaster can perform writes to its  
local database, EHPBackup can perform writes to its local database).   
Additionally, each application-specific write user will only be  
granted privileges to write to tables in that application's namespace  
(see below).

In order to share a single database for all realtime products, each  
application should determine a prefix, "namespace" for its tables.  
Additionally, if an application is undergoing a major version  
revision, each version revision should be given its own namespace as  
well.  (i.e. ExpoPAGER -> LossPager).  All table names for a given  
application/version should be prefixed with the determined namespace  
identifier. This applies even to applications that use a single  
table.  Following the namespace will be an underscore, "_", followed  
by the actual table name, for example: pager_event, pager_version,  
pager_exposure .  Here, "pager" is the namespace and "event",  
"version", "exposure" are the table names (this is an example only and  
does not reference actual tables).

We recognize there are already several production-level realtime  
applications running on the public web servers that do not follow  
these rules.  They can and will continue to run in their current  
state, however, as time permits for these applications to be updated  
and for any future application deployment, these new rules will be  
enforced.

If you have questions or concerns regarding these rules please let me  
know.  If there is enough confusion/interest we can have a brief  
meeting to discuss these rules and their implications.  These rules  
will require improved communication between application developers and  
server administrators and are meant to help us organize data, prevent  
confusion, and prevent broken applications similar to what occurred in  
the past few days following significant events.

Thanks,
	~Eric.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://geohazards.usgs.gov/pipermail/ehpweb/attachments/20091001/f39ada12/attachment.html 


More information about the EHPweb mailing list