w10s1 MicroServices API
w10s1 MicroServices API
Johannes Sianipar
18 February 2021
Monolithic vs Microservice
Microservices
Chart 2
Monolithic vs Microservice
Microservices
Chart 3
What is API?
□ http://abc.com/search/pages/resu
lts/
Chart 4
Terms in API
■ HTTP (Hypertext Transfer Protocol) is the primary means of communicating data on the web.
□ HTTP implements a number of “methods,” which tell which direction data is moving and what
should happen to it.
□ The two most common are GET, which pulls data from a server, and POST, which pushes new
data to a server.
■ URL (Uniform Resource Locator) - An address for a resource on the web, such as
https://programminghistorian.org/about.
□ A URL consists of a protocol (http://), domain (programminghistorian.org), and optional path
(/about).
□ A URL describes the location of a specific resource, such as a web page.
□ When reading about APIs, you may see the terms URL, request, URI, or endpoint used to
describe adjacent ideas.
■ JSON (JavaScript Object Notation) is a text-based data storage format that is designed to be
easy to read for both humans and machines.
□ JSON is generally the most common format for returning data through an API, XML being the
second most common.
Microservices
■ REST (REpresentational State Transfer) is an architecture style for designing networked
applications.
□ REST vs SOAP (Simple Object Access Protocol)
□ APIs designed with some or all of these principles in mind are called REST APIs. Chart 5
Why API Gateway
Microservices
Chart 6
API Gateway
Microservices
Chart 7
API Gateway
Microservices
Chart 8
Security in API Gateway
Microservices
Chart 9
Service Registry
Microservices
Chart 10
Service Discovery
Microservices
Chart 11
Orchestration
Microservices
Chart 12
Load Balancing
Microservices
Chart 13
Microservices Framework
■ Java
□ Spring Boot, Dropwizard, Restlet, Spark
■ Python
□ Flask, Falcom, Bottle, Nameko, CherryPy
■ Node JS
■ .Net
Microservices
Chart 14
Microservices Framework
■ Java
□ Spring Boot, Dropwizard, Restlet, Spark
■ Python
□ Flask, Falcom, Bottle, Nameko, CherryPy
■ Node JS
■ .Net
Microservices
Chart 15
Basic Flask Code Example
import flask
app = flask.Flask(__name__)
app.config["DEBUG"] = True
@app.route('/', methods=['GET'])
def home():
return "<h1>Distant Reading Archive</h1><p>This site is a prototype
API for distant reading of science fiction novels.</p>"
Microservices
app.run()
Chart 16
Reference
■ https://www.globallogic.com/wp-content/uploads/2017/08/Microservice-
Architecture-API-Gateway-Considerations.pdf
■ https://www.ibm.com/cloud/architecture/architectures/microservices
■ https://programminghistorian.org/en/lessons/creating-apis-with-python-
and-flask#what-is-an-api
Microservices
Chart 17
Thank you
for your attention!
Johannes Sianipar