Part 3
discussed microservices. This one focuses on maintainability, performance, and
security. The maintainability of microservices is somewhat different from
conventional software. When the software is finished, it is handed over to the
maintenance team. This model is not
favored for microservices. Instead, a common practice for microservices
development is for the owning team to continue owning it for its lifecycle.
This idea is inspired by Amazon’s “you build it, you run it” philosophy.
Developers working daily with their software and communicating with their
customers creates a feedback loop for the improvement of the microservice.
Microservices suffer a weakness in their performance in that
the communication happens over a network. Microservices often send requests to
one another. The performance is dependent on these external request-responses.
If a microservice has well-defined bounded contexts, it will experience less
performance hit. The issues related to microservice connectivity can be
mitigated in two ways – making less frequent and more batched calls as well as
converting the calls to be asynchronous. Parallel requests can be issued for
asynchronous calls and the performance hit is that of the slowest call.
Microservices have the same security vulnerabilities as any
other distributed software. Microservices can always be targeted for
denial-of-service attack. Some endpoint protection, rate limits and retries can
be included with the microservices. Requests and responses can be encrypted so
that the data is never in the clear. If the “east-west” security cannot be
guaranteed, at least the edge facing microservices must be protected with a
firewall or a proxy or a load balancer or some such combination. East-West
security refers to the notion that the land connects the east and the west
whereas the oceans are external. Another significant security concern is that a
monolithic software can be broken down into many microservices which can
increase the surface area significantly. It is best to perform threat modeling
of each microservice independently. Threat modeling can be done with STRIDE as
an example. It is an acronym for the following: Spoofing Identity – is the
threat when a user can impersonate another user. Tampering with data- is the
threat when a user can access resources or modify the contents of security
artifacts. Repudiation – is the threat when a user can perform an illegal
action that the microservice cannot deter. Information Disclosure – is the
threat when, say a guest user can access resources as if the guest was the
owner. Denial of service – is the threat when say a crucial component in the
operations of the microservice is overwhelmed by requests so that others
experience outage. Elevation of privilege – is the threat when the user has
gained access to the components within the trust boundary and the system is
therefore compromised.
Migration of microservices comes with three challenges:
multitenancy, statefulness and data consistency. The best way to address these
challenges involves removing statefulness from migrated legacy code,
implementing multitenancy, and paying increased attention to data consistency.
No comments:
Post a Comment