오즈코딩스쿨 초격차캠프 백엔드 13일차

Hyemin Kim·2023년 12월 26일
0

✅ 1. 서버리스 아키텍처란

서버리스 아키텍처(Serverless Architecture)는 전통적인 서버 기반의 웹 개발에서 벗어나 서버 관리와 인프라 구축에 대한 부담을 최소화하는 아키텍처입니다. 서버리스는 애플리케이션을 실행하는 서버를 명시적으로 관리하지 않고, 클라우드 서비스 제공업체가 자동으로 서버를 관리하고 확장하는 형태로 애플리케이션을 개발하고 배포하는 방식을 말합니다.

서버리스 아키텍처의 주요 특징은 다음과 같습니다:

  1. 서버 관리의 간소화: 서버를 직접 프로비저닝하거나 관리할 필요가 없으며, 클라우드 제공업체가 자동으로 서버를 관리합니다.

  2. 이벤트 기반 실행: 함수를 작성하고 특정 이벤트(예: HTTP 요청, 데이터 변경)가 발생할 때마다 실행되도록 설정할 수 있습니다.

  3. 종량 과금: 사용한 리소스에 대해서만 비용을 지불하므로 비용 효율적입니다.

  4. 자동 확장: 애플리케이션의 부하에 따라 자동으로 확장되므로 트래픽 증가에 대비할 수 있습니다.

  5. 이벤트 기반 아키텍처: 서버리스 애플리케이션은 이벤트를 기반으로 동작하며, 각 함수가 특정 이벤트에 응답합니다.

서버리스 아키텍처는 특히 마이크로서비스 아키텍처, 이벤트 기반 시스템, 상태 없는 애플리케이션 등과 잘 조합되어 현대적이고 유연한 웹 애플리케이션을 구축하는 데 도움이 됩니다. 대표적인 서버리스 플랫폼에는 AWS Lambda, Azure Functions, Google Cloud Functions 등이 있습니다.

- What is a serverless architecture

Serverless architecture is an approach to designing and building applications where the developer does not need to manage the infrastructure or servers directly. In a serverless architecture, cloud service providers handle the server provisioning, scaling, and maintenance tasks, allowing developers to focus solely on writing code and building functionalities.

Key characteristics of serverless architecture include:

  1. No Server Management: Developers don't need to worry about server provisioning, scaling, or maintenance. The cloud provider handles these tasks automatically.

  2. Event-Driven: Serverless applications are often event-driven, meaning they respond to events or triggers (e.g., HTTP requests, database changes, file uploads).

  3. Function as a Service (FaaS): Serverless typically involves using Function as a Service (FaaS) platforms, where code is organized into small, individual functions that are triggered by events.

  4. Auto-Scaling: Serverless platforms can automatically scale the number of function instances based on demand, ensuring optimal performance and resource utilization.

  5. Pay-per-Use Billing: Serverless architectures are usually billed based on the actual usage of resources and the execution of functions, providing cost efficiency.

Popular serverless platforms include AWS Lambda, Azure Functions, Google Cloud Functions, and others. Serverless architecture is well-suited for certain types of applications, such as microservices, event-driven systems, and scenarios where rapid scaling and cost efficiency are crucial.

✅ 2. IoT란

IoT, 또는 사물인터넷(Internet of Things),는 인터넷에 연결된 일상적인 물건이나 기기들이 데이터를 수집, 교환, 처리하고 상호작용할 수 있도록 하는 기술적인 인프라를 가리키는 용어입니다. 기본적으로 IoT는 다양한 센서와 통신 기술을 사용하여 사물을 인터넷에 연결하여 데이터를 수집하고 이를 분석하며, 필요에 따라 특정 동작을 수행하도록 하는 개념입니다.

