Slide 1

Slide 1 text

Introduction to Event-Driven Architectures with Apache Kafka on Heroku Tuesday, November 7th, 2017

Slide 2

Slide 2 text

Forward-Looking Statements Statement under the Private Securities Litigation Reform Act of 1995 This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Slide 3

Slide 3 text

I know what event-driven architecture means. I’ve built event-driven architecture. I’ve used Apache Kafka.

Slide 4

Slide 4 text

Chief Technology Officer Heroku Developer Advocate Chris Castle @ryantownsend [email protected] @crc [email protected] Ryan Townsend

Slide 5

Slide 5 text

“Data is the new oil” “Data is the new oil.” Clive Humby, Architect of Tesco’s Clubcard, 2006 “Personal data is the new oil of the internet” Meglena Kuneva, European Consumer Commissioner, 2009 “Data is the new oil” Ann Winblad, Senior Partner at Hummer-Winblad, 2012 “The difference between oil and data is that the product of oil does not generate more oil (unfortunately), whereas the product of data will generate more data”
 Piero Scaruffi, cognitive scientist and author of “History of Silicon Valley”, 2016 “Data is the new oil. The companies that will win are using math.”
 Kevin Plank, founder and CEO of Under Armour, 2016 “Data is the new oil.”
 Richard Titus, CEO AND, 2010 “We’re able to view just everything that they do. [...] Data is the new oil.”
 Bill Diggins, CEO Diggit, 2012 “I want you to think about data as the next natural resource.”
 Virginia Rometty, IBM CEO, 2013 “Information is the oil of the 21st century”
 Peter Sondergaard, SVP Gartner, 2011 “Data is going to be the natural resource for this industrial revolution.” Abhishek Mehta, CEO Tresata, 2013 Source: https://www.quora.com/Who-should-get-credit-for-the-quote-data-is-the-new-oil

Slide 6

Slide 6 text

Have your cake and eat it

Slide 7

Slide 7 text

What we’re going to talk about • What is event-driven architecture? • What are the benefits? • What are the downsides? • What is Apache Kafka? • Why use Heroku Kafka? • Use cases & live demos!

Slide 8

Slide 8 text

What is event-driven architecture?

Slide 9

Slide 9 text

What is event-driven architecture?

Slide 10

Slide 10 text

What is event-driven architecture? Event happens ‑
 State changes

Slide 11

Slide 11 text

What is event-driven architecture? I buy something from you ‑ My bank account goes down, yours goes up

Slide 12

Slide 12 text

What is event-driven architecture? Product views Completed sales Page visits Site logins Shipping notifications Inventory received IoT data Weather data Traffic data Tweets Election polling data Tweet!

Slide 13

Slide 13 text

What is event-driven architecture? If this is the way the world works, why don’t we model data like this?

Slide 14

Slide 14 text

What is event-driven architecture? Instead we take “snapshots” of state at arbitrary intervals and store that as rows in a database.

Slide 15

Slide 15 text

What is event-driven architecture? And we normally dump the event data.

Slide 16

Slide 16 text

What is event-driven architecture? What if we kept the event data?

Slide 17

Slide 17 text

What is event-driven architecture? What if we used that event data as a store of state?

Slide 18

Slide 18 text

What is event-driven architecture? What if we used an immutable, time- ordered sequence of events as our primary store of state?

Slide 19

Slide 19 text

Benefits of event-driven architecture

Slide 20

Slide 20 text

Benefits of event-driven architecture Build a better product

Slide 21

Slide 21 text

Benefits of event-driven architecture Item Quantity Pixel 2 1 Cart Items

Slide 22

Slide 22 text

Benefits of event-driven architecture Type Parameters Added Item To Cart Item: iPhone X, Quantity: 1 Changed Item Quantity Item: iPhone X, Quantity: 2 Removed Item From Cart Item: iPhone X Added Item To Cart Item: Pixel 2, Quantity: 2 Changed Item Quantity Item: Pixel 2, Quantity: 1 Events

Slide 23

Slide 23 text

Benefits of event-driven architecture Natural audit logging

Slide 24

