Slide 1

Slide 1 text

Issues with asynchronous interaction @gaar4ica
 Anna Shcherbinina

Slide 2

Slide 2 text

I like Ruby, Arch & Artec3D

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

Downtime? Never heard of…

Slide 5

Slide 5 text

Service Interaction Patterns

Slide 6

Slide 6 text

Interaction Patterns Asynchronous Request-Reply with Timeout

Slide 7

Slide 7 text

Interaction Patterns Asynchronous Request-Reply with a Notification Timer

Slide 8

Slide 8 text

Interaction Patterns One Request, Multiple Responses

Slide 9

Slide 9 text

Interaction Patterns One Request, Mandatory Response, and Optional Response

Slide 10

Slide 10 text

Interaction Patterns Subscription

Slide 11

Slide 11 text

Interaction Patterns Unsolicited Notification

Slide 12

Slide 12 text

Scaling from old time to now-days

Slide 13

Slide 13 text

Be ready for capacity

Slide 14

Slide 14 text

Axes of scale Split by Function, Service or Resource Horizontal duplication Lookups or Formulaic Splits

Slide 15

Slide 15 text

• What: Typically called horizontal scale, this is the duplication of services or databases to spread transaction load. • Why: Allows for fast scale of transactions at the cost of duplicated data and functionality. X-axis Clone things

Slide 16

Slide 16 text

• What: Sometimes referred to as scale through services or resources, focuses on scaling data sets, transactions and engineering teams. • Why: Allows for efficient scaling of not only transactions, but very large data sets associated with those transactions. Y-axis Split different

Slide 17

Slide 17 text

• What: This is very often a split by some unique aspect of the customer such as customer ID, name, geography and so on. • Why: Rapid customer growth exceeds other forms of data growth or you have the need to perform fault isolation between certain customer groups as you scale. Z-axis Split similar

Slide 18

Slide 18 text

What prevents us from successful scaling?

Slide 19

Slide 19 text

Stateless - is the common guide

Slide 20

Slide 20 text

Be ready for failure

Slide 21

Slide 21 text

Failure Monitoring Monitoring: • All server event logs; • Monitoring for proper updates; • Backup status; • Firewall activity, hack/spam relay attempts; • System bottlenecks (system processes, processor/ram utilisation, etc.); • Application services; • Real-time Inventory collection and web-based reporting; • Remote support for most issues.

Slide 22

Slide 22 text

Failure Monitoring Monitoring: • All server events; • Backup status; • Firewall activity, hack/spam relay attempts; • System bottlenecks • Application services.

Slide 23

Slide 23 text

Failure Log aggregation How to understand the behaviour of an application and troubleshoot problems? • All Use a centralised logging service that aggregates logs from each service instance. The users can search and analyse the logs. They can configure alerts that are triggered when certain messages appear in the logs.

Slide 24

Slide 24 text

Failure Distributed tracing

Slide 25

Slide 25 text

Failure Exception tracking How to understand the behaviour of an application and troubleshoot problems? • Report all exceptions to a centralised exception tracking service that aggregates and tracks exceptions and notifies developers.

Slide 26

Slide 26 text

Failure Learn from failure Leverage every failure to learn and teach important lessons

Slide 27

Slide 27 text

Failure QA • QA does not increase quality of your system; • QA decrease risks; • Use QA team to learn from past mistakes; • QA helps to decrease a number of repeated defects.

Slide 28

Slide 28 text

Failure Backups • Check your backups twice; • Store your backups away of your application; • Create backup for your backup.

Slide 29

Slide 29 text

Failure Deployment

Slide 30

Slide 30 text

Failure Deployment • Set up your deployment process to be ready for rollback; • Avoid irreversible releases; • Monitoring and metrics helps to measure and analyse result of the release; • Set up partial deployment.

Slide 31

Slide 31 text

Autoscaling

Slide 32

Slide 32 text

Autoscaling Monitoring • Monitoring is the key feature of autoscaling; • Metrics should be re-estimated once a quoter; • Use complex metrics to avoid wasting resources.

Slide 33

Slide 33 text

Autoscaling Dashboard example

Slide 34

Slide 34 text

Autoscaling Scale down • Top and bottom limits are vital to avoid money loss; • Do not forget to empty resources your app does not need anymore.

Slide 35

Slide 35 text

Interaction SPoF Single points of failure

Slide 36

Slide 36 text

Interaction SPoF Evolving application in it’s natural way

Slide 37

Slide 37 text

Interaction Interaction patterns

Slide 38

Slide 38 text

Be competent

Slide 39

Slide 39 text

Thank you https://twitter.com/gaar4ica https://github.com/gaar4ica Scalability Rules: 50 Principles for Scaling Web Sites (Martin L. Abbott, Michael T. Fisher) Practical Object-Oriented Design in Ruby (Sandi Metz) Eloquent Ruby (Russ Olsen) Ruby Performance Optimization: Why Ruby is Slow, and How to Fix It (Alexander Dymo) Design Patterns in Ruby (Russ Olsen) Implementing SOA: Total Architecture in Practice By Paul C. Brown http://microservices.io/patterns/