본문 바로가기

개발기술

(120)
파일서빙 전략과 구현 1. 파일 서빙 전략 – 주체 기준누가 실제로 클라이언트에 파일을 보내주는가?분류설명예시Java 직접 응답Java에서 InputStream → OutputStream으로 전달바이트 스트림 방식Nginx 정적 서빙Nginx가 파일 직접 서빙/files/image.jpgJava + NginxJava가 인증 후 Nginx에게 위임X-Accel-RedirectCDN글로벌 캐시 서버가 전송CloudFront, Cloudflare 바이트 스트림 방식 (Java 등에서 직접 처리)Java (Spring 등)에서 InputStream을 통해 파일을 직접 읽어서, OutputStream에 바이트로 써주는 방식입니다. 장점동적으로 처리 가능하여 세밀한 제어 가능 (예: 권한 검사, 로깅, 접근 제한 등)다운로드 전에 동적..
Static File Upload Generalized Static File Upload WorkflowClient uploads a file (MultipartFile)Client (frontend or mobile) sends a multipart/form-data request:POST /uploadContent-Type: multipart/form-data--boundaryContent-Disposition: form-data; name="file"; filename="image.jpg"Content-Type: image/jpeg (binary data) Server stores the file (locally or in cloud) and returns a public-accessible URL@PostMapping("/u..
Java 리플렉션, 제네릭 Class클래스 자체도 객체로 표현한 것으로, 특정 타입(T)의 Class 객체를 의미해요. 해당 클래스의 정의(필드, 메서드 등)에 대한 정보를 담은 객체를 반환합니다.Class clazz = String.class;System.out.println(clazz.getName()); // java.lang.StringSystem.out.println(clazz.getDeclaredFields()); // 필드 정보들 리플렉션클래스, 필드, 메서드, 생성자 등의 정보를 런타임에 동적으로 조회하거나 조작할 수 있게 해주는 기능즉, Java에서 "클래스나 메서드 등의 정보를 코드로 다루는 기능"이에요.이 모든 건 Class 객체를 통해 시작됨정적(static) 인스턴스 생성 방식컴파일 타임에 타입이 명확히 정..
자바스크립트 내장함수 JavaScript 언어 자체의 기능JavaScript 엔진(V8, SpiderMonkey 등)**에서 제공하는 기능으로 어디서든 동작 가능 (브라우저, Node.js, 서버 등) JavaScript KeywordIn Operator(javascript property in object) : The in operator returns true if the specified property is found in the specified object or its prototype chain. Its syntax is:  String Object MethodStringinstance.toUpperCase() : 문자열을 대문자로 변환 후 반환함Stringinstance.length() : 문자열의 길이를 반환..
Tomat And Netty Tomcat vs Netty — What's the Difference? Feature / AspectTomcatNettyBuilt forServlet-based web apps (Spring MVC)General-purpose networking (low-level)I/O modelBlocking or semi-blockingFully non-blocking, event-drivenProtocolsHTTP/1.1, some HTTP/2HTTP/1.1, HTTP/2, WebSocket, TCP, UDPUse caseTraditional web serversReactive systems, custom protocolsAbstraction levelHigh (Servlets, Filters)Low (Chan..
Java Blocking I/O vs non-Blocking I/O 1.. JDBC (Database Access)java복사편집String name = jdbcTemplate.queryForObject("SELECT name FROM users WHERE id = ?", String.class, 1); 🔒 Blocking behavior:The current thread sends the SQL query over the network to the DBThe thread waits (blocks) until the DB returns a responseNo other work happens on that thread until the DB reply is received📌 JDBC is a blocking API, always🔸 2. RestTemplate (HT..
JavaScript, Node JS, Event-Driven Programming 그리고 Java, Spring, MultiThreading - java와 javascript의 스타일 차이. 태생이다르다- node js의 등장- epoll과 같은 os method의 발전- java의 발전 프로그래밍 스타일 비교 Java Style: Sequential and ConditionalIn Java, you call a function, wait for the result, and then use if statements to control logic: @RestControllerpublic class UserController { private final UserService userService; public UserController(UserService userService) { this.userService = use..
Java 코딩구현 - Java New I/O System java.nio = New I/OIt was introduced to improve performance, scalability, and flexibility in Java I/O operations.Here’s what it covers:Featurejava.io (Old I/O)java.nio (New I/O)📚 StyleStream-basedBuffer & channel-based📁 File handlingFilePath, Files🔁 I/O typeBlocking onlyBlocking & Non-blocking⚙️ PerformanceGood for simple tasksBetter for large data or high load📂 Directory walkManualBuilt-in (..