Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a web service?

Could someone please explain to me in a simple way, what is a web service?

Please correct me if I'm wrong. I have a DB hosted somewhere in the web, and I want to perform DB transactions from a desktop application as well as a mobile application. Can this be done through a web service ? Someone mentioned it to me and I wanted to make sure this could happen.

like image 382
app_dev89 Avatar asked Dec 27 '22 06:12

app_dev89


2 Answers

Here's a good explanation on Wikipedia.

A middle dynamic content processing and generation level application server, for example Ruby on Rails, Java EE, ASP.NET, PHP, ColdFusion platform

The middle tier of a 3-tier application is often the web service

i want to perform DB transactions from a desktop application and a mobile application, can this be done through a web service ?

This is Exactly what a web service is for.

A web service allow you to create multiple front ends if needed, and serve your database data to all of those front ends. You can also open up the API and allow third party developers to access the web service and thereby access the data of your application in a controlled environment.

It's considered a better practice for larger applications to access a web service or a middle tier rather than directly access the database.

like image 156
Chase Florell Avatar answered Jan 12 '23 02:01

Chase Florell


In your case, a web service would involve setting up your DB behind a web server that listens for incoming requests, performs the appropriate DB operations, and returns whatever data is appropriate. Then, your desktop and mobile applications could send a http request and the DB would respond appropriately. This would let all your applications access the same DB.

like image 36
Retief Avatar answered Jan 12 '23 02:01

Retief