Module 5, 6 - Service and SOA concepts Flashcards
How to expose existing functionalities in monoliths
Expose functionalities by building standard interfaces API
Benefits of using standard interfaces
- Language and platform agnostic
- Applications less coupled with each other
- Enable data exchange among different applications and monoliths by using commonly used data format
Definition of a service
A unit that provides one or many functionalities needed to support business requirements and can be invoked by other applications or services over the network using a standard interface that is independent of programming languages and platforms
What is service provider interface/ service consumer interface
The Service Provider Interface and the Service Consumer Interface refer to some code that is at the provider and consumer end respectively and enables data exchange between the provider and the consumer.
What is the size of a service in an SOA
Each service can be small, simple, or large, complex
Assemblies in SOA
- Develop and maintain enterprise solutions as assemblies of loosely-coupled (micro)services
- Manage complex assemblies at different functionality and/or complexity layers
Pros of monolithic (5)
- Straightforward to develop in a single language and platform; communication may be mostly in a simple form of method calls
- Simple to test as tests for the self-contained app can run a single machine
- Simple to deploy each self-contained app
- Can scale up the whole app by running multiple copies behind a load balancer
- In early stages, it may work well (if its size and complexity are not too high)
Cons of monolithic (6)
- May become too large and complex for a developer to fully understand, and fixing bugs and implementing new features correctly becomes difficult and time consuming
- Slow down development; slow up start-up time
- Make continuous changes and deployment difficult: each change needs testing and redeployment of the whole app, which slows down change deployment
- Difficult to scale when modules in the whole app have conflicting deployment requirements
- A bug in one module can bring down the whole app
- Difficult to adopt new frameworks and languages
Pros of Microservice (8)
• Have a well-defined boundary in the form of language-neutral APIs (so as to make it easy to communicate with other apps/microservices implemented in different languages)
• Loosely coupled from each other
o Can be developed independently by different teams using different technologies
o Easier to change each microservice
o Can be deployed and scaled up independently
o Easier to re-deploy and scale up for different resource requirements
o Failure of one microservice is less likely to bring down the whole solution
o Can have own data store, easier to support polyglot persistence
o A higher level of modularity than monolithic apps
Cons of Microservice
• The name itself may put excessive emphasis on its size
o May use the “two-pizza team rule”
• Need to choose and implement an inter-process communication mechanism among microservices, which may be more troublesome than usual function calls; need extra code to handle possible communication failures
• May be a challenge on implementing business processes and transactions involving multiple entities across microservices
• Partitioned databases are at odds with an enterprise-wide common data model:
o The same kind of data may be represented in different / incompatible ways;
o May lead to duplicated or inconsistent data across microservices
o May need data transformers or adaptors
• Too many moving parts to keep track of