Slide 24 text

Benefits of event-driven architecture Fix state, not just bugs

Slide 25

Slide 25 text

Benefits of event-driven architecture Item Quantity iPhone X 2 Pixel 2 1 Cart Items

Slide 26

Slide 26 text

Benefits of event-driven architecture Item Quantity iPhone X 2 Pixel 2 1 Carts Type Parameters Added Item To Cart Item: iPhone X, Quantity: 1 Changed Item Quantity Item: iPhone X, Quantity: 2 Removed Item From Cart Item: iPhone X Added Item To Cart Item: Pixel 2, Quantity: 2 Changed Item Quantity Item: Pixel 2, Quantity: 1 Events Cart Items

Slide 27

Slide 27 text

Benefits of event-driven architecture Item Quantity Pixel 2 1 Carts Type Parameters Added Item To Cart Item: iPhone X, Quantity: 1 Changed Item Quantity Item: iPhone X, Quantity: 2 Removed Item From Cart Item: iPhone X Added Item To Cart Item: Pixel 2, Quantity: 2 Changed Item Quantity Item: Pixel 2, Quantity: 1 Events Cart Items

Slide 28

Slide 28 text

Benefits of event-driven architecture Untangle integrations

Slide 29

Slide 29 text

Benefits of event-driven architecture ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ Point-to-point Integrations

Slide 30

Slide 30 text

Benefits of event-driven architecture ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ Event Stream

Slide 31

Slide 31 text

Benefits of event-driven architecture De-risk launches

Slide 32

Slide 32 text

Benefits of event-driven architecture ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫ ⚫

Slide 33

Slide 33 text

Downsides of event-driven architecture

Slide 34

Slide 34 text

Downsides of event-driven architecture Asynchronicity and eventual consistency ⏲

Slide 35

Slide 35 text

Downsides of event-driven architecture All corrections need events ✏

Slide 36

Slide 36 text

Downsides of event-driven architecture Replaying must factor in external systems

Slide 37

Slide 37 text

Downsides of event-driven architecture Doesn’t always play well with traditional CRUD applications

Slide 38

Slide 38 text

Downsides of event-driven architecture Demand on storage*
 
 * this is misnomer

Slide 39

Slide 39 text

What is Apache Kafka?

Slide 40

Slide 40 text

What is Apache Kafka?

Slide 41

Slide 41 text

What is Apache Kafka? “Distributed commit log” open-sourced by LinkedIn Fault-tolerant and robust Guaranteed at-least-once delivery Chronological ordering (within partitions) Asynchronous pull-based event consumption Topics for granular event access Kafka 1.0 last week ⏰ ⬇ ↔

Slide 42

Slide 42 text

Why Apache Kafka on Heroku?

Slide 43

Slide 43 text

Why Apache Kafka on Heroku? Instant provisioning High-availability out-of-the-box Multi-tenant Kafka plans from $100/mo Really easy to share between your applications Thoughtful developer experience ⚡ ↔

Slide 44

Slide 44 text

Use Case: Stream Processing

Slide 45

Slide 45 text

Stream Processing Filter Map Aggregate Sort

Slide 46

Slide 46 text

Stream Processing: Waterfall of Events

Slide 47

Slide 47 text

Stream Processing: Analytics Dashboard

Slide 48

Slide 48 text

Use Case: CQRS and Event Sourcing

Slide 49

Slide 49 text

Command Query Responsibility Segregation (CQRS) ❗ ❓ alters reads Command Query State

Slide 50

Slide 50 text

CQRS with Event Sourcing ❗ ❓ generates reads Command Query State Events alter

Slide 51

Slide 51 text

https://df17.herokuapp.com/

Slide 52

Slide 52 text

Some sort of mind blowing conclusion! (this has been left intentionally as the original)
 
 Real conclusion: there are so many uses of EDA, you need to play around with it to see how it’ll fit your specific needs, so just give it a go!

Slide 53

Slide 53 text

Ryan Townsend CTO, Shift Commerce [email protected] @ryantownsend [email protected] @crc Chris Castle Heroku Developer Advocate