This document discusses microservices and how to build them using Go. It describes the benefits of microservices over monolithic architectures, such as improved scalability, resilience, and ease of deployment. Some key aspects of building microservices with Go that are covered include making services autonomous and focused, using a domain-driven design, implementing service discovery, API gateways, and messaging between services using events. The document also provides guidance on important operational concerns like security, monitoring, and testing when building microservices applications.
5. Monolithic Architecture drawbacks
● Huge code base
● Hard to manage
● Difficult Continuous Integration
● Difficult application Scaling
● And so on...
10. Building Microservices in GO
● Business Domain Centric
● Build a Great Wall of China. Protect Stuff with security.
● See no evil, hear no evil
● Discover your services
● Gateway your watchman
● Messaging/events
● Think serverless architecture
12. Business Domain Centric
● Automated deployment
o Also good for monolith applications
● Exposure to other systems
o Endpoints
● Provisioned storage
● If any
● Scalability and load balance
o Depending on resiliency requirements
o double-up the infrastructure & load balance service
Clients
Micro service
13. Protect your stuff
● Service Accessibility(Authentication)
o OAuth, Goauth2
● Authorization
o ACL, JWT etc.
Clients
Micro service Micro service
Authentication
14. See no evil, hear no evil
● While Monitoring you need tools like
o Aggregating logs are difficult for 100 of
microservices Logger
● Performance Monitoring
o Easy for single service
o What about if many?
Clients
Micro service
Logging
Performance
Auth Micro
service
Authentication
16. Discover your services
● Service Registry
o Search your services
● Abstract the registry
o A new component
● Help identifying decommissioned services
● Versioning
● Help in preparing dependency graph
Clients
Authentication
Micro
service
LoggingPerformance
Auth Micro
service
Service
Discovery
Micro
service
18. Gateway your watchman
● Generalized security
● Performance Metrics cloud be
● recorded for all requests
● Auditing
● Request Transformation
● Routing & Combination
Clients
API Gateway
Authentication
Micro
service
LoggingPerformance
Auth Micro
service
Service
Discovery
Micro
service
19. Events
● Task Scheduling
o Simple by dropping events
● Subscribe for specific events
o Your message handler becomes
simple microservice
● Expose your subscribe functionality
to external Clients to handle
various notifications
Clients
API Gateway
Authentication
Micro
service
Logging
Performanc
e
Auth Micro
service
Service
Discovery
Micro
service
Events
Queue
20. Think serverless architecture
● Standardize your microservices
● Focus on your processing routine not on writing microservices always
● FaaS
● Reduce cost
● Easy to scale independent services triggered to action by events