Yogen Darji
Yogen Darji

Reputation: 3300

project of file storage system in asp.net how to implement correctly?

on upload.aspx page i have conn1.ConnectionString = "Data Source=.\ip-of-remote-database-server;AttachDbFilename=signup.mdf;Integrated Security=True;User Instance=True";

and all the queries are also on same page ,only database on another machine..

so is this the correct way of implementing ?? or i have to create all queries on another machine and call them by application??

Upvotes: 0

Views: 102

Answers (2)

Branko Dimitrijevic
Branko Dimitrijevic

Reputation: 52107

Any given query query might originate from the client code (such as ASP.NET), or it might be stored a-priori in the DBMS itself as a VIEW or a stored procedure (or even a trigger).

But no matter where it originated from, the query is always executed by the DBMS server. This way, the DBMS can guarantee the integrity of data and "defend" itself from the bugs in the client code.

The logical separation of client and server is why this model is called client/server, but that doesn't mean they must be separate physical machines - you'll decide that based on expected workload1 and usage patterns2.


1 Distributing the processing to multiple machines might increase performance.

2 E.g. you might need several "fat" clients around the LAN (communicating with the same database server) to reach all your users. This is less relevant for Web where there are additional layers of indirection between users and the database.

Upvotes: 1

Piotr Stapp
Piotr Stapp

Reputation: 19830

It depends on your infrastructure. If you have got Sql Server locally you can use it. I assume that it is a school project so it does not matter. In real life it usually a good idea to separate web server and database server

Upvotes: 0

Related Questions