Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Different programming models develop different mental models

Different programming models develop different mental models

An expansion on "How to authenticate a user without a username, password or database", I share how learning different programming models and paradigms has helped me solve problems more effectively in my main programming language – in this case, learning the unique programming model of Erlang. With a fun demo to boot.

Presentation at Abstractions II (abstractions.io) in September 2019, in Pittsburgh, USA.

Simon van Dyk

August 21, 2019
Tweet

More Decks by Simon van Dyk

Other Decks in Programming

Transcript

  1. “A developers main responsibility is to defend and maintain the

    conceptual integrity of the codebase.” – Aslam Khan
  2. Claim Verify Store How would you do identity claim? a.

    Don’t be silly, just use OAuth b. Gait analysis c. Use their face d. Security is a lie
  3. Claim Verify Store How would you do identity claim? a.

    Don’t be silly, just use OAuth b. Gait analysis c. Use their face d. Security is a lie
  4. Claim Verify Store How would you do identity verification? a.

    Obviously a blood test b. OAuth, you will be assimilated c. Send them an OTP d. Fingerprint or retinal scan
  5. Claim Verify Store How would you do identity verification? a.

    Obviously a blood test b. OAuth, you will be assimilated c. Send them an OTP d. Fingerprint or retinal scan
  6. Claim Verify Store How would you do identity storage? a.

    Throw it in a file - that’s not a database is it? b. Mechanical turk: an army of humans write it out on paper c. Machine learning serverless blockchain™ d. Keep it in memory and never let the server die
  7. Claim Verify Store How would you do identity storage? a.

    Throw it in a file - that’s not a database is it? b. Mechanical turk: an army of humans write it out on paper c. Machine learning serverless blockchain™ d. Keep it in memory and never let the server die
  8. Claim Verify Store Facial recognition One time pin Memory storage

    Slack’s “magic links” or an OTP sent to an email address Erlang process storing face to email mapping in memory Face to email mapping used to identify a user
  9. Nada Faces API Nada App AWS Rekognition Sign up AWS

    S3 { selfie } { face_id } { email selfie } Claim { email face_id } Store { otp } Verify
  10. Nada Faces API Nada App AWS Rekognition Log in AWS

    S3 { selfie } { face_id } { email face_id } Store { otp } Verify { selfie } Claim
  11. Claim Verify Store Face to email mapping used to identify

    a user Facial recognition # @ Face Face ID Email Image
  12. Claim Verify Store One time pin Slack’s “magic links” or

    an OTP sent to an email address [email protected] [email protected] thisappdoesnothing.com/djtufy TO FROM
  13. Claim Verify Store One time pin Slack’s “magic links” or

    an OTP sent to an email address SUCCESS!
  14. Claim Verify Store Memory storage Erlang process storing face to

    email mapping in memory Erlang VM Web server process Agent process ...
  15. Claim Verify Store Memory storage Erlang process storing face to

    email mapping in memory Erlang VM Web server process “a7j3hgdg”: “[email protected]” “jmd739sh”: “[email protected]
  16. 2019 Today 1986 33 years
 ago 2011 ~8 years ago

    24 years ago 1995 12 years ago 2007
  17. Programming Models “Everything is an object” “Everything is a function”

    “Everything is a process” Ruby JavaScript Elixir
  18. Erlang data stores • Mnesia • ETS (Erlang Term Storage)

    • Process state (GenServer/Agent) • *Riak
  19. • Are there relationships between the data you store? •

    Are you storing time-related data? • Do you need to be able to look at the database in the past? How do you intend to query the data?
  20. • Data + relationships • Relationships between data (graph) •

    Simple store-retrieve • Mapping (Key-Value) • Data stored over time • Changes as facts stored over time (immutable database) Typical data storage options by query