reading-notes

Software Development Reading Notes

View on GitHub

Readings: Serverless Functions

(notes credit from this source: https://www.ibm.com/cloud/learn/serverless) (https://pymotw.com/3/http.server/index.html)


**Pros**

- Improved developer productivity
- Pay for only execution time
- Multi programming languages support
- Simplified DevOps cycles
- Easy scaling 
- cost on your own choice
- visualized user center console FYI

**Cons**

- Unacceptable latency when start from zero or start over
- High costs for stable workloads
- monitor and debug issues is hard as platform less support popular tools and processes
- code trans platforms is hard.

### Http server

- http.server uses classes from socketserver to create base classes for making HTTP servers.
- BaseHTTPRequestHandler can handle each protocol method (GET, POST, etc.).

**Get( ) method sample code**

class handler(BaseHTTPRequestHandler):
```angular2html
def do_GET(self):
        self.send_response(200)
        self.send_header("content-type", "text/plain")
        self.end_headers()
        message = "please follow format 'country=name'"
        self.wfile.write(message.encode())
        return

Requests

Vercel

Things I want to know more: How is the serverless platform debugging works?