Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple Domains from Change #107

Open
Tracked by #109
Zhiyuan-Amos opened this issue Nov 9, 2021 · 0 comments
Open
Tracked by #109

Decouple Domains from Change #107

Zhiyuan-Amos opened this issue Nov 9, 2021 · 0 comments

Comments

@Zhiyuan-Amos
Copy link
Owner

Zhiyuan-Amos commented Nov 9, 2021

Create

flowchart TD
    subgraph Issue
    A((Function App)) --> |Write|B(Cosmos DB)
    B --> |Trigger|C(Change Feed)
    D(Change Feed Processor) --> |Read|C
    end
    subgraph Change
    D --> |Write|E(Queue)
    F(Queue Processor) --> |Read|E
    F --> |Write|G(Database)
    end
Loading

For Image, write to Image Outbox and use Change Feed Processor to implement Transactional Outbox pattern and write to

  1. Image
  2. Storage
  3. Change's Queue

Delete

flowchart TD
    subgraph Change
    A((Function App)) --> |Write|B(Cosmos DB)
    B --> |Trigger|C(Change Feed)
    D(Change Feed Processor) --> |Read|C
    end
    subgraph Issue
    D --> |Write|E(Event Grid)
    F(Event Grid Processor) --> |Read|E
    F --> |Delete|G(Database)
    end
Loading

For Image, apart from deleting from database, also delete from Storage

Notes

  1. Notice Create uses Queue while Delete uses Event Grid. See Events vs Messages for more information.
  2. AuthZ has to be updated - IssueScope, ImageScope, ChangeScope.
  3. GetImage & CreateChange are separate Function Apps, protected by Scopes that are not accessible by the Client. (find out how Functions can get the scopes to be authorized to call these other Functions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant