71
margarine dissection alex brandt sr developer wayne walls cloud evangelist Wednesday, August 21, 13

Butter Web Browsing with Margarine

Embed Size (px)

Citation preview

Page 1: Butter Web Browsing with Margarine

margarine dissection

alex brandtsr developer

wayne wallscloud evangelist

Wednesday, August 21, 13

Page 2: Butter Web Browsing with Margarine

2

WHAT IS MARGARINE?

Wednesday, August 21, 13

Page 3: Butter Web Browsing with Margarine

3

3 PARTS

Wednesday, August 21, 13

Page 4: Butter Web Browsing with Margarine

4

BLEND

TINGE

SPREAD

Wednesday, August 21, 13

Page 5: Butter Web Browsing with Margarine

5

BLEND

TINGE

SPREAD

Wednesday, August 21, 13

Page 6: Butter Web Browsing with Margarine

6

BLEND

TINGE

SPREAD

Wednesday, August 21, 13

Page 7: Butter Web Browsing with Margarine

7

WHAT DO WE CARE ABOUT?

Wednesday, August 21, 13

Page 8: Butter Web Browsing with Margarine

8

SIMPLICITY!

Wednesday, August 21, 13

Page 9: Butter Web Browsing with Margarine

9

DESIGN DISCLAIMER

Wednesday, August 21, 13

Page 10: Butter Web Browsing with Margarine

10

LB

FRONT END API

MQ

CONSUMER

LB

KEY/VALUESTORE

DOCUMENTSTORE

INTERNET

Routing

•Topic

•users

•articles

•Fanout

•article.sanitize

•article.references

Consumers

•create user

•password user

•article reference

•email user

•create article

•article sanitize

OBJECTSTORE

Wednesday, August 21, 13

Page 11: Butter Web Browsing with Margarine

11

BUT WHAT DOES IT ALL MEAN?!

Wednesday, August 21, 13

Page 12: Butter Web Browsing with Margarine

12

DATA TIER

Wednesday, August 21, 13

Page 13: Butter Web Browsing with Margarine

13

WHAT KIND OF DATA DO WE NEED TO STORE?

Wednesday, August 21, 13

Page 14: Butter Web Browsing with Margarine

14

Content of ArticlesUser Information / ProfilesSubscriptions by UsersTags by UsersNotations for Margin Notes

Wednesday, August 21, 13

Page 15: Butter Web Browsing with Margarine

15

Content of ArticlesUser Information / ProfilesSubscriptions by UsersTags by UsersNotations for Margin Notes

Wednesday, August 21, 13

Page 16: Butter Web Browsing with Margarine

16

Content of ArticlesUser Information / ProfilesSubscriptions by UsersTags by UsersNotations for Margin Notes

Wednesday, August 21, 13

Page 17: Butter Web Browsing with Margarine

17

Content of ArticlesUser Information / ProfilesSubscriptions by UsersTags by UsersNotations for Margin Notes

Wednesday, August 21, 13

Page 18: Butter Web Browsing with Margarine

18

Content of ArticlesUser Information / ProfilesSubscriptions by UsersTags by UsersNotations for Margin Notes

Wednesday, August 21, 13

Page 19: Butter Web Browsing with Margarine

19

DATA TIER DECISIONS

Wednesday, August 21, 13

Page 20: Butter Web Browsing with Margarine

20

Where to Store the DataHow to Organize the DataHow to Manage UsersAPI Strategy

Wednesday, August 21, 13

Page 21: Butter Web Browsing with Margarine

21

Where to Store the DataHow to Organize the DataHow to Manage UsersAPI Strategy

Wednesday, August 21, 13

Page 22: Butter Web Browsing with Margarine

Data Schema

•articles• url

• text

• tags-index

• notations

• location

• note

• votes

• created_at-index

• etag

• parsed_at

•users• username-unique index

• email

• name

• hash (md5)

22

•subscribers• uuid4-user

• uuid4-bookmark

• subscribed_at

Wednesday, August 21, 13

Page 23: Butter Web Browsing with Margarine

23

Where to Store the DataHow to Organize the DataHow to Manage UsersAPI Strategy

Wednesday, August 21, 13

Page 24: Butter Web Browsing with Margarine

24

Where to Store the DataHow to Organize the DataHow to Manage UsersAPI Strategy

Wednesday, August 21, 13

Page 25: Butter Web Browsing with Margarine

25

APPLICATION TIER

Wednesday, August 21, 13

Page 26: Butter Web Browsing with Margarine

26

APPLICATION TIER ACTION!

Wednesday, August 21, 13

Page 27: Butter Web Browsing with Margarine

27

CRUD OPERATIONS FOR USERSCRUD OPERATIONS FOR ARTICLES

ADVANCED OPERATIONS FOR USERS & ARTICLES

Wednesday, August 21, 13

Page 28: Butter Web Browsing with Margarine

28

