Code Monkey home page Code Monkey logo

designing-data-intensive-applications's People

Contributors

bluejunha avatar craftsangjae avatar dane805 avatar k1my0 avatar limguswls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

designing-data-intensive-applications's Issues

Stateful과 Stateless 차이

stateful과 stateless는 process(application)의 설계 패턴을 구분하는 말로서, 아래 두 그림을 비교해서 보자.

오른쪽 그림부터 보면, 오른쪽 그림은 내부에 8이라는 값(state)이 저장되어 있고, add를 수행하면 해당 값을 불러와서 해당값에 더하는 연산을 수행한다. 이렇게 내부에 값을 따로 보관해서 매 연산마다 해당 값에 따라 결과값이 결정되는 함수를 stateful하다고 말한다. 왼쪽 그림같은 경우, 내부에 보관하는 값이 없고, 오로지 입력값에 의해서만 결과값이 결정되기 때문에 이러한 함수를 stateless하다고 말한다.

위와 같이 UI 프로그램을 설계할 때나, REST API를 설계할 때, Stateful하냐, Stateless하냐에 따라 달라진다. 장단점을 나누어 본다면, 아래와 같다

34쪽. Entity란?

링크드인 이력서가 아래와 같이 구성되어 있다고 생각해보자.

{
"user_id": 251,
"first_name": "Bill",
"last_name": "Gates",
"summary": "Co-chair of the Bill & Melinda Gates... Active blogger.", "region_id": "us:91",
"industry_id": 131,
"photo_url": "/p/7/000/253/05b/308dd6e.jpg",
"organization": "Microsoft"
}

현재 organization은 문자열로 저장되어 있다. 이 정보도 문자열 대신 엔티티로 참조하면 어떨까? 엔티티로 참조한다는 것은, 각 organizationschool_name에 대한 여러 정보들(조직의 로고, 조직원의 수 등)과 관련을 맺을 수 있음을 의미한다. 예를 들어 organization에 대한 엔티티가 아래와 같이 구성되어 있다고 생각해보자.

{
  "Name":  "Microsoft",
  "ISIN" : "US5949181045",
  "Founded": "April 4, 1975", 
  "Founders": "Bill Gates"
}

이력서 json에서 organization 엔티티를 참조한다면, 아래와 같이 될 것이다.

{
"user_id": 251,
"first_name": "Bill",
"last_name": "Gates",
"summary": "Co-chair of the Bill & Melinda Gates... Active blogger.", "region_id": "us:91",
"industry_id": 131,
"photo_url": "/p/7/000/253/05b/308dd6e.jpg",
"organization": {
  "Name":  "Microsoft",
  "ISIN" : "US5949181045",
  "Founded": "April 4, 1975", 
  "Founders": "Bill Gates"
}}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.