210308 study

써니·2021년 3월 8일
0

오늘의 공부

목록 보기
1/1

API v.s SDK

  • API = Application Programming Interface
    : set of protocols and tools for building application software
    (software component간의 communication의 메소드들의 집합)

  • SDK = Software Development Kit (대부분 API ⊂ SDK)
    : set of development tools that allows the creation of application for a certian software package/framework/hardware platform/computer system/video game console/OS/similar development platform
    (개발 도구 프로그램, 디버깅 프로그램, 문서, API 등...)

Framework v.s Library

  • Software Framework = 정의된 API를 제공하는 Software library의 모음
    : 애플리케이션의 틀과 구조 결정, 그 위에 개발된 개발자의 코드 제어

  • Software Library = 컴퓨터 프로그램에서 자주 사용되는 부분 프로그램들의 집합
    : 정적, 동적(링크, 로드) 라이브러리로 나뉨)

프레임워크에서는 "프레임워크 코드가 사용자 코드를 호출"하고, 라이브러리에서는 "사용자 코드가 라이브러리를 호출"한다

framework code: 통제 흐름을 정의      //     Your code & Library code: 행동을 정의

fast api

: 파이썬 웹 프레임워크, type hints를 제공함

    type hints: 파라미터 값이 어떤 자료형이 들어와야하는 지 코드 상에서 명시 하는 것

<특징>

  • Fast: NodeJS 및 Go와 동등한 높은 성능 (<- due to: Starlette & Pydantic + Uvicorn)
  • Fast to code
  • Fewer bugs
  • Intuitive
  • Easy
  • Short: 중복 코드 적음, 문서 쉽게 읽을 수 있음
  • Robust: 문서 자동화 및 쉬운 배포
  • Standards-based: 개방형 API 표준,JSON Scheme를 기반

c.f) Starlette 과 Pydantic, 그리고 Uvicorn

  1) Pydantic: 데이터 구문 분석 및 유효성 검사에 유용한 라이브러리
  2) Uvicorn: 초고속 ASGI Web Server (단일 프로세스에서 uvloop 기반 비동기 Python Code를 실행
  3) Starlette: ASGI Web Application Server (Uvicorn 위에서 실행)

Web Server v.s WAS (Web Application Server)

  • Static Pages
    - web server는 파일 경로 이름을 받아 경로와 일치하는 file contents를 반환
    • 항상 동일한 페이지를 반환
    • ex: image, html, css, javascript 파일처럼 컴퓨터에 저장된 파일
  • Dynamic Pages
    - 인자의 내용에 맞게 동적인 contents를 반환
    - web server에 의해 실행되는 프로그램을 통해 만들어진 결과물 *servlet : WAS위에서 돌아가는 Java Program
    - 개발자는 Servlet에 doGet()을 구현

Web Server

  • 하드웨어: Web Server가 설치된 컴퓨터
  • 소프트웨어: Web Browser client로부터 HTTP요청을 받아 정적인 컨텐츠(.html, .jpeg, .css 등)을 제공하는 컴퓨터 프로그램
  • 요청에 따라
    1) 정적인 컨텐츠 제공 / WAS를 거치지 않고 자원 제공
    2) 동적인 컨텐츠 제공 위한 요청 전달 (client의 Request를 WAS로, WAS의 Response를 client로)
  • EX) Apache Server, Nginx, IIS (Windows 전용 web server)

WAS (Web Application Server)

  • DB조회나 로직 처리를 요구하는 동적인 컨텐츠를 제공하기 위해 만들어진 application server
  • HTTP를 통해 컴퓨터/장치에 application을 수행해주는 미들웨어 (software engine)
  • = Web Container = Servlet Container
    - container = JSP, Servlet을 실행시킬 수 있는 software
    • WAS = JSP, Servlet 구동환경 제공
  • EX) Tomcat, JBoss, Jeus, Web Sphere-

Web Service Architecture

1) Client -> Web Server -> DB
2) Client -> WAS -> DB
3) Client -> Web Server -> WAS -> DB

참고 : https://gmlwjd9405.github.io/2018/10/27/webserver-vs-was.html

pip freeze -> azure blob storage

pip freeze를 통해 프로젝트에 필요한 패키지 목록을 저장해두고 한번에 설치할 수 있다.

  • pip freeze > requirement.txt : 패키지 목록을 저장한다.
  • pip install -r requirement.txt : 저장했던 패키지 리스트를 한 번에 설치

async test

convert curl to python requests

-참고-
https://you9010.tistory.com/147
https://squareup.com/us/en/townsquare/sdk-vs-api

0개의 댓글