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

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

 

Udi: What is a service

no description for image available

 

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

wrapping a DB in REST does not change it's responsibility

 



2) Service example

 

no description for image available

services are in the logical view

 

---

 

no description for image available

 

no description for image available

 

 

 



4) Services modelling: Workflows, boundaries and business capabilities

https://learn.particular.net/courses/take/SOA/lessons/1517267-services-modelling-workflows-boundaries-and-business-capabilities

 

no description for image available

 

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

 

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

 

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

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

 

---

 

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

 

---

 

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

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