Difference in speed if website and database on same/different server - database

Are there any difference in database connection speed (initial DB connection request, queries, etc.) at all if:
A. Website and database are on the same server. Basically host is localhost.
B. Website is on Server I and database is on Server II. Website will access database via remote IP address.
Actual speed test will really help.

It depends on the connection between the Servers. A connection within localhost is normally faster because you're staying on the same system and no request or connection has to go through the network.

Related

How to pull data from an AWS hosted DB to on-prem or Azure SQL DB

How do I make connection to an AWS hosted database, and pull or query data into a local or Azure hosted SQL server DB? Can I be directed to the right place or resource?
Thanks.
There's nothing special about the fact that they're in AWS or Azure VMs. For this to work, you need TCP/IP connectivity from your client to the server, and you need port 1433 to not be blocked along the way.
The VM in AWS or Azure needs to have an externally visible IP address, or you need to be connecting via a VPN to the internal network of the cloud-hosted system. The operating system on that VM that's hosting SQL Server needs to have a firewall rule that allows port 1433 inbound.
Once you can do that, you can then just set up a Linked Server on your end, that refers to the SQL Server at the other end. That will allow you to query the tables on the server via 4 part names i.e. linkedservername.databasename.schemaname.tablename.
If you have SQL Server with the same collation at both ends, also ensure you set "collation compatible" on the linked server configuration. (It can make a huge performance difference)

REMOTE ACCESS FROM ONE PLACE TO ANOTHER MS SQL SERVER

I have try to remote access from one computer to another within LAN connection. However, thru these days research a lot of the article said I need to do port forwarding. But I think in my country ISP has block this setting, I can even find the option in my router webpage.
Is there any other way to remotely access the ms sql server thru internet?
This is networking protocol. But you can do it using Remote Desktop Connection locally as long as you have an access to that particular Server.
Check the Firewall also to your server.
Another option is, you can access it remotely using TEAM VIEWER

Connecting to oracle database using connection on another server

we have oracle database hosted at a third party location. we can only access that database from one server on our network. the third party only allowed access to the database from that server. our web apps are hosted on a different server and there is no way that we can open connection to the database from the web server. is there a way that we can use the allowed server to access the database from the web server which resides on the same network, kind of a centralized connection hub
As a practice industry wise . From Web-Server access to the database is not allowed from security point of view . Consult your network team by sending the ping of the IP address of the database server from web server . The result will show what is happening between web server and database server

Azure AWS Db Connection

I’m having a very specific issue with Azure and I couldn’t find any solution on the web.
So, we are little by little migrating our client’s infrastructure to Azure and we are starting with our Workers (webjobs).
These webjobs need to consume data present on a AWS SQL Server instance.
We already have checked that the App Service Plan’s Outbound IPs are whitelisted and that the SQL server is listening on TCP port 1433.
An evidence of that is the fact that we are able to communicate with the SQL Server instance through the Azure Debug Console:
But when we run the WebApp, the worker cannot find and connect to the same DB:
Does anyone have a clue of how I can solve this issue? It would be very appreciated!
Well, as you demonstrated by the first image, the SQL Server instance is configured correctly.
The worker Outbound IP address is definetely the same as the App Service Plan's machine.
Based on that, can you then please check if the Connection string you are setting have 'tcp:' before the IP Address?
Sometimes you need to force it, otherwise IIS can choose other ways to connect to your SQL server (like UDP for instance).

How to Access Database hosted on localhost sql server 2008r2 by another computer in LAN

I created a windows form application in which I used an SQL server database.
It is working fine on my computer. Now I want to run this application on another computer that is connected with LAN with my computer.
The problem is both application must share the same database. I don't want to host my database online.
Please tell me how to access the same database from different computers by using LAN or another technique.
You will have to set up the SQL server to allow access from within the LAN.
You may also have to set up the firewall on your server to allow access to the SQL server port(s), usually 1433 1434 for MS SQL server.
Then point your application on the client machines to the server's IP address within your lan. Usually something like 192.168.xxx.xxx
Find the folder where your DB files are. SHARE that folder to 'Everyone' in network.
Turn*Off* Windows Firewall (this can be a problem sometimes when it's turned on).
Be sure that your second PC has the same ConnectionString (ServerName, ex. //PC-NAME/SQLEXPRESS) and is watching into your 'server' computer (PC with database on it).

Resources