Course: ADSD - Intro to SOA
July 1st, 2022
(free src: https://learn.particular.net/courses/take/SOA/lessons/1517272-it-ops-service )
Course: Advanced Distributed System Design - Udi Dahan
ToC
1) SOA tenets
2) Service example
_) Q&A (no notes, not in free src)
4) Services modelling: Workflows, boundaries and business capabilities
5) UI composition and Branding service
6) IT/Ops service
related:
Service Boundaries, SOA vs DDD - DDDEU2021 Session: Service Boundaries - Tjen Wellens
1) SOA Tenets
Microsoft original "tenets of SO"
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/37abd456-76ce-4d82-9d0a-edbecc5d954a/954aeb51f4db1313165901539d8d844a/screenshot.png)
1. autonomous
2. explicit boundaries
3. share contract & schema not class or type (or anything, or db)
4. interaction controlled by policy
1+2 = "encapsulation is a good idea"
whatever is on the inside, is sufficiently rich, to do meaningful, stuff by itself
4= interaction policy
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/0a27b7b7-d514-44b5-bf01-640692c2ff30/d691296a801f302aafd2cabf70a5443b/screenshot.png)
Udi: What is a service
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/c24a2ffb-d0e5-4c78-a993-fc5db6572dba/02c68da0a2597d2fcd195bb83f09519c/screenshot.png)
A service is the technical authority for a specific business capability
All data and business rules reside within the service
[alignment with business]
Nothing is "left over"
Everything must be in some service
---
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/18cb8264-a5e9-44d5-8f13-814b7d648616/5662151a7c583bc597863bb016b46ba7/screenshot.png)
wrapping a DB in REST does not change it's responsibility
2) Service example
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/07409d7d-9b58-4e8c-98df-1715d98b11f2/2bf8326ac64b826fd7a981113ff5e417/screenshot.png)
services are in the logical view
---
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/5ff8f658-1c1e-46ea-b80c-a83685b541aa/7c46fe56aaafe6b690a2c3a77f1bbecb/screenshot.png)
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/fe8bed6f-bd61-461c-bae7-6ebc9bf96666/fb199c14c1e47b500211bca49bf27225/screenshot.png)
4) Services modelling: Workflows, boundaries and business capabilities
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/681430f5-c720-4c31-9a44-b4c8cb806b5e/95e4e0c674a4a2b905f73f5eefd9f38d/screenshot.png)
service boundary = business capability
why not a lot of services?
-> because each service spans multiple system boundaries
-> team needs skills for each system
system boundaries =
- mobile
- backend
- portal
What code is left, if each service took it's code out?
-> lego green foundation board
-> not much else
---
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/79e6608d-0cda-457d-ac08-15d8430d7234/70bd13abd8aa16460541018d53c1591a/screenshot.png)
Sales: OrderSold
"what data goes in the event?"
parent-record pointing to the children
- orderId
- shippingId (assumes no digital goods)
- credit-card id (assumes no cash-on-delivery / bitcoin)
alternative: children point to the parent
when is orderId created? (eg. proceed to checkout)
How to share orderId? (eg. session state)
Sales: OrderReceived
- orderId
Billing: CustomerBilled
- orderId Yyy
Shipping: OrderShipped
- orderId
=> less data has to be passed between services
---
A service owns a piece of data
- across system boundaries
=> in a given service, there will be multiple technologies
team per service? cross functional team
5) UI composition and Branding service
https://learn.particular.net/courses/take/SOA/lessons/1517270-ui-composition-and-branding-service
so we have "something-like-widgets in the UI that a service owns"
but there are common elements
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/f51af78e-7b3e-420e-b2be-924a42142f4c/dc750b19c637acd18a58d6abc991f777/screenshot.png)
Branding Service
"we want all of our communications to be consistent and on brand"
price service does not care about the color or font it is presented
View Models
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/438fc448-8cdc-435f-ac2d-6f6bfc7276c3/2148a4d03a0907e8a449d2dffb3b5607/screenshot.png)
Whatever.js "the latest new"
spectrum of solutions
- simple css classes
- ...
- fullblown ViewModel
Complex solution: (grid of info)
Traditional ViewModel:
List<ProductInfo> {name,price,stock}
SOA-friendly ViewModel
Dict<product_id, name>
Dict<product_id, price>
Dict<product_id, inventory>
Branding Service
"is it in the middle column?"
"is it in blue or green?"
Simpler solution: css class
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/9ca1a68f-2de5-4c59-9f67-8a9bfc1b9d12/58e6f595861681c6d0cffbe075b3d6d0/screenshot.png)
---
Q: how does the client get it's data?
A: request response is allowed within the service boundary
via IT/Ops?
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/0ec8c398-1448-49da-bcd7-1cd944c35dd3/c2514296844e898ad6018e5645d68f6e/screenshot.png)
---
Branding is coupled to how the data is presented
try to keep branding as passive/neutral as possible
---
Who owns the workflow / page flow / url flow
every service: "is this a url I need to act on"
traditional routing:
- uri_a = controller_a
- uri_b = controller_b
soa routing
each service: "these are my controllers, those are the URIs I need to be registered for"
sample code
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/6a969d17-dd00-40cc-b8f1-6970e96d7431/5fb462d07a53c439f1be4341c227cddf/screenshot.png)
https://github.com/Particular/Workshop
---
Q: How can I see my changes
- debug / view
A: requires a deeper investment in build
run with all dependencies, but with your latest local changes
6) IT/Ops service
"technological glue"
"keeping the information flowing and secure across the enterprise"
phyisical config
- which server
- connection string to db
- error queue
auth
- sign in
- users permissions
- impersonation
which ORM?
IT/Ops decision
which MessageQueue tech
Logging
---
design services so there is no direct dependency on the actual infrastructure
---
authentication
be careful to keep business rules out of IT/Ops
"given a user is authenticated, are they allowed to access system A or system B"
- ITOps - basic level authentication
- ITOps - basic level can they access system A or system B
- BusinessRule - Is the user allowed to transfer money out of this account
careful of centralized identity management solution that contains info of who can do which action on which entity, roles like account owner
"once moved from generic roles to entity specific, you've gone too far"
---
also: IT/Ops does integration
![no description for image available](http://images.ctfassets.net/p2rtto0i6kcn/9d4af166-ee5b-4072-803b-881d48986571/d447fb7c89f0d1eaca0b32599d2c9a40/screenshot.png)
This post was referenced in: