To add another Database or not to add another Database, that is the questionn - mysql

One of my sites is a social networking site running on MySQL. I use postal code and country information to geolocate users using a webservice. This webservice also allows you to download all their many tables of information so that you can access it locally. My site has gotten big enough that I wish to do this now.
My question is, should I create a new database on my site for all of this postal code and country information and all its tables, or should I incorporate those tables into my existing database for my social networking site?
What are the pros/cons either way?

When you're talking about scaling and want to know about other databases like NOSQL, you might find this article interesting: http://highscalability.com/blog/2010/12/6/what-the-heck-are-you-actually-using-nosql-for.html

I'd vote in favor of a separate database if you planned to use the data as read-only and put a web service in front of it to access it. Users would search it based on a small handful of parameters (e.g. address info to get lat/lon data).
I'd say put it in the existing database if you planned to JOIN it with other information in your current schema.

it will live on the same disk probably.
so disk space is not an issue.
if you query the tables in a completely separate manner, then no impact on the existing site.
if you query things together, then easier when all in one database.
overall administration of one database vs 2 is easier.
i think it's a no brainer... they go in one db.

Related

Interconnect multiple databases on the same MySQL server

I am looking for a solution that lets me interconnect several databases.
But let me explain it with the exact example:
I have a main domain (front page for public clients) and four sub-domains (development, management, client, ...) in the clients webhosting.
Each domain has its own database and runs different software (WordPress, dolibarr, sysPass, our own software), but all databases are stored on the same mySQL server.
If a CRUD is made, I want that the other databases also "do" something with that data.
Basically, automation.
For example - a user on development.subdomain.xyz sets a project task to "finished".
When the UPDATE is done to the "development" database, I want an INSERT with parts of that data into the "management" database and an UPDATE towards the "client" database.
I could write up some script that connects to all four databases and does the operations necessary.
But that feels a little hard to maintain if multiple users shall have access to this "logic" system?
I could also use the provided API's and process the data (again in a script form rather than implementing a whole UI).
That feels like adding an unnecessary, extra security concern and again hard to maintain?
If I want to add additional functionality - like sending an Email as well, that would even make it harder for non-coders to interact.
So I found several of these "Low-Code Business Process Management" tools and now I'm at a loss.
Is that what I'm looking for? Can you throw me some tags, keywords or links to guide my search for possible solutions?
I do not even know how to call such a system or search for it - which stops me from progressing.
Thank you for all tips :)

Convert local database to cloud hosted mysql database

I have an application which is currently tied to the desktop application which will specific to each of my users.
The Existing application has about 300 table
The current database design is specific to a single user. For example , for a given clinic as user , we have following tables
• Patient
• Patient_address
• Patient_Images
• Employees
• Clinic_details
• Devices
What I want is to host this database on web. I want to use this database for multiple users and need to be able to store and retrieve data on a user unique key(Let’s say user ID)
The database will be local as well as cloud based i.e. I would like user to continue work even if they do not have internet, and be able to sync it on demand when connection is back, I may also choose to run a nightly sync process on user desktop.
What is the best strategy to do this? Currently I’m using MySQL, would it help if I switch to SQL?
Any help in this is appreciated.
Thanks
Bhim
P.S. - If this is not the right forum, please suggest the right forum for this question.
MySQL is SQL. You cannot switch from MySQL to SQL. It is like saying that you want to switch from Espresso to Coffee.
If you want the ability to work offline and sync when the connection is back, be prepared to be working on that little feature for the next couple of years or so. I would say, do not even try.
For storing all of your "users" in one database, the term you are looking for is multi-tenancy, and it is a big subject, not suitable for a stackoverflow question and answer. So, multi-tenancy is the term you want to google for in order to find information on how to achieve this.

How do I add a way for members to join/Log in and have profiles to my website if my SQL server doesn't have the option for more than the one database

I was looking into how to add a create user account/login to my website, so I could have members join and come back, etc and ended up finding out in order to do that, I'd need to create a new database in my SQL, to store the users credentials, I dont have the option to create any new databases by my webhost. Only the one database is what I can use. Could I just add this to my existing database? Do I really need more than 1 database on SQL for my website? If so, could I add another SQL server direct on my computer and use both, Mine and the web host one where I'm creating the site to manage my website? Im sorry for the few questions, Im really new to all this and so confused and overwhelmed.
You can create multiple tables in same database.just make a table with fields such as user id,password etc. and use it for saving,fetching user details using sql queries.
Could I just add this to my existing database?
Yes, you can tables to the existing database.
Do I really need more than 1 database on SQL for my website?
There are a lot of websites that use just one database. Some websites use connections to multiple databases. What information is stored in which database is frequently the result of factors other than the website. The ability to connect to multiple databases means that a website could use authentication/authorization info from one database, store user profiles and submissions in another, and read information from other sources (for example, historical stock prices, stored in another database.
All of that information could be stored in a single database. Having them as separate databases means that the databases can be managed separately (frequencye of backups, replication to DR site) and makes it easier to share the database across multiple applications. (For example, we would probably want employee payroll and health care information stored in a separate database, with separate access controls.
Could I add another SQL server direct on my computer and use both, Mine and the web host one where I'm creating the site to manage my website?
It may be technically possible to do that, but that's not the way you want to go. That would add another dependency... the website at the web hosting provider would be dependent on having access to another database, which is not being backed up and managed along with your website.

Good method for archiving MYSQL table data?

I recently inherited a website and they have a simple back-end area which was created using phpmaker. The back-end displays various MYSQL database tables.
There are two tables which hold registration information related to promotions/contests the company runs online. The client wants to begin archiving the registration data monthly, but still have the data accessible for future export or review.
So, can anyone tell me what the best approach would be to achieve this? I read about partitioning and Maatkit, but I'm not sure which - if either - would be a smart choice.
I would prefer to keep the table names the same because the table name is referenced in several instances within the PHP code running the promo/contest applications. I would also like for everything to be 'automatic' or at least executed at the click of a button; though I realize that might not be completely realistic.
I should note that I do not have the phpmaker project file and have been unable to obtain it.
Any help on this matter would be a great help.
MK-Archiver This is a good way to archive live mysql database tables
What MK- Archiver does is to archive rows from a table to another table and/or a file

Share logins between 2 databases or?

I have a personal website using a MySQL database (with justhost.com). The registration is very simple and only requres a username, pw, and email. I want to add an Oekaki to my site, but the Oekaki install instructions say it should have its own database. If I input the database I am currently using, will that screw it up, or will it create a new table within that database so when a member logs in, they have access to the Wiki and Oekaki under the same username and pw?
Please note I am a database newbie. I am using TikiWiki 6.2 currently and at its initial install of TikiWiki 5 created its own database. If the above won't work in any way, after I create a new database for the Oekaki, what would I have to do so it uses the current registration information from my TikiWiki database without me having to manually enter in every single user one by one for the Oekaki side of the site?
Any information is helpful, even if it just helps me learn a little bit more about databases. :)
I don't know any of these software you mentioned. But i can say in general if a software itsself recommends to use one single database for it you should do it.
I had a similar problem with my wordpress blogs database and another organisational software i installed. The next day all my blogs content was gone forever.
It could be, that for example the software just throws all existing tables away.
So my answer (or better advice) is. Be careful and if you can avoid it, don't throw together two applications in one database.
For the user-table thing you could probably just change one of the systems to use only the user-table of the other system. So nothing will be screwed up. Or if you have the opportunity make a third "General" Database where you just put your users data and use it in both systems.