IoT의 핵심 구성 요소는 다음과 같습니다:

  1. 센서 및 장치: 온도, 습도, 위치 등과 같은 다양한 데이터를 수집하는 센서 및 장치들이 포함됩니다.

  2. 데이터 통신: 수집된 데이터를 전송하고 받기 위한 통신 기술이 필요합니다. 이는 무선 통신 기술(예: Wi-Fi, Bluetooth, Zigbee)을 포함할 수 있습니다.

  3. 데이터 처리 및 저장: 수집된 데이터는 처리되어 유용한 정보로 변환되고 클라우드나 로컬 서버에 저장됩니다.

  4. 애플리케이션 및 서비스: 최종적으로 데이터는 애플리케이션이나 서비스를 통해 활용되며, 사용자에게 유용한 기능을 제공합니다.

IoT는 다양한 산업 분야에서 활용되며, 스마트 홈, 스마트 시티, 산업 자동화, 건강 관리 등 다양한 응용 분야에서 혁신적인 솔루션을 제공하고 있습니다.

- What is IoT

IoT, or the Internet of Things, refers to the network of physical devices, vehicles, appliances, and other objects embedded with sensors, software, and network connectivity, allowing them to collect and exchange data. In essence, IoT enables everyday objects to connect to the internet and communicate with each other.

Key components of IoT include:

  1. Devices and Sensors: Everyday objects equipped with sensors to collect data. These can range from simple temperature sensors to complex devices with multiple sensors.

  2. Connectivity: The ability of devices to connect to the internet or to each other. This can involve various communication technologies, such as Wi-Fi, Bluetooth, cellular networks, or even low-power wide-area networks (LPWAN).

  3. Data Processing and Storage: The collected data needs to be processed and often stored for further analysis. This can occur locally on the device or in the cloud.

  4. Applications and Services: The processed data is used to create applications or services that provide value. This can include real-time monitoring, automation, and insights derived from the data.

IoT finds applications in various industries, including smart homes, healthcare, industrial automation, agriculture, and more. It has the potential to bring about significant advancements in efficiency, convenience, and decision-making by enabling devices to work together and make data-driven decisions.

✅ 3. 메모리 관리란

메모리 관리는 컴퓨터 시스템에서 프로그램이나 애플리케이션이 메모리를 효율적으로 할당, 사용, 해제하는 프로세스를 나타냅니다. 메모리는 컴퓨터의 핵심 자원 중 하나이며, 효율적으로 관리되어야 시스템의 안정성과 성능을 유지할 수 있습니다.

메모리 관리에는 다음과 같은 주요 개념과 작업이 포함됩니다:

  1. 할당 (Allocation): 프로그램이 실행될 때 필요한 메모리를 할당하는 과정입니다. 이는 변수, 객체, 함수 등이 사용하는 메모리 공간을 결정하는 것을 포함합니다.

  2. 해제 (Deallocation): 더 이상 필요하지 않은 메모리를 해제하여 시스템 자원을 최적화하는 과정입니다. 메모리 누수를 방지하고 불필요한 자원 소모를 방지하기 위해 중요합니다.

  3. 재활용 (Reclamation): 사용하지 않는 메모리를 다른 목적으로 재사용하는 과정입니다. 메모리를 효율적으로 사용하기 위해 필요한 단계 중 하나입니다.

  4. 가비지 컬렉션 (Garbage Collection): 프로그램이 더 이상 참조되지 않는 메모리, 즉 가비지를 식별하고 해제하는 프로세스입니다. 명시적으로 메모리를 해제해야 하는 언어와 달리, 가비지 컬렉션은 자동적으로 메모리를 관리합니다.

  5. 스왑 (Swapping): 메모리가 부족한 경우, 현재 사용되지 않는 데이터를 디스크로 옮겨 공간을 확보하는 메커니즘입니다. 이를 통해 더 많은 프로그램이 실행될 수 있습니다.

메모리 관리는 시스템의 안정성, 효율성, 성능에 직접적인 영향을 미치므로 프로그래머와 운영체제가 함께 협력하여 이를 관리하는 것이 중요합니다.

- What is Memory Management

