Transforming To Microservice
Transforming To Microservice
Microservices Architecture
May 2019
Ichsan Rahardianto
Technical Ops Lead at Brankas
[email protected]
https://www.linkedin.com/in/irahardianto/
@irahardianto
Agenda
PMO
Product Management
source: https://www.thoughtworks.com/insights/blog/case-continuous-delivery
Tens of Millions Deployment to All Environment
Team
Product Built by Independent Product Team
Integration
Test
image: golang:alpine
options:
Running Pipeline Example
Kubernetes
Communication
Protocols
Communication via JSON over HTTP
(better known as REST API)
ST
RE PI
A
REST
API
REST
API
T
RES
API
RE PI
ST
A
Communication via gRPC
PC
gR
gRPC
gRPC
C
gRP
gR
PC
What is gRPC
JSON vs Protobuf Contract
service HelloService {
rpc SayHello (HelloRequest) returns (HelloResponse);
}
{ message HelloRequest {
"greeting":"Hello", string greeting = 1;
"name":"John", string name = 2;
"age":32 int32 age = 3;
} }
message HelloResponse {
string reply = 1;
}
gRPC Advantages in Microservices Architecture
# Install Nginx.
RUN \
add-apt-repository -y ppa:nginx/stable && \
apt-get update && \
apt-get install -y nginx && \
rm -rf /var/lib/apt/lists/* && \
echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \
chown -R www-data:www-data /var/lib/nginx
# Expose ports.
EXPOSE 80
EXPOSE 443
Packing Your App as A Docker Image
# build stage
# final stage
FROM alpine
WORKDIR /app
COPY --from=build-env /src/goapp /app/
ENTRYPOINT ./goapp
Pod, Repl Set, Deployment
Services
Cluster IP
Load Balancer
Kubernetes Easily Take 5000 VM for a Single Cluster
Monitoring Using APM
Whats Next?