1 / 43

Web Servers, Data Stores FireBase Chat

Learn how to deploy and debug complex systems efficiently in this insightful video by MIT Prof. John R. Williams. Explore web servers, data stores, Firebase, AWS, and more. Enhance your architecture design skills and simplify complexities.

acollins
Download Presentation

Web Servers, Data Stores FireBase Chat

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web Servers, Data StoresFireBase Chat https://youtu.be/pXFMQAl6XBM

  2. AWS-On-Ramp MIT Prof John R Williams

  3. Complexity of Modern Systems How can we deploy at scale

  4. Dealing with Complexity Modules/Components Abstraction

  5. Design and Complexity

  6. Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.Brian Kernighan and P.J. Plauger, The Elements of Programming Style

  7. Architecture Capabilities • Loosely coupled architectures • Empowered teams

  8. Steve Jobs on Complexity<->Simplicity: http://design.activeside.net/why-designers-should-seek-complexity http://design.activeside.net/cyclic-and-linear-thinking

  9. In Class Exercises Web Server Browser • Express Web Server • Chat App • Quote App FireBaseDataStore Web Server Browser FireBaseDataStore

  10. Download files to your working directory from https://github.com/johntango/demoexpress

  11. NPM Node Package Manager • Allows you to manage thousands of libraries efficiently • 9 billion downloads last week !!! • Learn fast from the best

  12. package.json • npm init - creates file package.json • package.json – specifies how to build your app

  13. npm init - creates file package.json select defaults Except Author License

  14. Package.json

  15. npm install express This installs the “express” web server library and modifies package.json to include this step.

  16. Express installed

  17. Now write the app - server.js

  18. Now run in the command window >node server.js

  19. Now we are going to add ”routes” to our web serverhttp://localhost:3000/lucky ≈

  20. For debugging its sometimes useful to use curl to hit a Web Server eg from terminal we can typecurl http://localhost:3000/input/hello/methis will create parameters

  21. send and catch parameters Test using CURL

  22. Using curl to POST data curl -d '{"quote":”hello-earthline", "author":”john"}' -H "Content-Type: application/json" -X POST http://localhost:3000/input In App add the following “route” app.post('/input', function(req,res){ console.log(JSON.stringify(req.body)); res.send ({ quote : req.body.quote, author : req.body.author }); });

  23. FireBase Data Storehttps://youtu.be/pXFMQAl6XBM

  24. Chat Application FireBaseDataStore

  25. You are going to use my FireBase Data Store so copy the code opposite <script> // Initialize Firebase var config = { apiKey: "AIzaSyAVQLaGLhKu3DNssy3g7IuihPKQkuwASxY", authDomain: "chatapp-c509e.firebaseapp.com", databaseURL: "https://chatapp-c509e.firebaseio.com", projectId: "chatapp-c509e", storageBucket: "", messagingSenderId: "363342895005" }; firebase.initializeApp(config); </script>

  26. Exercise in class - Chat App - clone from https://github.com/johntango/chatFirebase

  27. AWS Cloud GitHub EC2 Server SSH into EC2

  28. AWS Cloud Virtual Private Network Docker image jrwtango/expresscolor Load Balancer ECS Elastic Cloud HTTP request

  29. Bad Bank on AWS

  30. AWS Cloud Virtual Private Network Docker image jrwtango/expresscolor Load Balancer ECS Elastic Cloud HTTP request

  31. AWS Cloud Virtual Private Network SQS AWS Lambda AWS Logging

  32. AWS Cloud Virtual Private Network Docker image jrwtango/expresscolor Load Balancer ECS Elastic Cloud HTTP request

  33. AWS Cloud Virtual Private Network Docker image jrwtango/dynamo5 API Gateway Load Balancer ECS Elastic Cloud HTTP request

More Related