R2
CLOUDFLARE비동기 AWS SDK 클라이언트를 통한 Cloudflare R2입니다.
R2 설정 →R2D1 / 모듈형 JAVA 영속성
완전한 문서는 하나의 DocumentStore에, 인덱스 조회는 하나의 IndexStore에 맡기세요. R2D1은 지원되는 백엔드와 통합 방식에 관계없이 컬렉션 API를 동일하게 유지합니다.
R2D1은 하나의 DocumentStore와 하나의 IndexStore를 조합합니다. 각 열에서 하나를 선택하고 설정 가이드를 따른 다음 공통 컬렉션 API를 사용하세요.
직렬화된 원본 콘텐츠, 식별자 조회, 문서 목록을 담당합니다.
필터와 정렬에 사용하는 문서 식별자 및 명시적으로 인덱싱한 필드를 담당합니다.
두 백엔드를 설정하면 어떤 조합에서도 같은 annotation, 컬렉션 생명주기, 변경 메서드, 인덱스 쿼리 빌더를 사용합니다.
@Document("users")
record User(@Id String id, @Index String country, @Index long score) {}
R2D1 database = R2D1.builder()
.collectionFactory(new PersistenceCollectionFactory(
documentStore, indexStore, documentCodec, indexStore::initialize))
.build();
R2D1Collection<User> users = database.collection(User.class);
users.put(new User("user-123", "NZ", 42));
Page<User> page = users.query()
.where("country").eq("NZ")
.sortBy("score", SortDirection.DESC)
.limit(20)
.fetch();전체 설정, adapter 선택, 생명주기 규칙은 시작하기 문서.
core artifact는 공통 API와 Cloudflare 백엔드를 제공합니다. 로컬 파일, JDBC 인덱스, Micronaut wiring이 필요할 때 해당 모듈만 추가하세요.
dev.nexcraft:r2d1공통 컬렉션 API와 R2 DocumentStore 및 D1 IndexStore adapter입니다.
모듈 설정 →dev.nexcraft:r2d1-jdbc애플리케이션 소유 DataSource를 통한 H2, HSQLDB, 로컬 SQLite 인덱스입니다.
JDBC 설정 →dev.nexcraft:r2d1-filesystem원자적 교체와 명시적 executor 소유권을 사용하는 canonical 로컬 문서 파일입니다.
Filesystem 설정 →dev.nexcraft:r2d1-micronaut동일한 프레임워크 독립 컬렉션 API를 Micronaut 5 bean 설정과 연결합니다.
Micronaut 설정 →문서 저장소와 인덱스 저장소를 설정하고 metadata를 정의한 다음 컬렉션을 여세요.