Computer Science
-
TransactionComputer Science 2023. 9. 6. 00:21
데이터베이스의 목적은 기업의 목표 달성을 위해 모순이 없는 정확한 데이터를 만들어내기 위함이다. 그러므로 데이터를 업데이트하고, 삭제하고, 추가하는 등의 DB 연산은 매우 중요하다. 예를 들어, DB 내 삽입/ 삭제/ 갱신 연산 중 하드웨어의 이상, 소프트웨어 오류 등으로 연산의 실행이 취소된 상황에는, DB를 트랜잭션 이전 상황으로 돌려놓아야 한다. 이 때 DB 연산 작업에 필요한 SQL 문들의 모임을 트랜잭션(Transaction) 이라고 한다. 트랜잭션의 원리 - 원자성, Atomicity : All or Nothing으로 정리할 수 있으며, 오류 발생 시 트랜잭션 이전 원래 상태로 복구해야 한다. - 일관성, Consistency : 트랜잭션 성공 이후 DB 내 데이터는 이전과 모순되지 않고 일관..
-
[OS] File System에서의 레코드와 필드Computer Science 2023. 6. 22. 12:53
* 자료의 구성단위 : Bit < Nibble < Byte < Word < Field < Record < File 순서 1. Bit : 자료 표현의 최소단위로서 0 혹은 1로 표현 2. Nibble : 4개의 비트가 모일 시 Nibble이라고 부름(1 Nibble = 4 Bit) 3. Byte : 문자 표현의 최소 단위. 8bit = 1 Byte 4. Word : 컴퓨터가 한 번에 처리할 수 있는 명령 단위로, OS에 따라 1 Word가 상이하다. 5. Field : 파일 구성의 최소 단위 6. Record : 하나 이상의 필드가 모여 구성 7. File : 하나 이사의 레코드가 모여 구성 고객ID 이름 주소 연락처 적립금 A0001 정소화 부천시 원미구 032-xxx-xxxx 4000 B0002 김현준..
-
[Back-End] 웹 크롤러 작업 흐름Computer Science 2023. 6. 14. 23:02
1. 시작 URL들을 미수집 URL 저장소에 저장한다. 2. HTML 다운로더는 미수집 URL 저장소에서 URL 목록을 가져온다. 3. HTML 다운로더는 도메인 이름 변환기를 사용하여 URL의 IP 주소를 알아내고, 해당 IP 주소로 접속하여 웹 페이지를 다운받는다. 4. 콘텐츠 파서는 다운된 HTML 페이지를 파싱하여 올바른 형식을 갖춘 페이지인지 검증한다. 5. 콘텐츠 파싱과 검증이 끝나면 중복 콘텐츠인지 확인하는 절차를 개시한다. 6. 중복 콘텐츠인지 확인하기 위해서, 해당 페이지가 이미 저장소에 있는지 본다. - 이미 저장소에 있는 콘텐츠인 경우에는 처리하지 않고 버린다 . - 저장소에 없는 콘텐츠인 경우에는 저장소에 저장한 뒤 URL 추출기로 전달한다. 7. URL 추출기는 해당 HTML 페이..
-
[API] 공공데이터 API 접속하기Computer Science 2023. 6. 2. 07:02
기상청 단기예보 조회서비스를 이용하여 api를 호출해보자. ❖ 맥북(Mac) 화면 캡쳐 방법(단축키) 1. 전체화면 스크린샷: Command + Shift + 3 2. 영역지정 캡처: Command + Shift + 4 3. 특정 창 캡처: Command + Shift + 4 누른 후, SpaceBar 4. 스크린샷 앱 이용: Command + Shift + 5 5. 터치바 캡처: Command + Shift + 6 6. 미리보기 앱 이용: 미리보기앱 > 파일 > 스크린샷 ("전체화면" 사용시, 마우스, 드래그 영역 함께 캡쳐 가능) * Only 복사(저장X) : Command + Shift + Control + 3/4/6 기상청 단기예보 조회서비스를 공공데이터 api를 이용해 JSON 형식으로 반환해보..
-
[DB]SQLD_2Computer Science 2023. 5. 25. 13:25
SQL 종류 - SQL은 데이터 정의, 데이터 조작, 데이터 제어 등의 기능 지원 Standard Explanation DDL(Data Definition Language) - 관계형 데이터베이스 구조를 정의 - CREATE, ALTER, DROP, RENAME문 DML(Data Manipulation Language) - 테이블에서 데이터를 입력, 수정, 삭제, 조회 - INSERT, UPDATE, DELETE, SELECT문 DCL(Data Control Language) - 데이터베이스 사용자에게 권한을 부여하거나 회수 - GRANT, REVOKE, TRUNCATE문 TCL(Transaction Control Language) - 트랜잭션을 제어하는 명령어 - COMMIT, ROLLBACK, SAV..
-
[DB] SQLD_1Computer Science 2023. 5. 21. 23:27
# 카테시안 곱 From 절에 2개 이상의 Table이 있을 때 두 테이블 사이의 유효 Join 조건을 적지 않았을 시에 해당 테이블에 대한 모든 데이터를 결합하여 테이블에 존재하는 행 갯수를 곱한 만큼의 결과값이 반환되는 것 # 파티션 기법 데이터베이스에서 파티션을 사용하여 테이블을 분할 하는 것. 파티션을 사용하면 논리적으로는 하나의 테이블이지만 여러 개의 데이터 파일에 분산되어 저장한다. PARTITION EXPLANATION Range Partition 데이터 값의 범위를 기준으로 파티션 수행 List Partition 특정한 값을 지정하여 파티션을 수행 Hash Partition 해시 함수를 적용하여 파티션을 수행 Composite Partition 범위와 해시를 복합적으로 사용하여 파티션을 수..
-
[OS] vi 편집기Computer Science 2023. 5. 9. 11:40
Boaz 활동을 하다보면 linux 환경에서 파일을 편집하여 구동하는 경우가 잦다. 여러 활동을 하면서 Linux에 대한 이해가 부족하다고 생각해서 일단 가볍게 리눅스마스터 2급 취득을 목표로 틈틈이 공부중인데, 오늘 vi 편집기에 대해 알아보자. 리눅스에서 지원하는 편집기로는 pico, emacs,vi, gedit, xedit 등이 있다. vi 편집기는 유닉스 환경에서 가장 많이 쓰이는 문서 편집기이다. 다른 편집기들과 다르게 모드형 편집기이며, 명령모드 / 입력모드 / 편집모드로 구성되어 있다. 한 줄씩 편집하는 줄 단위 편집기가 아닌 한 화면을 편집하는 비주얼 에디터이며, 기종별 다양한 vi 클론들이 존재한다. vim 편집기도 있는데, vi 편집기와 호환되며 독자적으로 다양한 기능을 추가하여 만든 ..
-
[OS] Semaphore에 대해Computer Science 2023. 4. 27. 15:51
앞선 포스트에서 확인할 수 있듯이, Process Synchronization 문제에서 Critical Section 처리 방식은 상당히 중요하다. OS가 동기화 문제를 일으키지만, 앞선 포스트에서 봤듯 소프트웨어적인 알고리즘으로는 비효율적인 문제와 과잉 양보 문제가 발생하므로, 하드웨어적 접근이 필요하다. 하드웨어 적으로 Test & Modify를 원자적으로 수행할 수 있도록 지원하게 되면, Critical Section 문제는 간단히 해결된다. Synchronization variable boolean lock = false; Process P_i do { while(Test_and_Set(lock)); critical section lock = false; remainder section } 이 p..