postgresql database server and many users - database

I'm relatively new to databases - I've used postgresql in the past to create databases stored on my computer and accessed only by myself.
I'm currently designing a database that will be used and edited by multiple people (10-15 max) living in different parts of the world. What is the best way to ensure we will all have access to the most current version of the database? Is it best to continue storing the database on my individual computer? Should I host the database on a cloud server? I've read that it is dangerous to store databases on Dropbox.
We are social science researchers organizing our data into a single database.

Based on your comment about not always be on and connected, it seems to me that the cloud service is the way to go for you. There are two approaches there, just rent a machine ("AWS EC2") and install the database software and manage the database yourself, or use a cloud provider's managed database service ("AWS RDS"). The names are just by way of a concrete examples, there are other providers of each type of service.

Related

Oracle DB Access

I have a client/server application currently that has a Oracle 10G database. The company that I purchased the application form is not providing support. The company when I purchased the application provided me a SQL tool with a READ Only access access to approx 30-40 views.
Based on my analysis the views provide some but not all the data and I want access to data which may be in other tables
I am not a developer but the business owner so excuse my naivety in some of the questions below.
Can I export/duplicate/replicate the Oracle DB to another Oracle DB and will a Oracle DBA be able to view/access all the tables and understand the relationships
What is the best way to create a duplicate DB that keeps in sync with the application DB which we currently have. We would like to use the Duplicate DB as a backend for a website.
Thanks a lot!
ML
Assuming that the Oracle database resides on a server in your organization, it seems premature to be talking about talking about replicating the data to a different database. It is certainly possible to do so. But you can also run many, many different applications against the same database. Unless you know that the current database server would not be able to cope with the additional workload of the new application or you are planning on investing the time and effort to transform the data into better data model as part of replicating the data (which is extremely unlikely if you don't already know what the underlying data model is and if you don't already know that this data model isn't going to work well for the new application), you probably want to start with the assumption that you can probably build the new application against the existing database.
A database developer or a DBA should be able (again, assuming that you own the server) to determine what underlying tables exist. That person should be able to at least get some idea of how the tables relate to each other based on the existing view definitions. If the original company did a good job building the database, a new developer/ DBA should have a relatively easy time understanding the relationships. If the original company did shoddy work or was intentionally secretive, it will be a more challenging undertaking.

How to amalgamate client databases into one database?

In my company we have a selected list of companies that are using our in-house built tool (e.g. Northwind).
When we make changes we deploy these to all our client locations.
The structure currently is: the application is installed at the client's location and the databases sit with them.
However, we would like to consolidate all this information into one database and clients will connect via web services for any data requests.
For example....We have deployed Northwind App and Db to company X, Y and Z and would like to create a single database to maintain all these company's data.
We have reviewed one option which is to create a field for the Company to associate it with the various tables and another option is to create a schema for each company and in this way we can allocate permissions to the relevant company. Is there an alternative to this and what are the pros and cons to the ways we could do this.
One con with adding a company field, is that we have to cater for indexes being the same in all the client databases and this makes it more difficult and the performance of the app as a whole due to multiple requests to the same db. Please Help?
Note: Using Sql Server 2008
Research "multi-tenant database architecture". (For your purposes, think of one tenant as one client.) You'll find a spectrum from "one database per tenant" to "every tenant in every table".
Read carefully. Writers in this field can confuse you. Expect technical terms like shared schema to mean different things to different writers.
See this SO answer for tradeoffs.
For your first step, I wouldn't consider anything besides simply moving those client databases in-house. Just doing that is going to give you and your application programmers enough headaches. You don't need an architectural change on top of it.
That will also give you time for research and testing.

How to access my database in PHPMyAdmin from a different computer?

I am working on my Java application in Eclipse that connects to the database and makes some queries with the data. This database has been created and managed in PHPMyAdmin. The database is stored locally and now I would like to make it accessible not only from my computer, but for anyone who will run my application on his computer. Can anyone tell me what is the procedure? How can I make the database "online"? Should I store the database on some remote server? If so, what is the procedure?
I know this question is not so much straight-forward, but I hope you will give me some idea how to deal with it.
Thanks in advance!
In this situation you should store the database on an external server who are better at managing databases with more security/backups etc.
If you're looking for scalability as well you could get an Amazon AWS Micro Instance in the cloud for free for a year which includes a large amount (20GB) of RDS (their relational database service based on MySQL) for free.
There is a great Stack Overflow question on Using PHPMyAdmin to administer Amazon RDS as well to get you started with something you are familiar with.
You can use MySQLDump to copy your current database from your local machine to RDS if you needed.
(A, completely non-extensive, list of) Mysql Hosting Providers
Webfaction - Good web user interface. Does more than just database hosting. Lots of documentation.
Amazons RDS - Cloud based. Reliable. Offers free tier
Rackspace - Cloud based. Excellent customer service.
Or, host your own on something like these
Linode - Has lots of documentation of getting Mysql installed
Digital Ocean - SSDs for great speed. Again great documentation on getting Mysql installed

Is it safe to keep all databases on one SQL server?

I'm creating a Multi-Tenant application that uses separate databases for each 'client'.
Is it safe to keep all the clients databases on one SQL server? Assuming I give each db its own user account?
Thanks
There was an excellent blog post by Brent Ozar last week on this exact subject.
How To Design Multi-Client Databases
Yes thats basically good idea to manage the tenanats from one sql server(better in terms of resources etc), but you need to create one seperate database for storing the connections strings of other tenant databases, roles etc.
It would be fine with one sql server, if you decide later on to place all the data into cloud. Basically its easy to manage . Also If you want to update any procedure, you can do it easily for all the tenants.
I'd normally use one database per client on the same instance.
From a security perspective, you then have only to deal with logins and users: not permissions per schema or whatever in one big database.
Note that SQL Server will balance resources across all database per instance fairly effectively: not all databases will be in use at the same time so memory etc will be allocated to need. You lose this advantage with multiple instances.

What is the best way to configure a SQL Server for 50 developers?

If I am running an organization that has 50 .net developers and all are using SQL Server, what is the best way to make a single SQL Server available to them?
Here is some of the concerns that I want to be careful about
Should I configure database users per project or per user? or both?
Should I provide single SQL Server instance?
Edit:
How can I track changes done by each user in database?
There are some more concerns but I think getting answer of these two will be a good starting point.
You should definitely configure a database per project, as only project specific items should be in that database. Also for backup and restore purposes a database per project will be a good idea.
Configuring databases for your developers depends on how many developers will actually develop for the database: create tables, views etc. Database developers should probably have some sort of test copy of the database they can use to develop their end of things, while the 'regular' developers work against a published copy of this database:
So a setup could be: 2 databases per project, one for db development and one for other development.
This way changes to the database scheme can first be developed and tested before pushed out to the rest of the developers.

Resources