Please how can I copy current updates of different databases in a single database - postgresql-9.5

I want to synchronize different databases in a single one. I want the current updates of all the different databases in a single one. How can I do it with postgresql

Related

Merging same structure databases but keeping their existing data.

Currently I have 3 (same code base apps) with it's own databases and own unique data. Were moving towards doing multi tenancy in rails, after a couple of prototype testing we've decided to go for a shared tenancy. My only biggest problem is that, each databases have their own data with unique ids and etc. How would it be possible to merge them either via sql command/dump or rails script that way they will have their own account_id + keep all data integrity?
Absolutely doable. It depends on a lot of details.
Basically I would
Make a full backup of all three.
Prep each database to hold compatible data (no duplicates).
Select one to be the new master.
Dump the other two (data only).
Hack the dump, to make sure. Typical COPY statements in dumps are just fine.
Restore data from the two additional database on top of existing data in the master.
Make sure all sequences are set properly.
Run vaccumdb -fz master.

Migrating changes from one sql database to another

Several databases:
DB_Dev
DB_Test
DB_Prod
When new columns are needed or existing columns need to be altered, they are always changed on DB_Dev first and then the changes copied to the others when everyone is happy.
Is there any tools that will look at two databases, show the changes, and allow to make those same changes to the second database automatically? Changes will only be forward - ie, DB_Dev will never be out of date.

Azure data sync not syncing all databases

I've searched for what should be a seemingly simple thing, and I can't find a reference to this issue anywhere. I have a very simple Azure Sync setup... one master database that needs to do a one way sync to three client databases.
It's only syncing three tables right now (all fields), and there's no filtering at all. I've verified that the schema on all four databases is identical and my sync process returns with no errors, but when I check the data, it's only ever updated one of the three client databases.
Like I say, this should be really simple. I've tried clearing the tables and re-adding them, even deleting the whole Sync Group, but no matter what I do, only one database updates. Any idea what I could be missing, or does Azure only allow one table to be sync'd?

Placing all tables into one database - Good or Bad

Two scenarios:
Large application - One database w/all tables
or
Large application - Multiple databases w/relevant tables
Can anyone list the advantages/disadvantages?
Unless you have very specific reasons, keep everything in one single database. I cannot think of a single advantage of splinting one single schema into multiple DBs.
One single database creates one single unit of recovery, which allows for a consistent backup. It also presents one single unit of failover for high availability. With multiple databases one cannot take a consistent backup unless it freezes activity (often impossible). also multiple databases pose challenges in orchestrating a 'group' failover in case of failure (some DBs may failover to a new server, while other may stay behind).
Multiple databases offer advantages in multi-tenant models where each tenant can have its own database, specially if tenants may choose or opt-in on version upgrades (this is impossible with single DB). But this is a scenario with many databases having the same schema (same tables in every database), not splitting a schema across several DBs.
Scale out by data partitioning (sharding) can only be achieved by having multiple databases, but that is a different topic from splitting a database into 'parts' (each DB with a different schema). Shards have identical schema, but contain data for specific ranges.

How to create linked or mirrored tables in MySQL

I have two applications using two nearly identical MySQL databases within the same cluster. Some tables must contain separate data, but others should hold identical contents (i.e. all writes and rows in db1.tbl should be accessible in db2.tbl and vice versa).
What's the proper way to go about this? Note that the applications use hardcoded table (but not database) names, so simply telling application 2 to access db1.tbl is not an option.
What you need to do is set up replication for the tables that you need. See http://dev.mysql.com/doc/refman/5.0/en/replication.html for the documentation on setting up replication in MySQL.
For databases on different mysqld processes
You should check the official manual for replicating individual tables:
http://dev.mysql.com/doc/refman/5.1/en/replication-options-slave.html#option_mysqld_replicate-do-table
You can setup an Master-Master relation between the two mysql processes just keep in mind to be carefull and have uniqueness on your Primary Key.
For databases residing on the same server & mysqld service
IMHO design wise you should consider the idea of moving all your shared tables under a different DB.
This way you will avoid all the overkill of triggers for updating them.