들어가며 Linux 서버를 여러 사용자가 공유하는 환경에서는 각 사용자에게 고유한 UID(User ID)와 GID(Group ID)를 발급해야 합니다. 우리 팀이 개발 중인 서버 계정 관리 시스템에서도 사용 신청이 승인되면 UID/GID를 자동으로 할당하는 로직이 필요했습니다. 초기에는 "현재 최댓값을 조회하고 +1한 값을 저장"하는 단순한 방식으로 구현했는데, 동시 요청이 들어오면 충돌이 발생할 수 있는 구조였습니다. 이 글에서는 기존 방식의 문제점을 분석하고, 카운터 테이블 + 비관적 락으로 리팩토링한 과정을 공유합니다. 기존 구현: 조회 → 계산 → 저장 → 실패하면 재시도 기존 UID 발급 코드는 다음과 같았습니다.
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by assertThat .isEqual To
๐ Spring Boot ํ ์คํธ ์ฝ๋ ์ ๋ณต๊ธฐ: Controller๋ถํฐ Repository๊น์ง
< ๋ฐ๋ชจ๋ฐ์ด ๊ตฌํ ์ฝ๋ API ๋ชฉ๋ก > (์ง์์) ๋ต๋ณ ์์ฑ ์กฐํ (์ง์์) ์ ํ ์ธํฐ๋ทฐ ์๊ฐ ์กฐํ (์ง์์) ์ง์์ ์ ์ถ ์ด๋ฒ Lion Sprint ํ๋ก์ ํธ์์ ์์ธ ์ฒ๋ฆฌ์ ํ
์คํธ, ์ธ๋ถ API ํธ์ถ์ ๋ด๋นํ๋ฉฐ ์ฒ์์ผ๋ก Likelion14th ๋ชจ์ง ํ๋ก์ ํธ์์ ํ
์คํธ ์ฝ๋๋ฅผ ์์ฑํด ๋ณด์๋ค. ๋จ์ํ "์ฑ๊ณต ํ
์คํธ"๋ฅผ ๋์ด, ์ค์ ๋น์ฆ๋์ค ๋ก์ง์์ ๋ฐ์ํ ์ ์๋ ์์ธ ์ํฉ๋ค์ ๊ฒ์ฆํ๋ ๊ณผ์ ์ ์ง์คํ๋ค.
10. 스프링 타입 컨버터
프로젝트 생성 스프링 타입 컨버터 소개 타입 컨버터 - Converter 컨버전 서비스 - ConversionService 스프링에 Converter 적용하기 뷰 템플릿에 컨버터 적용하기 포맷터 - Formatter 포맷터를 지원하는 컨버전 서비스 포맷터 적용하기 스프링이 제공하는 기본 포맷터 프로젝트 생성 dependencies : Spring Web, Lombok, Thymeleaf 스프링 타입 컨버터 소개 HelloController - 문자 타입을 숫자 타입으로 변경 @RestController public class HelloController { @GetMapping("/hello-v1") public String helloV1(HttpServletRequest request) { String data = request.getParameter("data"); Integer intValue = Integer.valueOf(data);...
Running Tests in GitLab CI: From Zero to Pipeline
Continuous Integration (CI) are essential practices in modern software development. They ensure that code changes are automatically tested, leading to faster and more reliable software releases. In this article, we'll walk through the process of setting up a Spring Boot project with Gradle, writing unit tests, and configuring GitLab CI to automate the testing.
【链表】为什么做了很多链表的算法题,还觉得自己不会链表-CSDN博客
建议大家的阅读方式 首先思考下自己认识的链表 对比下你认识的链表和我梳理的链表有什么不同,如果是我梳理的有疑问或者不详尽,欢迎评论区讨论 在思考下哪里自己有疑惑,疑惑是什么 对比下我梳理的实际困惑点和新的认识(这里先给出了答案),看下是否你也有困惑,认识不清晰的 就困惑的点看下我梳理的实验部分,看是否回答了你的问题,如果没有,欢迎评论区告诉我,我们一起进步 如果你对链表已经很熟悉了,那欢迎你看下算法中的巧劲部分,后续我会持续更新,也欢迎你在评论区中指正或者告诉我其他你希望看到的内容 最后思考下,关于链表,还有哪些是你的困惑,希望我补充的内容,也欢迎评论区告诉我 最后的最后,希望大家读完了这篇文章,思考下自己是否有提升,提升了什么?希望大家和我一起,每天进步一点点。 困扰 我到底会不会链表 为什么做了很多链表的算法题,还觉得自己不会链表 为什么一会觉得自己会了,一会有觉得自己不会了呢? 关于困惑的思考 只是按照业务的角度/算法case的角度去实现这个业务 算法题做完了,感觉懂了链表,又好像没懂 到底是引用了之前的实例,还是new了一个新的实例,每次都是靠尝试...
Software Engineering at Google
Test State, Not Interactions Another way that tests commonly depend on implementation details involves not which methods of the system the test calls, but how the results of those calls are verified. In general, there are two ways to verify that a system under test behaves as expected. With state testing, you observe the system itself to see what it looks like after invoking with it.
Jackson: java.util.LinkedHashMap cannot be cast to X
本文翻译自:https://www.baeldung.com/jackson-linkedhashmap-cannot-be-cast Jackson是一个广泛使用的 Java 库,它允许我们方便地序列化/反序列化 JSON 或 XML。 有时,当我们尝试将 JSON 或 XML 反序列化为对象集合时,可能会遇到“ java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to X ”。 在本教程中,我们将讨论为什么会发生上述异常以及如何解决该问题。 让我们创建一个简单的 Java 应用程序来重现此异常,以了解异常何时发生。 2.1 创建 POJO 类 让我们从一个简单的 POJO 类开始: public class Book { private Integer bookId; private String title; private String author; //getters, setters, constructors, equals and hashcode omitted }...
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with assertThat .isEqual
Contact assertThat .isEqual, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack