473,385 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 .

Mar 23 '06 #1
1 1928
ro*******@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 :)

Mar 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: John | last post by:
Hi. I am just in the very early stages of learning Php and just need a little help. I have a form which includes values. However when I test it, the values are not added up and carried to...
3
by: hshen | last post by:
Hi All, I have encountered a weird behavoir of embedded MySQL. Through a simple program I made (in Delphi 6), I can insert rows to a table through embedded MySQL and I can retrieve the rows from...
0
by: albert | last post by:
Dear, Now i'm trying to install MySQL 4.0.14 through binary source install. I'm using Redhat 7.2 and 8.0 I'm trying like this.. ../configure --prefix=/usr/local/mysql \...
24
by: Ehud Shabtai | last post by:
Hi, I would like to store samples of data which are gathered from about 500 devices in mysql. Each device has its own data which changes over time. The data may be integer or float. The...
5
by: Clodoaldo Pinto Neto | last post by:
Hello, How to make sure COPY TO writes the table lines to the file in the same order they were inserted? I'm producing html pages in pl/pgsql and using COPY TO to write then to file....
2
by: pmz | last post by:
Dear Group, I'm connecting in C# with remote (BSD) MySQL server with ODBC Driver, and I'm trying to find the best sollution in such problem: As I've read on MySQL manual, they have suggested...
3
by: sp3d2orbit | last post by:
I've read the MySQL licensing material and what I've found online, but I'm still unclear about when I have to pay MySQL for a license. Scenario: I've created an application that stores some data...
30
by: Einstein30000 | last post by:
Hi, in one of my php-scripts is the following query (with an already open db-connection): $q = "INSERT INTO main (name, img, descr, from, size, format, cat, host, link, date) VALUES ('$name',...
0
by: brianrpsgt1 | last post by:
I am attempting to insert data from a HTML form using a .psp script. I can not find how to link the data that is inserted into the form to the variables in the .psp script to then insert into the...
4
by: hiitzsdg | last post by:
Hi All, I am completely new to VBA and I am trying to develop a macro in a workbook (Backup.xls). The main functionality of the macro is: 1. It would open another workbook (Source.xls). 2....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.