How to query multiple databases from different SQL Servers - sql-server

We have approx. 8 odd SQL Servers used for different purposes like inserting data in 1 server, update in another etc. (or connecting to only that database based on user’s region).
The problem is sometimes query for data needs to be done from multiple SQL Server databases. So say, I have an Id property, and based on the Id data needs to be retrieved from multiple of these 8 servers (if there is an Id match, so basically querying all database).
So basically the server which the user is logged into, will use “Linked Server” functionality and connect to other SQL Servers (with the server which the user is currently on acts as the source SQL Server), and using “UNION” functionality to club all data.
As a lot of transactions is taking place each day, this approach is not feasible, performance wise.
So any recommendations on a better approach to achieve the same above functionality. I read a concept called “Server Groups” but not sure of it.
The application is made in .Net Web Forms using Jquery/Ajax/HTML/API and ADO.NET.

If you have a .net application which is outside these 8 servers can't you establish individual connections and pass the ID from .net app to these servers ?
As far as I know "Server Group" is a concept in SSMS which helps you to group the servers and can run common scripts at same time.

Related

Share Access 2016 Data Over the Internet

We have an Access 2016 database with lots of tables, forms and reports from a client. The client would like other people to access the data in this database but doesn't want to spend the money to convert the forms and reports to a website. They would rather have Access 2016 as a frontend with it's forms and reports and store the data in a centralized location. The issue is the users who will access this data won't be on the same LAN or network.
The solution I came up with was to use SQL Azure as the database backend and keep the forms and reports in the Access 2016 database frontend. Can anyone think of an alternative? Does Microsoft have some kind of online hosting with Office 365? I have nothing at all against SQL Server and use it frequently but just don't want to go through the effort of upsizing the database when a simpler solution existed.
You can certainly place the back end on SQL Azure. However given that a typical internet connection is about 100 times slower, then MUCH effort is required to optimize the application. So you need significant experience on how to optimize an Access application to work with SQL server. This setup is thus doable, but will take significant amounts of work to achieve decent performance.
Another possible solution is to use a SharePoint or office 365 back end (which supports SharePoint tables). This setup only works well if table’s sizes are in general below 5000 records. You also have to ensure all table relations are standard auto number PK and child tables use a standard long number column to relate back to the parent table.
Likely the best solution is to setup a server and run remote desktop. This gives the best performance, and the end users don’t need to install access nor your front end part.
I explain in detail the “slowness” with using SQL server over the internet in this article of mine along with some suggestions and possible solutions.
http://www.kallal.ca//Wan/Wans.html

Concentrating multiple MS SQL Servers into one

I have an interesting SQL challenge. I have multiple satellite (potentially in the 100s) of MS SQL express Servers that I need to concentrate into one central SQL Server. The satellite servers are basically logging transactions that occur, basically the usage of a material at a particular time. The central SQL Server will be used for reporting summary reports (e.g the amount of material used per day etc), rather than holding the full data set from each machine. I have a couple of ideas in mind of how to do this (using linked servers on the central server with a view on each satellite server is one, and a SQL task that periodically refreshes the data ). What I am not sure is how would that scale up when I am using multiple satellite servers, what would be the best solution performance wise ?
You can simply use the linked server queries. (format: server_name.database_name.schema_name.table_name)
Since your expectation is only to generate summary reports, you can create the required view / procedure definitions inside this one central SQL server without storing the data from different servers into it.

Performance of SQL Server vs number of databases

Does the number of databases on a SQL Server installation affect performance ?
Lets say I have a multi-tenant application, I have the option of creating a database per tenant or having management table based client table separation or configuration based client table separation.
For 10 clients who are accessing the application, the number of queries are going to be the same regardless of whether I have 10 separate databases or one database.
So does it matter or is there a benefit implementing this one way or the other ?

Multi tenancy - MongoDB vs SQL Server Express

Based on our requirement we need to have one database per account as we cannot have a single database. So we were thinking about multiple database on the SQL Server and based on my research we can have appx 32,000 database on single database instance but the resource limit will be reached far sooner.
How many is too many databases on SQL Server?
Another point was to use no-sql database like MongoDB. As far as I know we can create database per account with different database name.
I wanted to check reference to resources used by MongoDB, do I need more ram, processor and lots of servers for the architecture.
We are looking to have about 10,000 databases max on a server. Can that work on the a single mongodb server?
If you do have similar architecture currently running, please do share.

WPF with arbitrary, unknown databases - Client/Server or Desktop app?

My company is planning to turn an older Winforms application into a WPF/Silverlight Client/Server app.
The idea of having a small server app is to have a list of the accessible data bases combined with the user type that may access each of the databases, instead of having to manage databases in each client's admin control. Additionally, it would be great if the SQL request would be handled by the server which would then return the result.
The app is supposed to work on a arbitrary set of databases which will be "registered" with the server and users get a list of databases according to their authentication rights. They can then do practically everything on those databases what one can imagine. The system should be able to handle up to 2 million rows.
The databases are very different, there can be many of them, they can be MS Access, Oracle, SQL Server etc., so no way for me to specify them all before. On top of that, communication with a SQLite cache is needed.
I already have everything I need for the SQL queries from the Winforms app.
I was thinking:
1) A simple WCF server specifying in a config file the available databases per user type.
2) Interface that specifies all necessary SQL queries that can be made to the server.
3) Client...
The idea is:
a client-server application, where the client uses WCF services to execute SQL queries (INSERT, UPDATE, SELECT, etc.) on tables by invoking services methods.
The service should ideally be consumable for both the WPF and the Silverlight app.
Is that the way to go? Which exisiting technologies might I want to make use of regarding formats, communication, services etc.
If that is problematic, I would consider going back to a desktop app, but then how to ease the user type/database access problem for each client?
I would stick with ADO.NET and start with the DbProviderFactory class. This will let you determine the proper database access based on information supplied by the provider using the Factory Design Pattern. So instead of having to create a specialized objects for each database type and database, you can abstract that logic with the DbProviderFactory.
Here's a link that shows some examples: http://msdn.microsoft.com/en-us/library/wda6c36e(v=VS.100).aspx

Resources