I have a Windows Application in C#. This application interacts with a remote mySQL database. Should I create a PHP web service to do these (insert/add/delete/update) or use mySQL connector for c#? I’m not sure which way is better.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Wether the MySQL server is in the same network (phisically) or not. From my point of view the according solution would be to create a dedicated Web-Service that provides you the CRUD functionality for your application.
This, because it gives you some Separation of Concerns (SoC) as you can separate business logic tier from the data access tier.
See also: Single Responsibility Principle | “In object-oriented programming, the single responsibility principle states that every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.”
Every part of your application serves a specific purpose which makes it easier to maintain over a big timespan.
Now this sounds pretty nice and cool, but do we really need to abstract everything away?
As with everything else, it depends.
Here is a little Use-Case:
What will you, as developer, need to do in order to keep your application working?
Using MySQLConnector:
Start “hacking” inside your source code and making sure all queries run as expected. And if something goes wrong during that process, it will be a pain to fix it because it’s all kind of nested within the application logic.
Using a dedicated Web-Service:
Just make sure your methods are updated to match the new database design | No need to change anything on the application-side [except method arguments in some cases].
Cheers