These are the ten major challenges of Microservices architecture and proposed solutions:
1)Data Synchronization: We have event sourcing
architecture to address this issue using the async messaging platform. The
SAGA design pattern can address this challenge.
2)Security: An API Gateway can solve these challenges. Kong is very
popular and is open-source, and is being used by many companies in
production. Custom solutions can also be developed for API security using
JWT token, Spring Security, and Netflix Zuul/ Zuul2.
There are enterprise solutions available, too, like
Apigee and Okta (2-step authentication).
Openshift is used for public cloud
security for its top features, like Red Hat Linux Kernel-based security and
namespace-based app-to-app security.
3)Services Communication: It’s complex to communicate between
microservices. There are different ways to communicate - Point to point
using API Gateway and pub/sub-event-driven model.
4)Discovery: This will be addressed by API discovery tools like
Kubernetes orchestration, Pivotal Application Services (PAS), container
services (PKS) and OpenShift.
It can also be done using Netflix Eureka at the code level. However, doing
it with the orchestration layer will be better and can be managed by these
tools rather than doing and maintaining it through
code and configuration.
5) Data Staleness: The database should be always updated to give
recent
data. The API will fetch data from the recent and updated database.
A timestamp entry can also be added with each record in the database to
check and verify the recent data. Caching can be used and customized with
an acceptable eviction policy based on business requirements.
6)Distributed Logging, Cyclic Dependencies of Services, and Debugging :
There are multiple solutions for this.
Externalized logging can be used by pushing log messages to an async
messaging platforms like Kafka, Google PubSub, Built-in Kibana dashboard
of OpenShift PAAS solution, which reads console logs from the container and
aggregate in its ElasticSearch persistence on the server, It's persisted
even
when POD is crashed and restarted, etc.
It's difficult to identify issues between microservices when services are
dependent on each other and they have a cyclic dependency. Correlation ID
can be provided by the client in the header to REST APIs to track the
relevant logs across all the pods/Docker containers.
7)Testing: This issue can be addressed with unit testing by mocking
REST APIs or integrated/dependent APIs which are not available for testing
using WireMock, BDD, Cucumber, integration testing, performance testing
using JMeter, and any good profiling tool like Jprofiler, DynaTrace,
YourToolKit, VisualVM, etc.
8)Monitoring & Performance: Monitoring can be done using
opensource
tools like Prometheus in combination with Grafana by creating
gauge and matrices, GCP StackDriver, Kubernetes/OpensShift, Influx DB,
combined with Grafana, Dynatrace, Amazon CloudWatch, VisualVM,
JProfiler, YourToolKit, Graphite, etc.
Tracing can be done by the latest Open tracing project or Uber's open-source
source Jaeger. It will trace all microservices communication and show
requests/response, and errors on its dashboard.
9)DevOps Support: Microservices deployment and support-related
challenges can be addressed using state-of-the-art DevOps tools like GCP,
Kubernetes, OpenShift, and PCF with Jenkins.
10)Fault Tolerance: Netflix Hystrix can be used to break the
circuit if
there is no response from the API for the given SLA/ETA and provide a
mechanism to re-try and graceful shutdown services without any data loss.
For Microservices design patterns: https://skolaparthi.com/microservices-design-patterns/
Wow nice article
ReplyDeleteValuable information.thanks
ReplyDeleteThis article contains lot of valueble information regarding micro services. Saves time. Keep it up!
ReplyDelete