Is MySQl replication the best solution for me? [closed] - mysql

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 months ago.
Improve this question
I have eight master servers dbs that are operating on identical databases on a localhost webapp to register payments as by my client specs
I need to replicate all these to a slave or replica which is our main server
But master slaves have internet and power outages constantly so there will be no reliable connection
The end goal is to have access to the data in my server

I think the short answer to your question is "no". Replication has one primary server that is replicated by secondary databases, not the other way around. I that case, the primary is the only one that gets written to, so there are not any conflicts.
If you have a system where many databases are being modified, then you will need a way to reconcile the changes later. Two of your distributed databases could have inserted a row with the same id, for instance.
You probably want to use UUID's for all your id columns, and you're going to have to write code that does the reconciliation, or use a database product that supports eventual consistency (all of which, as far as I know, use UUID's).
Edit to add: unless your database is super-simple, you are going to find reconciling the versions to be really tricky. What if two people edit the same record? Who's version wins? What if they only edit different columns?
Unless your users are carefully siloed on what information they can change, I'd advise leaving the reconciliation process to the professionals.

Related

Does MySQL provide native support for enabling a resilient data storage? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
My client strongly desires for a highly availability access to data stored in their MySQL database. They want to be confident that a reliable solution exists to avert downtime due to a database server failure.
In the scope of MySQL database, how may I provide a resilient data storage solution to my clients?
There should be a means to ensure our app stays up and is not starved of data necessity for its operation when DB server goes down. I googled and found this:
http://galeracluster.com/documentation-webpages/configuration.html
But I think there should be an easier way to switch between different DB servers, am I right?
In any case my question is: what is the practices to handle such situations when DB server goes offline?
You are looking for a database cluster (probably with multi-master replication)
https://dev.mysql.com/doc/refman/5.7/en/mysql-cluster-replication-multi-master.html
This topic is WAY too deep for an SO post, but this is the direction you should be heading.
The solution to the challenge you described is Database Replication.
Replication in computing involves sharing information so as to ensure consistency between redundant resources, such as software or hardware components, to improve reliability, fault-tolerance, or accessibility.
Database replication can be used on many database management systems (DBMS), usually with a master-slave relationship between the original and the copies. The master logs the updates, which then ripple through to the slaves. Each slave outputs a message stating that it has received the update successfully, thus allowing the sending of subsequent updates.
MySQL supports DB replication when you configure it. So, you do not have to implement the actual replication process.
See the official MySQL documentation on ⇢ MySQL database replication.

Multiple database per application. Is this better security? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am working on a project which in my mind should only be about 1 database. However, the client insists that separating data into multiple databases would be more secure in the event of a security breach. It kinda makes sense but in the end I think that if a breach occurs, you're most likely to get everything stolen no matter how many databases you have. I guess you're protected if and only if there is no connection between your databases.
My project consists of two types of users, Basic and Paid. My client insists that the basic users should have their own database while the paid users be completely on a separate database. That means I would have to build two login tables in each of the database. The problem comes in the fact that a free user (or even a guest) is allowed to search for a paid user. Well, guess what, I'll have to connect to the paid users database in order to retrieve them. Isn't this the same as having them all in one place? And I did not even mention that users need to have addresses, images and other things associated to them (basic or paid). That is where things would get interesting in trying to enforce integrity between the two databases.
Now, back to the question. Is it more secure to have multiple databases? If yes, why would it be and what must be followed in order not to break that?
Your problem is one of the most common question I've heard from business all the time. You already said totally true concerns from the point of developer view and you are right about them.
Trying to separate tables of database to different servers is NOT going to help for security. Despite that, it is going to cause integrity and synchronization problems which has higher impact than the data breach.
When attackers have an access to your application server, they will also have an access to all databases. Although encrypting of source code -E.g Ioncube for PHP-, ain't gonna help you. On the other hand, one single sql injection vulnerability will lead you to leak whole databases even if you are using two or three separated DB.
I believe they are trying to insists about separate database service from web server.

Is it OK to copy DB files from one MySQL server to another? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have two identically configured MySQL 5.6.10 servers and needed to move the data files fast from one to the other. Is this an OK procedure?
Here is what I did:
1) Shut down both servers
2) Moved all the files from one box to the other (DATA is on a separate drive on both machines)
3) Turned the second server on
4) Connected it back to the app server
It took about 5 minutes to move all files (~50GB) and all seems to work. I just wonder if I missed anything?
Thanks much for your feedback.
If both the server versions are same, then I think, it's perfectly fine, not just OK, as I have done the same many times, without any data loss, but this method comes with cost:
You have to shut down mysql server (which is not good, if it's a production server)
You have to make sure the permission of data (mysql) directory is same as the previous one.
You will have to monitor the mysql_error log while starting the second server.
You can use mysqldump, but if you don't want to, then you can use Mysql Workbench's migration wizard, it really takes care of everything.
A much safer and recommended way would be Database Backup And Recovery.
Do a full backup from server1 and restore it to server2. Later then on, you can go for a differential backup.

Restore MySQL Database from another server, will it affect current databases? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Morning, we have 8 databases on our live server. I have created a new one on our test/development server. In MySQL Administrator I've backed up this new database to an SQL file, this file is on the new server. If I use "restore" in MySQL Administrator to create this database, will it affect the other databases that are there or will they carry on working as normal?
Is there a better way to do this?
The new DB is only a few k in size, the others contain many years of info and data and are huge. Any help appreciated
No, it won't. As you said that your DB is small it will not affect at all the other DB. It would if it was bigger, most probably it would slow dow your server a bit during the import (if it was bigger, huge to be precise), after the import the database will work normally. Of course it will share resource to keep one more instance working. And with time, it will make some difference in performance (depending on how big this DB grow). But you will have to be more concerned with hardware capabilities then the database itself.
Of course, I assume that when you say database you are saying about a new instance on your database.

phpMyAdmin Designer with just 1 database. Alternatives? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I bought a 1and1.es (Spain) Starter hosting plan for a small project we are starting. It only allows one database. I never imagined that to enable phpMyAdmin Designer (the graphical tab where you set relations between tables) you'd need to create another database. Of course, when I try to, I get an "access denied" error.
So, assuming I can't use phpMyAdmin, I haven't been able to find the right term to look for an alternative MySQL manager that has some kind of graphical relation creator. I just converted the tables to InnoDB and I have Relation View, but a totally-unskilled team has to work with it so we need visuals.
PS: I just saw I can pay 1$/month and have another database, so I might consider it (it'w low price, but feels useless having a 1GB database just for a silly database. I don't get why phpMyAdmin needs another database just for that).
Thank you
Why do you imagine that the phpMyAdmin configuration storage needs a separate database?
According to http://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage,
"you need to create a set of special tables. Those tables can be located in your own database,"...