Showing posts with label SystemDesign. Show all posts
Showing posts with label SystemDesign. Show all posts

Wednesday, May 29, 2013

Workflow to send SMS on new emails

Workflow diagram

Workflow components

There are four components:
  1. mailcheck - checks for unread emails
  2. diffcheck - checks for differences between current and previous list
  3. sms - sends sms
  4. sup - configures sms, diffcheck and mailcheck

Workflow flow

The workflow goes like this:
  1. mailcheck goes and checks for unread emails every n seconds, bundles it into a list and sends it to the input stream for diffcheck
  2. diffcheck compares the current list of emails with the previous list of emails, determines which ones are new, bundles it into a list and sends that off to sms
  3. sms looks at the list of incoming data and sends to phone numbers associated with diffcheck
    • but nothing really happens cos we've not associated the name 'diffcheck' with anything
    • and the incoming data is just discarded
  4. sup sends a command to sms, associating the name 'diffcheck' with a phone number
    • now sms is configured to send out messages associated with 'diffcheck'

Status

Have got a very rough working version.

Areas to improve

  1. diffcheck should just pass-thru instead of polling, the name should also just passthru
    • so instead of send_out() we could call something like pass_thru()

Tuesday, May 28, 2013

Exception Handling Workflow

Exception Handling Workflow

The figure below shows my idea of handling exceptions, thanks to ideas by Rebecca J. Wirf-Brock[1].
Pardon the messy lines:


References:

  1. Toward Exception-Handling Best Practices and Patterns

Saturday, May 25, 2013

Designs that lasts are based on scientific/mathematical principles

Designs That Lasts

An utterly fascinating Google TechTalk entitled, Building brains that understand the world's data, proposes machine intelligence on the basis of neuroscience principles.

Another example would be relational database systems. These are built on top of Relational Algebra principles.

Here a rough outline of how to apply this idea:
  1. Study what a system that works exceptionally well
  2. Extract the principles/theory underlying how the system works
  3. Apply those principles/theory to the system you are building
Would be really interesting to get a listing of all the systems--underlying principles currently in use.

Or perhaps, as a start, identify all the systems are are working exceptionally well, e.g. the brain, ecosystem, innovative companies; then extract the principles.

And a reverse way to apply this idea is to start with the principles and work out what we can build using those principles.

Related Talks

A related talk on how the brain works is, Think Faster, Focus Better and Remember More - Rewiring Our Brain To Stay Younger