Solved

micro services vs rest web services

Posted on 2016-10-25
16
45 Views
Last Modified: 2016-11-28
Hi,

what are difference bewteen micro services vs rest web services . When we use which one along with SOAP webservices. How to learn more about these topics.Please advise
0
Comment
Question by:gudii9
  • 9
  • 5
  • 2
16 Comments
 
LVL 26

Accepted Solution

by:
dpearson earned 250 total points
Comment Utility
A rest web service mostly defines how the URLs for your site should behave - e.g.  if you are building an ecommerce site, you might have

GET: www.myurl.com/order/123    <- retrieve order
DELETE: www.myurl.com/order/123 <-- cancel this order

etc.

Microservices is more about the internal architecture of how the web site is built.  So you might have one module handling orders and another handling price lookup.  It's basically about dividing up the problem into small pieces internally.

So a REST interface is mostly a definition of how the web site behaves externally (to outside users)
While micro services is mostly about how a web site is built internally.

Hope that helps - I'm not about to explain both of these huge concepts in more detail.  This is just the difference between them.

Doug
0
 
LVL 24

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 250 total points
Comment Utility
Hi!

In short then microservices is a way to design application by using a number of services "instead of one tightly coupled monolith of code".  In some cases it can be easier to manage in development and deployment and REST is one of the form for these services to communicate.

Here are some articles on microservices and REST to look at
http://www.javaworld.com/article/2683277/architecture-scalability/what-microservices-architecture-really-means.html
https://capgemini.github.io/architecture/is-rest-best-microservices/

http://nordicapis.com/microservice-showdown-rest-vs-soap-vs-apache-thrift-and-why-it-matters/
http://microservices.io/patterns/microservices.html

Regards,
    Tomas Helgi
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility

GET: www.myurl.com/order/123    <- retrieve order
DELETE: www.myurl.com/order/123 <-- cancel this order

both above URLs seems same? what is the difference between retrieve and cancel here?
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility
any good video tutorials around these topics? please advise
0
 
LVL 24

Expert Comment

by:Tomas Helgi Johannsson
Comment Utility
0
 
LVL 26

Expert Comment

by:dpearson
Comment Utility
GET: www.myurl.com/order/123    <- retrieve order
DELETE: www.myurl.com/order/123 <-- cancel this order

both above URLs seems same? what is the difference between retrieve and cancel here?

Those are different "Verbs".  When you browse to a URL in your web browser, you are actually issuing a "GET" request.  But you can send others (not from your browser but in code).

Read more here:
http://www.restapitutorial.com/lessons/httpmethods.html

Doug
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility
GET: www.myurl.com/order/123

when you say VERBS above bolded part? does that consider as part of URL
usually url starts with www. or http:// etc right?
0
 
LVL 26

Expert Comment

by:dpearson
Comment Utility
The VERB isn't visible in the URL.

It's passed as part of the request (https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods)

The URL is the thing you are working with (the book in the library).
The verb is what you wish to do with that book (retrieve it, delete it, change it for another book).

Doug
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 7

Author Comment

by:gudii9
Comment Utility
GET: www.myurl.com/order/123    <- retrieve order
DELETE: www.myurl.com/order/123 <-- cancel this order

Open in new window


in above URLs where is the VERB?
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility
GET: www.myurl.com/order/123    <- retrieve order
DELETE: www.myurl.com/order/123 <-- cancel this order

how above two are different as GET and DELETE are not part of URLS?
0
 
LVL 26

Expert Comment

by:dpearson
Comment Utility
in above URLs where is the VERB?

Let me say it again, the verb is not in the URL.

An HTTP request (the thing your browser sends to a server) consists of more than just the URL.
Think of an HTTP request being a function call that is being made by the browser and sent all the way across the internet to a web server.

The parameters for that function call look like this:
sendRequest(Verb verb, String url) ;

The verb (e.g. "GET", "PUT") is sent separately from the URL.

The take home of all this is - if you don't understand HTTP verbs, best to avoid REST APIs.  Because it's based on those verbs.

Doug
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility
https://www.tutorialspoint.com/http/http_methods.htm

checking above link

GET Method
A GET request retrieves data from a web server by specifying parameters in the URL portion of the request. This is the main method used for document retrieval. The following example makes use of GET method to fetch hello.htm:

GET /hello.htm HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
The server response against the above GET request will be as follows:

HTTP/1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
ETag: "34aa387-d-1568eb00"
Vary: Authorization,Accept
Accept-Ranges: bytes
Content-Length: 88
Content-Type: text/html
Connection: Closed
<html>
<body>
<h1>Hello, World!</h1>
</body>
</html>

how to run above example to see request and response and the verb?
just create html page and which server i supposed to deploy?any end to end example on this? please advise
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility
http://www.tutorialspoint.com/hello.htm%20HTTP/1.1

when i gave as above(host+/hello.htm HTTP/1.1 ie GET part) i got 404 error
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility
if you don't understand HTTP verbs,

can you please point me to good resources and links on this to learn more on this. I feel i know GET, POST, PUT on high level but at deeper level it seems i do not know whole lot? please advise
0
 
LVL 26

Expert Comment

by:dpearson
Comment Utility
0
 
LVL 7

Author Comment

by:gudii9
Comment Utility
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
The task of choosing a web design company to build a website for your business should never be taken in a light manner. Provided the fact that your website will act as a representative to your business and will be responsible for imposing an online …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now