Implement Database-Backed Session Storage (DatabaseSessionService) for ADK Java
@hemasekhar-p đang làm issue này rồi.
Từ ngày 14/1/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
ADK Java currently provides only in-memory session storage, which is not suitable for production environments that require durable, consistent, and queryable session/state/event storage.
Projects building on ADK often need:
- Persistent session storage across restarts
- Reliable event logging and retrieval
- Concurrency-safe updates
- Support for standard relational databases
- Schema versioning for continuous delivery
Describe the solution you'd like
Introduce a production-ready database-backed session service (DatabaseSessionService) that provides durable storage for sessions, events, and state.
Key characteristics:
- Pure JDBC implementation with zero ORM dependencies
- HikariCP connection pooling for high performance
- Flyway migrations for schema versioning and zero-downtime deployments
- Multi-database support: PostgreSQL, MySQL, H2, Cloud Spanner (SQLite not supported)
- 3-tier state storage: Separate tables for app-level, user-level, and session-level state
- Pessimistic locking for safe concurrent updates
- Dialect-aware JSON handling (JSONB for PostgreSQL, JSON for MySQL, CLOB for others)
- Reactive API with RxJava 3 (Single/Maybe/Completable)
- Event filtering and pagination
- Comprehensive test coverage using H2 and integration tests on actual databases (PostgreSQL, MySQL, Spanner) running in Docker
This service offers a robust, scalable alternative to the current in-memory session implementation without introducing heavy ORM dependencies.
Describe alternatives you've considered
Providing this as an external extension/library
- Persistent sessions are commonly required; shipping this in-core provides a better out-of-the-box experience.
Continuing with in-memory storage only
- Not viable for production deployments requiring durability or concurrency guarantees.
Using Hibernate/JPA
- Adds significant dependency overhead and complexity; pure JDBC provides better control and performance.
Additional context
The Python ADK includes a production-grade DatabaseSessionService that is widely used in real-world workloads (including GKE deployments). Adding equivalent persistent session storage to ADK Java would
provide consistency across ADK environments and reduce the need for custom user-built solutions.
An implementation is available in PR: https://github.com/google/adk-java/pull/700
- Ngôn ngữ chính
- Java
- Star
- 1.7k
- Fork
- 421
- Merge trung bình
- 3 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 36
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của google/adk-java
-
needs review
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
needs review
-
needs review
-
needs review
-
needs review
Tất cả issue của google/adk-java
Issue tương tự
-
certification
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
[BUG] ECR GetAuthorizationToken returns a proxyEndpoint for the default region, not the request's Đang mởbug ecr
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Needs: Triage Type: Feature request
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
AntennaPod/AntennaPod#8794 ·
-
agentic-workflows
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
github/copilot-sdk#2760 ·