PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > mailing.database.mysql > how could mysql copy only inserted data to the central-database?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
how could mysql copy only inserted data to the central-database?

Réponse
 
LinkBack Outils de la discussion
Vieux 23/03/2006, 06h42   #1
rolandsun@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut how could mysql copy only inserted data to the central-database?

we are designing a data collecting system, at each site we have a
database and have a central database,we will write data to site's
database, we want the site-database can publish
the data to central-database Asynchronously, how could we do that?

single replication sounds work,but it will replicate all update
,including delete ,we dont want that,we want only inserted data .

  Réponse avec citation
Vieux 24/03/2006, 04h26   #2
noone
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how could mysql copy only inserted data to the central-database?

rolandsun@gmail.com wrote:
> we are designing a data collecting system, at each site we have a
> database and have a central database,we will write data to site's
> database, we want the site-database can publish
> the data to central-database Asynchronously, how could we do that?
>
> single replication sounds work,but it will replicate all update
> ,including delete ,we dont want that,we want only inserted data .
>


This is something I have seen done in many different ways. Basically
your central database is a slave to many masters - unless you also push
something to the remote databases on a regular basis (n-way
replication). I have not read all of the rules and abilities of the
replication options, but so far I do not see how to restrict your
replicated data to just insert/update. Maybe this weekend I will see if
I can dig something up.

Make sure your tables that are to be replicated have an insert timestamp
and an update timestamp. you would then write a process that would
extract records inserted/updated since last update (have an update table
that uses a timestamp to determine the "end of the last period") and
push those records to the central repository.

Now what gets really fun here is any referencial integrity that must be
maintained. Description tables must be uploaded before data tables etc...

Just thought of something...
If you use multi-master replication it might be possible to have a
tablename in the slave (central-server) that has a before-delete trigger
to move the data to a "history" table.

These are all things you will need to consider and I generally charge
big $$$ for creating/designing such databases

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h04.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08336 seconds with 10 queries