Memory management refers to the process of controlling and coordinating computer memory, a critical resource in any computing system. The primary goal of memory management is to allocate and deallocate memory space as efficiently as possible, ensuring that programs and applications run smoothly without memory-related issues. Here are key aspects of memory management:

  1. Allocation: During program execution, the operating system allocates memory space to different processes and applications based on their requirements. This involves setting aside portions of memory for variables, data structures, and program code.

  2. Deallocation: When a program or process no longer needs certain memory regions, the operating system deallocates or releases that memory, making it available for other use. This helps prevent memory leaks and ensures optimal use of resources.

  3. Reclamation: Memory reclamation involves recycling memory that is no longer in use for reuse by other parts of the program or by other programs. Efficient reclamation contributes to overall system performance.

  4. Garbage Collection: In languages with automatic memory management (e.g., Java, JavaScript), garbage collection identifies and frees up memory that is no longer reachable or in use by the program. This process helps prevent memory leaks caused by unreleased memory.

  5. Swapping: When physical memory (RAM) becomes insufficient, the operating system may use a technique called swapping to transfer portions of inactive memory to disk storage, freeing up RAM for more critical tasks.

Memory management is a critical aspect of operating systems and programming languages. Poor memory management can lead to issues such as memory leaks, inefficient resource usage, and degraded system performance. Modern operating systems and programming languages provide various mechanisms and algorithms to optimize memory usage and ensure the reliable execution of software.

✅ 4. 프로토타입 체인이란

프로토타입 체인(Prototype Chain)은 JavaScript에서 객체 간의 상속 관계를 구현하는 메커니즘입니다. 모든 JavaScript 객체는 다른 객체를 기반으로 생성됩니다. 이 때, 생성된 객체는 원본 객체의 프로퍼티와 메서드를 상속받게 되는데, 이를 가능하게 하는 것이 프로토타입 체인입니다.

JavaScript에서 객체는 자신의 프로토타입(원본 객체)을 가리키는 __proto__라는 내부 속성을 갖습니다. 이 __proto__를 따라가면서 프로토타입 체인이 형성됩니다. 프로토타입 체인을 통해 상위 객체의 프로퍼티와 메서드를 하위 객체가 참조할 수 있습니다.

프로토타입 체인 동작 예시:

// 부모 객체 생성
var parent = {
  name: "Parent",
  sayHello: function() {
    console.log("Hello from " + this.name);
  }
};

// 자식 객체 생성
var child = Object.create(parent);
child.name = "Child";

// 자식 객체에서 부모의 프로퍼티와 메서드에 접근
console.log(child.name);      // "Child"
child.sayHello();             // "Hello from Child"

// 프로토타입 체인 확인
console.log(child.__proto__ === parent);     // true

위의 예시에서 child 객체는 parent 객체를 프로토타입으로 가지고 있습니다. 따라서 child 객체에서 sayHello 메서드를 호출할 때, 자신에게 해당 메서드가 없으면 프로토타입 체인을 따라 올라가서 부모 객체의 메서드를 호출합니다. 이러한 방식으로 객체 간에 상속 관계를 유지하고 코드의 재사용성을 높일 수 있습니다.

- What is Prototype chain

The prototype chain is a mechanism in JavaScript that allows objects to inherit properties and methods from other objects. Every object in JavaScript has an internal property called [[Prototype]] (commonly referred to as __proto__). This property points to another object, known as its prototype. This forms a chain-like structure where an object can inherit properties and methods from its prototype, and the prototype itself can have another prototype, creating a chain.

Here's a simple explanation of the prototype chain:

  1. Object Creation:
    When you create an object, JavaScript sets its [[Prototype]] to reference another object. This reference establishes the prototype chain.

  2. Property Lookup:
    When you try to access a property or method on an object, JavaScript first checks if that property exists on the object itself. If not, it looks up the prototype chain until it finds the property or reaches the end of the chain.

    // Example
    var parent = { name: 'Parent' };
    var child = Object.create(parent);
    console.log(child.name); // Looks up the prototype chain to find 'name' in 'parent'
  3. Chaining:
    If the property is not found on the object or its prototype, the process continues up the prototype chain. This continues until the property is found or until the end of the chain is reached.

    // Example continued
    var grandchild = Object.create(child);
    console.log(grandchild.name); // Looks up the prototype chain: 'child' -> 'parent'

The prototype chain is crucial for achieving inheritance in JavaScript. It allows objects to share and reuse code, promoting a more efficient and modular code structure.

profile
Full Stack Web Developer

0개의 댓글