+ All Categories
Home > Documents > Event Store and Web Applications Greg Young @gregyoung.

Event Store and Web Applications Greg Young @gregyoung.

Date post: 13-Jan-2016
Category:
Upload: carmel-henry
View: 221 times
Download: 0 times
Share this document with a friend
Popular Tags:
65
Event Store and Web Applications Greg Young @gregyoung
Transcript

Event Store and Web Applications

Greg Young @gregyoung

Purchase Order

Line Items (n)

Shipping Information

Cart Created

3 Items Added

Shipping Information

Added

Purchase OrderAddItemCommand

ChangeAddressCommand

AddItemCommandAddItemCommand

Cart Created

3 Items Added

1Item Removed

Shipping Information

Added

6

5

4

3

2

1

7

5

snap

4

3

2

1

6

A single model cannot be appropriate for reporting, searching, and transactional

behaviors…

Focus on strategic design first.

There is no “best” storage.

Focus on strategic design first.

A single data model is almost never appropriate.3+ is common!

Focus on strategic design first.

Focus on strategic design first.

Id ParentId Data

1 0 Parent

2 1 Child1

3 1 Child2

Focus on strategic design first.

Id ParentId0 ParentId1 ParentId2 ParentId3 ParentId4 Data

1 0 0 0 0 0 Parent

2 1 0 0 0 0 Child1

3 1 2 0 0 0 Child2

Wrong models cause massive accidental complexity

Client

Domain

Bus

OLAP

GraphDb

StreamProcessing

publish

3nf

Hibernate

Client

Domain

Bus

OLAP

GraphDb

StreamProcessing

publish

3nf

Hibernate

Client

Domain

Bus

OLAP

GraphDb

StreamProcessing

publish

3nf

Hibernate

New Model?

Client

Domain

OLAP

GraphDb

StreamProcessing

Events

Client

Domain

OLAP

GraphDb

StreamProcessing

Events

New Model

Client

Client

Client

Events

ClientAny Producer

All streams are Atom Feeds

Atom feeds seem inefficient, are they?

Get Head of Stream

Get Head of Stream

Reply with first/last links

<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <title>Event stream 'newstream'</title> <id>http://127.0.0.1:2113/streams/newstream</id> <updated>2013-06-29T14:45:06.550308Z</updated> <author> <name>EventStore</name> </author> <link href="http://127.0.0.1:2113/streams/newstream" rel="self" /> <link href="http://127.0.0.1:2113/streams/newstream/head/backward/20" rel="first" /> <link href="http://127.0.0.1:2113/streams/newstream/0/forward/20" rel="last" /> <link href="http://127.0.0.1:2113/streams/newstream/1/forward/20" rel="previous" /> <link href="http://127.0.0.1:2113/streams/newstream/metadata" rel="metadata" />

Get Head of Stream

Reply with first/last links

Get Document with Links

Get Head of Stream

Reply with first/last links

Get Document with Links

Reply Document with Links to Events

<entry> <title>0@newstream</title> <id>http://127.0.0.1:2113/streams/newstream/0</id> <updated>2013-06-29T14:45:06.550308Z</updated> <author> <name>EventStore</name> </author> <summary>event-type</summary> <link href="http://127.0.0.1:2113/streams/newstream/0" rel="edit" /> <link href="http://127.0.0.1:2113/streams/newstream/0" rel="alternate" /></entry><entry> <title>1@newstream</title> <id>http://127.0.0.1:2113/streams/newstream/1</id> <updated>2013-06-29T14:45:06.550308Z</updated> <author> <name>EventStore</name> </author> <summary>event-type</summary> <link href="http://127.0.0.1:2113/streams/newstream/1" rel="edit" /> <link href="http://127.0.0.1:2113/streams/newstream/1" rel="alternate" /></entry>

Get Head of Stream

Reply with first/last links

Get Document with Links

Reply Document with Links to Events

Get /streams/foo/events/1

Get Head of Stream

Reply with first/last links

Get Document with Links

Reply Document with Links to Events

Get /streams/foo/events/1

Reply Document with Links to Events

Get Head of Stream

Reply with first/last links

Get Document with Links

Reply Document with Links to Events

Get /streams/foo/events/1

Get /streams/foo/events/2

Reply Document with Links to Events

Get Head of Stream

Reply with first/last links

Get Document with Links

Reply Document with Links to Events

Get /streams/foo/events/1

Get /streams/foo/events/2

Reply Document with Links to Events

Reply Document with Links to Events

Much is forgotten here.

Http KeepAlives

Http Pipelining

Intermediaries!

Content Type Negotiation!

Get Head of Stream

Get Head of Stream

Reply with first/last links

Get Head of Stream

Reply with first/last links

Get Document with Links

Reply Document with Links to Events

Get Head of Stream

Reply with first/last links

Get Document with Links

Reply Document with Links to Events

Get /streams/foo/events/1

Get /streams/foo/events/2

Accept: app/json

Accept: app/xml

Get Head of Stream

Reply with first/last links

Get Document with Links

Reply Document with Links to Events

Get /streams/foo/events/1

Get /streams/foo/events/2

Reply Document with Links to Events

Reply Document with Links to Events

Accept: app/json

Accept: app/xml

ContentType: app/json

ContentType: app/xml

ES-LongPoll: 30

Client

Client

Client

Events

ClientAny Producer

Client

Client

Client

Eventsua

ClientAny Producer

Nginx nyc

Nginx vno

{ rewritePattern : “/mystuff/{stream}/{event}}

Acceptsecurity_summary

Accept:security_detail

Accept:security_raw

Events

Security Master

Security Handler

Acceptsecurity_summary

Accept:security_detail

Accept:security_raw

Events

Security Master

Security Handler

Accept:security_detail2?

Browser

Events

Browser

Validate

IndexDb IndexDb

AtomPub

Browser

Events

Browser

Validate

IndexDb IndexDb

AtomPub

Browser

Events

Browser

Validate

IndexDb IndexDb

AtomPub

Browser

Events

Browser

Validate

IndexDb IndexDb

AtomPub

Browser

Events

Validate

IndexDb

AtomPub

Browser

Events

Validate

IndexDb

AtomPub

A single model cannot be appropriate for reporting, searching, and transactional

behaviors…

Atom feeds are efficient on a massive scale

There is no “best” storage.

Event Store is BSD-3 OSS

Questions?


Recommended