개발자 라이프
-
[Kafka 운영] 1MB 이상의 메시지를 보낼 때 고려해볼만한 설정들개발자 라이프/카프카 2020. 8. 7. 00:42
들어가며 카프카는 기본적으로 1MB 이상의 큰 메시지를 고려하고 만들어진 메시지 시스템이 아닙니다. 하지만 그럼에도 1MB 이상의 메시지로 파이프라인을 구성해야 할 때가 있습니다. 예로 이미지 혹은 정말 큰 JSON 메시지로 파이프라인 구성할 때가 있습니다. 이때, 프로듀서, 브로커, 컨슈머는 그 파이프라인 성격에 맞게 직접적 혹은 간접적으로 영향을 받는 설정들을 조정해줘야 합니다. 이번 글은 각 카프카 컴포넌트들이 1MB 이상의 메시지를 보낼 때 고려해야 하는 설정들을 정리했습니다. 참고로 아래 설정들을 전부 테스트해보지 못했습니다. 몇 가지 설정은 주관적인 판단에 의해 명시되어 있습니다. 혹여나 잘못되거나 부족한 부분은 댓글로 피드백 부탁드립니다. :) 1. 프로듀서 측 1.1. 직접적인 영향을 미치..
-
[매일읽기] A short summary of Java coding best practices개발자 라이프/매일읽기 2020. 8. 6. 21:56
원문 : https://medium.com/@rhamedy/a-short-summary-of-java-coding-best-practices-31283d0167d3 A short summary of Java coding best practices based on coding standards by Oracle, Google, Twitter and Spring Framework medium.com 자바 소스 파일 한 소스 파일은 2,000 라인을 넘지 않는다. 소스 파일은 문서화된 주석과 함께 구성 패키지 선언 클래스에 관한 주석 import 부분 (static은 마지막에) 클래스/인터페이스 부분 네이밍 클래스와 인터페이스는 카멜 케이스 두문 문자와 같은 줄임말(ex. CEO) 외에 모든 단어에 적용 패키..
-
[매일읽기] Functional Patterns in Java개발자 라이프/매일읽기 2020. 8. 5. 11:17
원문 : https://medium.com/better-programming/functional-patterns-in-java-b2b781f84124 Functional Patterns in Java How to use different design patterns with functional programming in Java medium.com 프로그래밍 패턴들 행위 패턴 (Behavioral pattern) 객체 간 일반적인 상호작용을 정의하는 패턴 strategy, visitor, chain of reponsibility, template method, observer, iterator 패턴 등 생성 패턴 (Creational pattern) 객체를 생성하는 메커니즘을 포함하는 패턴 factory..
-
[매일읽기] Understanding Java threads once and for all개발자 라이프/매일읽기 2020. 8. 4. 21:45
원문 : https://medium.com/swlh/understanding-java-threads-once-and-for-all-711f71e0ec1e Understanding Java threads once and for all Sometimes, we want to perform several tasks at the same time. The computer can do this by using Threads. You might be reading this post… medium.com 스레드(Thread) 큰 데이터를 서브 셋으로 쪼개 병렬로 처리할 때 스레드로 처리할 수 있음 CPU 프로세서 코어 수 등 하드웨어 스펙에 따라 스레드 성능이 영향을 받을 수 있음 만약 스레드 수가 코어 수보다 많다..
-
[매일읽기] Hexagonal Architecture in Java개발자 라이프/매일읽기 2020. 7. 30. 10:11
원문 : https://medium.com/swlh/hexagonal-architecture-in-java-b980bfc07366 Hexagonal Architecture in Java A practical example of the usage of the Hexagonal Architecture pattern in Java. medium.com Hexagonal architecture Alistair Cockburn 이 고안함 Adapter architecture 라고도 함 도메인 엔티티에 대한 관심사 분리가 목적 결합도가 감소하고 유연성 증가 Hexagonal architecuture 가 필요한 경우 UI 코드와 비지니스 로직 코드의 혼재 Layer 간 무분별한 의존성 Hexagonal 이라고 해서 ..
-
[매일읽기] 10 things you’re doing wrong in Java개발자 라이프/매일읽기 2020. 7. 29. 10:23
출처 : https://towardsdatascience.com/10-things-youre-doing-wrong-in-java-7608e2f050c7 10 things you’re doing wrong in Java The most common mistakes Java developers make towardsdatascience.com 1. 접근 제어자를 잘 모른다 특히 protected 접근 제어자에 대한 이해가 부족 동일 패키지에서의 접근 허용 하위 클래스에서의 접근 허용 2. equals() 메소드를 사용하지 않는다 '==' 비교 연산자 대신 equals() 메소드를 사용할 것을 권장 특히 참조 변수 비교 시, 더욱 equals() 권장 3. String 추가 조합 연산 '+' 를 이용해서 St..
-
[매일읽기] Mastering Kotlin standard functions: run, with, let, also and apply개발자 라이프/매일읽기 2020. 7. 27. 09:57
출처 : https://medium.com/mobile-app-development-publication/mastering-kotlin-standard-functions-run-with-let-also-and-apply-9cd334b0ef84 Mastering Kotlin standard functions: run, with, let, also and apply Some of the Kotlin’s standard functions are so similar that we are not sure which to use. Here I will introduce a simple way to clearly… medium.com 코틀린 strandard 함수 중 run, with, let, also, apply..
-
[매일읽기] Immutable classes in Java개발자 라이프/매일읽기 2020. 7. 26. 09:26
자바에서 불변 객체의 특징과 생성 방법을 알아본다 불변 객체의 특징 객체의 값(상태;state)가 변경되지 않는다. 변하지 않는 값으로 확신할 수 있으므로 개발 과정에서 안정적이다. 멀티 스레드 환경에서 안정적이다. VM 캐시 혹은 별도 구현 캐시에 쉽게 캐시하고 사용할 수 있다. equals() & hashCode() 가 구현된 상태에서 해시 컬랙션에 안정적으로 넣을 수 있다. 가변 객체에서 불변 객체 만드는 과정 No. 과정 취약점 1 setter를 제거하여 직접적인 변경을 막는다. 초기 데이터를 넣을 수 없다. 2 all args 생성자를 추가하여 데이터를 생성 초기에만 넣을 수 있도록 한다. 클래스 상속 후 데이터를 변경하는 메소드를 추가 구현하여 데이터를 변경한다. 3 final 클래스로 지정하..