Is it possible to apply to different computers simultaneously performing CRUD?

Asked

Viewed 150 times

0

I am creating an application in C# using Visualstudio 2015 Enterprise together with SQL Server 2016 to save the data, but I’m almost done with the project and I still don’t know if it will actually work!

I need to install this application on different computers from the same workplace (same network), where everyone used the application at the same time and performed CRUD operations on it simultaneously between computers.

My question is this, is there a possibility of making that happen? some other language that is more suitable as Java or other database like Mysql, I have no problems with the development but I can’t find anything related to how to make this connection between the applications on different computers with 1 single database!

  • 4

    You’re at the Stackoverflow in Portuguese, if you do not translate your question, it will be closed. | You’re in Stackoverflow in Portuguese, if you don’t Translate your Question, it’ll be closed.

  • The database manages all the competition, you just need to point the application to the same database, whether SQL Server or Mysql.

  • Levino, I see no problems with your approach and the choice of technologies, and I believe that your application will work properly after you deploy, but if you decide to change the technologies used (cost of the DBMS license or support linux users), I advise you to take a look at Electron and Posgresql and go away from Java and Mysql.

2 answers

5

Its scenario is one of the most common in software development (mainly commercial and business). Basically, it is composed of an SGDB (Database Manager System) and machines that will access this database through a software (developed by you).

There is absolutely no problem in multiple machines accessing the database simultaneously. Note that databases are largely designed to accept many simultaneous connections.

For this reason, the bank needs to provide mechanisms to deal with the inevitable competition. The most important mechanism within this context is the Transaction.

The four pillars of a transaction are Atomicity, Consistency, Isolation and Durability (ACID). Isolation is what ensures that one transaction cannot change one data while another is changing the same data. The bank uses locking mechanisms to ensure this.

Obviously, it is the role of the programmer to establish when a transaction begins and when it ends. Therefore, although the database has several features to ensure the consistency of the data, if the programmer does not know how to use them well, then surely you will have a headache.

  • Thank you very much Cantoni, I’m really having these kinds of problems because I programmed using Visual Studio 2008 in 2012, from 2008 pro 2015 changed a lot, also had no difficulties in using C#, where my comfort zone is java, thank you so much by the way, now I’ll go in the right direction!

3

If you need to use CRUD on multiple devices, you can do using a bank or a file (.txt for example). But if you really need to access the same data from multiple devices simultaneously search on RUNNING CONDITION.

It’s a common problem and many frameworks already foresee this problem. Also search on semaphores and mutex (Mutual Exclusion - mutual exclusion).

  • 4

    No need to answer in English, since the site is aimed at those who speak the Portuguese language.

  • Thank you I will research more on race condition, I corrected and I wrote again in Portuguese, I didn’t realize I was in pt.stack...

  • 2

    If I understand the author’s question correctly, I think it is more appropriate to search about transactions (transactions) in the SQL Server database.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.