본문 바로가기

분류 전체보기

(ElasticSearch) 엘라스틱서치에 데이터 싱크하기 ( 2 ) - Using Queues to Manage Batches 이 글은 [elastic] Keeping Elasticsearch in Sync 문서를 정리한 글 입니다 ㅎㅅㅎ 이전 글에서는 엘라스틱서치에 저장된 문서를 업데이트할 때, Batch로 한번에 업데이트하는게 효과적이라는 내용을 살펴봤었다. - (ElasticSearch) 엘라스틱서치에 데이터 싱크하기 ( 1 ) 이번 글에서는 Batch로 한번에 업데이트할 문서 정보들을 원본 데이터에서 가져오는 방법에 대해서 정리해보려고 한다. Using Queues to Manage Batches배치로 데이터들을 일괄 업데이트하려면, 수정해야하는 데이터들만 골라서 가져와야한다. 이 때 큐를 사용하면 효율적으로 관리할 수 있다. 큐 대기열을 관리할 저장소로는 SQL 테이블, Redis Sorted Set 등을 사용할 수 있..
(ElasticSearch) 엘라스틱서치에 데이터 싱크하기 ( 1 ) - The Problems of Too-Frequent Updates and Non-Batch Updates 이 글은 [elastic] Keeping Elasticsearch in Sync 문서를 정리한 글 입니다 ㅎㅅㅎ ElasticSearch은 검색엔진 목적으로 많이 사용된다. 그래서 원천 데이터들은 RDB / NoSQL DB에 저장하고, 제2의 데이터 저장소로 ElasticSearch를 사용하는 경우가 많다. 그래서 원천 데이터를 ElasticSearch으로 옮기는 작업이 필요하다. 이 글에서는 DB와 엘라스틱서치를 효율적으로 싱크시키는 방법에 대해서 정리하고자 한다. 데이터를 복제뜨는 방법은 크게 2가지가 있다. A. 실시간으로 데이터 싱크하기 ( sync )B. 배치로 데이터 싱크하기 ( async ) A. 실시간으로 데이터 싱크하기 문제 1 - 엘라스틱서치 트래픽 증가건바이건으로 엘라스틱서치 데이터를..
(Django) Rest Frame Work Filter 활용하기 FilterBackend 사용하기ViewSet에서 Request 파라미터로 받은 값이랑 일치하는 데이터를 조회해야할 때, 아래처럼 일일히 파라미터를 받아다가, filter 조건에 추가해줘야한다. class ProductList(generics.ListAPIView): serializer_class = PurchaseSerializer def get_queryset(self): """ This view should return a list of all the purchases for the user as determined by the username portion of the URL. """ category = self.kwargs['category'] in_stock = self.kwargs['in_s..
(PostgreSQL) Default 값이 있는 새로운 필드 추가하기 Default 값이 있는 새로운 필드 추가하기ALTER TABLE orders ADD COLUMN price bigint NOT NULL DEFAULT 0; PostgreSQL 10 이하 버전에서는 테이블에 Default 값이 있는 필드를 추가할 땐 주의해야한다. Default값이 있는 필드를 추가할 때, 테이블을 다시 만들어내기 때문이다!그러면 시간도 오래걸리고, ACCESS EXCLUSIVE LOCK도 잡게 된다. ( 참고 - Fast Column Creation with Defaults )ACCESS EXCLUSIVE LOCK이 걸려있는 동안, 이 테이블에 대한 모든 트랜잭션은 BLOCK된다! SELECT 쿼리까지 막힌다! ( ACCESS EXCLUSIVE LOCK LEVEL은 LOCK LEVEL ..
제럴드 와인버그 <Quality Software Book : How Software Is Built > - 4장 요약 How Software Is Built 본문 중에서..4.1 Shooting at Moving TargetsWhen teaching someone to shoot at a moving target, you cannot give instructions about which direction to shoot, because the direction is constantly changing. Instead, you must give general instructions about aiming guns, instructions that can then be applied to a wide variety of moving targets. That's why the study of patterns of softwa..
마틴파울러 <NoSQL 빅데이터 세상으로 떠나는 간결한 안내서> - 15장 데이터베이스 선정 본문 중에서... 15장 데이터베이스 선정NoSQL 기술을 사용하는 데는 두가지 주요 이유가 있다.애플리케이션의 필요에 더 잘 부합하는 데이터베이스를 사용해 프로그래머 생산성을 향상시키기 위해.대용량 데이터 처리, 지연 시간 감소, 처리량 증가를 통해 데이터 접근 성능을 향상시키기 위해NoSQL 기술을 사용하기로 결정하기 전에 프로그래머 생산성과 성능에 대한 기대를 테스트로 확인하는 것이 필수다.서비스를 캡슐화하면 필요에 따라 데이터 저장소 기술을 변경할 수 있다. 애플리케이션 일부를 서비스로 분리하면 기존 애플리케이션에서도 NoSQL을 도입할 수 있다.대부분의 애플리케이션에서, 특히 전략적인 것이 아니라면 관계형 기술을 계속 사용해야 한다. 적어도 NoSQL 생태계가 더 성숙해질 때까지는 그렇다. 관계..
제럴드 와인버그 <Quality Software Book : How Software Is Built > - 3장 요약 How Software Is BuiltChapter 3. What Is Needed To Change Patterns? 3.1.1 Thought and communication in various patternsOblivious. Individualism is the key. Variable. Emotion and mysticism drive everything. People don't use words in consistent way. This works under the most current sources… I've fixed several bugs and made a lot of changes in the application code since this release, so I believe t..
제럴드 와인버그 <Quality Software Book : How Software Is Built > - 2장 요약 How Software Is BuiltChapter 2. Software SubculturesQuality is value to some person(s). Requirements are not an end in themselves, but a means to an end—the end of providing value to some person(s). ... In software work, however, we cannot assume this ideal situation, so much of the development process is concerned with more closely approaching the "true" requirements. Therefore, much of what we..