CRUD OPERATIONS FOR USERSCRUD OPERATIONS FOR ARTICLES

ADVANCED OPERATIONS FOR USERS & ARTICLES

Wednesday, August 21, 13

Page 29: Butter Web Browsing with Margarine

29

CRUD OPERATIONS FOR USERSCRUD OPERATIONS FOR ARTICLES

ADVANCED OPERATIONS FOR USERS & ARTICLES

Wednesday, August 21, 13

Page 30: Butter Web Browsing with Margarine

30

APPLICATION TIER DECISIONS

Wednesday, August 21, 13

Page 31: Butter Web Browsing with Margarine

31

HOW IS DATA PROCESSED?WHERE IS DATA PROCESSED?

Wednesday, August 21, 13

Page 32: Butter Web Browsing with Margarine

32

CRUD OPERATIONS FOR USERSCRUD OPERATIONS FOR ARTICLES

ADVANCED OPERATIONS FOR USERS & ARTICLES

Wednesday, August 21, 13

Page 33: Butter Web Browsing with Margarine

33

A LOT OF WORK HERE...

Wednesday, August 21, 13

Page 34: Butter Web Browsing with Margarine

34

SPLIT THE APPLICATION TIER!

Wednesday, August 21, 13

Page 35: Butter Web Browsing with Margarine

34

SPLIT THE APPLICATION TIER!

BLEND SPREAD

Wednesday, August 21, 13

Page 36: Butter Web Browsing with Margarine

35

ADVANCED OPERATIONS FOR USERS ADVANCED OPERATIONS FOR ARTICLES

CRUD OPERATIONS FOR USERSCRUD OPERATIONS FOR ARTICLES

BLEND

SPREAD

Wednesday, August 21, 13

Page 37: Butter Web Browsing with Margarine

36

HOW DOES ONE SPLIT THE APPLICATION TIER?

Wednesday, August 21, 13

Page 38: Butter Web Browsing with Margarine

37

MESSAGE QUEUE, BUT WHICH?

Wednesday, August 21, 13

Page 39: Butter Web Browsing with Margarine

38

NOW THAT WE HAVE THAT FIGURED OUT

Wednesday, August 21, 13

Page 40: Butter Web Browsing with Margarine

39

BLEND

SPREAD

CRUD OPERATIONS FOR USERSCRUD OPERATIONS FOR ARTICLES

ADVANCED OPERATIONS FOR USERS ADVANCED OPERATIONS FOR ARTICLES

RabbitMQ

Wednesday, August 21, 13

Page 41: Butter Web Browsing with Margarine

40

BLEND

SEVEN CONSUMER/WORKER SERVICES

