C
C#4mo ago
Doggy

Connecting multiple computers with C#? How?

It's my first time creating an Inventory Management System that involves multiple computers (3 computers to be exact) Are there any things that I should look out for? And how do you even implement these type of systems? I don't have any experience in creating a system that involves 2 users. I have tried asking my Professors but they have just told me vague stuffs that really sound correct but I don't have any idea how I should do it. If someone can help me, thank you! Requirements (that I perceive): - There is going to be a master database that the system is latched onto - When Computer A inputs something, Computer B and C gets it too. - When the internet goes off for Computer A, Computer B and C are still functional and then when the internet is restored Computer A gets the changes automatically - When the internet goes off for Computer A, Computer A can still be used (like saving data) and once the internet/connectivity goes back online sends the data to master database automatically. Kindly point me to resources that you think are worth looking out for. Thank you very much!
8 Replies
Keswiik
Keswiik4mo ago
First off, what level of course is this for? What you're wanting sounds like some kind of service where the clients have their own cache of data for downtime events, which isn't something I'd expect in anything but a fairly high level / advanced program.
Doggy
DoggyOP4mo ago
I'm a Computer Science student currently in 3rd year. We are required to find actual businesses or clients and create business software for them so that I can pass the course Is what I'm tasked to do is hard?
Keswiik
Keswiik4mo ago
Difficult for someone that has never built a system that involves more than one user for sure. Not impossible or anything, and if you have a good amount of time to work on the project it can definitely be done, but you'll likely be out of your comfort zone for a while.
Doggy
DoggyOP4mo ago
I'm given until December I think I can do it, I just don't know where to start my experience is just simple CRUD systems in C# and that's pretty much it If possible can you point me to things that would help me?
Keswiik
Keswiik4mo ago
What kind of crud stuff have you worked on? Mostly in regards to frameworks / technologies you're familiar with.
Doggy
DoggyOP4mo ago
in C# specifically I have created Library Management Systems and the such like account registration, posting of books, borrowing of books sort of thing
Keswiik
Keswiik4mo ago
For starters, you probably don't want your different client systems communicating directly with one another. You'd want them connecting to some form of centralized service which handles your normal CRUD logic, account registration, etc. This central service would then be responsible for keeping all clients up-to-date with one another. From there it gets difficult to give any specific advice because there are a ton of ways you could build a system like this. For example, the clients could have their own local SQLite database they write to which can be used as a failover cache system when you detect you've been disconnected from your services, including some kind of event-based storage so you can 'replay' local changes to your primary server when you come back online. Note that you would still need a way to synchronize events from the server TO the client as well. Other computers may have made inventory changes while one was disconnected.
TizzyT
TizzyT4mo ago
1) That master database sounds like it IS the thing you are making. 2) Sure each computer (node) can have a list of every other node and duplicate any transaction to the other nodes directly, or you can send it to one node and have that node relay that transaction to the next nodes. Look into how Ripv1 vs Ripv2 works for example. 3+4) This part is a little tricky. You will have to determine how transactions are automatically handled during conflicts. Will the transaction which comes first take precedence, or will the one with most nodes endorsing it take precedence? Imagine a bank, an account has 100 bucks. NodeA gets disconnected from the internet but locally there is a withdraw of 60 dollars. Then it reconnects being informed that a $50 withdraw was made after the $60 withdraw but before NodeA came back online. Do you nullify the $50 withdraws, correct it (how?), set balance to -10? In this scenario it maybe obvious what to do but it entirely depends on the data you working with.
Want results from more Discord servers?
Add your server