Convert local database to cloud hosted mysql database - mysql

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.

Related

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.

Windows phone 8.1: Need suggestion on what database should I use

For my Windows phone project (it's a Universal app), I have a set up that has a country and a phone number in one of the page. There are about 7 other pages that requests the user for additional information. But for starters, let's just stick with the first one, that asks for the country and the phone number.
I read through a million posts in Stackoverflow and other websites alike, to know what database system is best to implement with the sort of app I am going to be developing, or hoping to develop.
Here're my findings:
Azure SQL: I have an Azure account and I can use the Azure SQL service to store the user-input data directly to the database (when the app goes live), or while in the testing phase. But I got to know that feature isn't really working well as windows phone cannot readily update the data to Azure SQL, on realtime basis. Is it so?
MySQL: I thought I'd create a local MySQL database, for testing purposes, so as I input the data (in the emulator perhaps), the database saves it. I am unsure how I can implement this. I can't find any article I can read that can help me with this. There are with ASP.net, but it isn't what I am going to be using.
SQLite: I know for a fact the data can be stored locally, by using SQLite, but I could like to know if the locally stored data can be later updated on a server-side machine (i'd prefer Azure SQL, but MySQL is also OK with me). If it can be, i wouldn't mind settling with it. If it can't, what can I do?
It all boils down to this: What's the easiest way to store data entered in a textbox (lol, yeah!) to a database (locally or server-side)?
Your efforts to help me will be greatly appreciated!
Thanks!
You can stay on Azure SQL if you have an account.
It works fine and it updates database on the go (sends json as far as I remember), so you shouldn't worry about data being stored in a cloud. Moreover, it is super-easy to use it for your needs (store data from textbox).
Azure SQL will get your bootstrap the fastest for your application. There is no need to deploy MySQL or SQLite and managing your DB. There should not be any concern about updating the DB live from the app.

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

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.

Tracking data access

Backstory
I work for a company that has an online site that allows user to text personal information for collection. We collect the data, and make it available online. Users can choose to share the data with other users.
Going Forward
At some point, this may become classified an FDA-governed medical tool. In anticipation, we'd like to have in place a logging system that shows each time someone accesses our users' data, whether it be the user themselves, another authorized user, or a support person.
Current Architecture
We are currently running Ruby/Rails, and using a MySQL database. The personal information is encrypted in the database.
Data Access for Support
Today, support personnel can access data one of three ways:
admin site The admin site is limited to whatever screens we develop. While we don't currently, we could easily add logging to keep an audit trail of who accessed which data using the admin tool.
sql client I use MySQLWorkbench to access production. However, when connected this way, all personal information (user name, cell number, etc), is encrypted.
Ruby Rails console - Finally, support can log into one of the production boxes and use the Ruby/Rails console from command line. Ruby will decrypt the data, so we can do some simple things such as
u=User.find_all_by_state('active')
and it will return the recordset of all users with state='active', and decrypt their personal information in the resultset.
Holy Grail
logging
easy access for support
I'd love to be have a way to allow easy support access (once authenticated) to the data, but would log everything that is accessed (read or updated). That way, if I'm checking out my buddy's ex-wife's data for example, it gets logged to a place where I can't get in and clean it the audit trail. (See Google firing Gmail employee for an example of employees breaching the data policies).
Anyone have ideas, thoughts, experiences, suggestions with this issue?
hey devguy. This was a issue for me a couple months back. We ended up centralizing our mysql queires so that we could start to track all information coming in and out. Unfortunately the class I wrote is in PHP but the idea behind it could make it very easy to start logging.
https://code.google.com/p/php-centralized-mysql-controller/
Try stored procedures. Make all code use the stored procedures for CRUD activities. This defines an API that your developers can use while business rules are global enforced (don't return entire SSN values, but only last 4 digits, etc).
This serves as the basis for an external API as well.
If you want logging/auditing, you put it in the procedure.
This protects you from everyone except the DBAs.

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.