Create  Ar(cleUpdate  References  Sani(ze  HTMLCreate  UserUpdate  UserPassword  E-­‐mailPassword  Change

Wednesday, August 21, 13

Page 42: Butter Web Browsing with Margarine

41

BLEND

SPREAD

CRUD OPERATIONS FOR USERSCRUD OPERATIONS FOR ARTICLES

ADVANCED OPERATIONS FOR USERS ADVANCED OPERATIONS FOR ARTICLES

RabbitMQ

Wednesday, August 21, 13

Page 43: Butter Web Browsing with Margarine

42

WEB TIER

Wednesday, August 21, 13

Page 44: Butter Web Browsing with Margarine

43

WHAT ARE WE SERVING OUR CUSTOMERS?

Wednesday, August 21, 13

Page 45: Butter Web Browsing with Margarine

44

WEB PORTAL FOR...

Wednesday, August 21, 13

Page 46: Butter Web Browsing with Margarine

44

WEB PORTAL FOR...

Logins

Wednesday, August 21, 13

Page 47: Butter Web Browsing with Margarine

44

WEB PORTAL FOR...

LoginsPassword Resets

Wednesday, August 21, 13

Page 48: Butter Web Browsing with Margarine

44

WEB PORTAL FOR...

LoginsPassword ResetsViewing and Tagging of Articles 

Wednesday, August 21, 13

Page 49: Butter Web Browsing with Margarine

44

WEB PORTAL FOR...

LoginsPassword ResetsViewing and Tagging of Articles Submission of Articles

Wednesday, August 21, 13

Page 50: Butter Web Browsing with Margarine

45

WEB TIER DECISIONS

Wednesday, August 21, 13

Page 51: Butter Web Browsing with Margarine

46

OPERATING SYSTEM / STACKDATASTORE SOLUTION

LOAD BALANCINGDNS

CONTENT DELIVERY

Wednesday, August 21, 13

Page 52: Butter Web Browsing with Margarine

47

Ubuntu 12.04python; python-flask

nginx in front of uWSGI

Wednesday, August 21, 13

Page 53: Butter Web Browsing with Margarine

48

OPERATING SYSTEM / STACKDATASTORE SOLUTION

LOAD BALANCINGDNS

CONTENT DELIVERY

Wednesday, August 21, 13

Page 54: Butter Web Browsing with Margarine

49

CloudFiles as Key/Value StoreObjectRocket as Document Store

Exceptional.io Redis2Go as Key/Value Store

Wednesday, August 21, 13

Page 55: Butter Web Browsing with Margarine

50

CloudFiles as Key/Value StoreObjectRocket as Document Store

Exceptional.io Redis2Go as Key/Value Store

Wednesday, August 21, 13

Page 56: Butter Web Browsing with Margarine

51

CloudFiles as Key/Value StoreObjectRocket as DocumentStore

Exceptional.io Redis2Go as Key/Value Store

Wednesday, August 21, 13

Page 57: Butter Web Browsing with Margarine

52

OPERATING SYSTEM / STACKDATASTORE SOLUTION

LOAD BALANCINGDNS

CONTENT DELIVERY

Wednesday, August 21, 13

Page 58: Butter Web Browsing with Margarine

53

RACKSPACE

Wednesday, August 21, 13

Page 59: Butter Web Browsing with Margarine

54

OPERATING SYSTEM / STACKDATASTORE SOLUTION

LOAD BALANCINGDNS

CONTENT DELIVERY

Wednesday, August 21, 13

Page 60: Butter Web Browsing with Margarine

55

Wednesday, August 21, 13

Page 61: Butter Web Browsing with Margarine

56

OPERATING SYSTEM / STACKDATASTORE SOLUTION

LOAD BALANCINGDNS

CONTENT DELIVERY

Wednesday, August 21, 13

Page 62: Butter Web Browsing with Margarine

57

Tinge to CloudFilesSEO Management

Wednesday, August 21, 13

Page 63: Butter Web Browsing with Margarine

58

Tinge to CloudFilesSEO Management

Wednesday, August 21, 13

Page 64: Butter Web Browsing with Margarine

59

CANONICAL ARCHITECTUREWITH PILLARS

Wednesday, August 21, 13

Page 65: Butter Web Browsing with Margarine

LB

FRONT END API

MQ

CONSUMER

LB

KEY/VALUESTORE

DOCUMENTSTORE

INTERNET

Routing

•Topic

•users

•articles

•Fanout

•article.sanitize

•article.references

Consumers

•create user

•password user

•article reference

•email user

•create article

•article sanitize

OBJECTSTORE

Wednesday, August 21, 13

Page 66: Butter Web Browsing with Margarine

LB

FRONT END API

MQ

CONSUMER

LB

KEY/VALUESTORE

DOCUMENTSTORE

INTERNET

Routing

•Topic

•users

•articles

•Fanout

•article.sanitize

•article.references

Consumers

•create user

•password user

•article reference

•email user

•create article

•article sanitize

OBJECTSTORE Parallel

Modular

Horizontally scalable

Agile

Secure

Wednesday, August 21, 13

Page 67: Butter Web Browsing with Margarine

LB

FRONT END API

MQ

CONSUMER

LB

KEY/VALUESTORE

DOCUMENTSTORE

INTERNET

Routing

•Topic

•users

•articles

•Fanout

•article.sanitize

•article.references

Consumers

•create user

•password user

•article reference

•email user

•create article

•article sanitize

OBJECTSTORE Parallel

Modular

Horizontally scalable

Agile

Secure

Wednesday, August 21, 13

Page 68: Butter Web Browsing with Margarine

LB

FRONT END API

MQ

CONSUMER

LB

KEY/VALUESTORE

DOCUMENTSTORE

INTERNET

Routing

•Topic

•users

•articles

•Fanout

•article.sanitize

•article.references

Consumers

•create user

•password user

•article reference

•email user

•create article

•article sanitize

OBJECTSTORE Parallel

Modular

Horizontally scalable

Agile

Secure

Wednesday, August 21, 13

Page 69: Butter Web Browsing with Margarine

LB

FRONT END API

MQ

CONSUMER

LB

KEY/VALUESTORE

DOCUMENTSTORE

INTERNET

Routing

•Topic

•users

•articles

•Fanout

•article.sanitize

•article.references

Consumers

•create user

•password user

•article reference

•email user

•create article

•article sanitize

OBJECTSTORE Parallel

Modular

Horizontally scalable

Agile

Secure

Wednesday, August 21, 13

Page 70: Butter Web Browsing with Margarine

KEY/VALUESTORE

OBJECTSTORE

LB

FRONT END API

MQ

CONSUMER

LB

DOCUMENTSTORE

INTERNET

Routing

•Topic

•users

•articles

•Fanout

•article.sanitize

•article.references

Consumers

•create user

•password user

•article reference

•email user

•create article

•article sanitize

Parallel

Modular

Horizontally scalable

Agile

Secure

Wednesday, August 21, 13

Page 71: Butter Web Browsing with Margarine

66

https://github.com/raxsavvy/margarine

Contribute

Wednesday, August 21, 13