Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Implement Database-Backed Session Storage (DatabaseSessionService) for ADK Java

未关闭
#665 3 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@hemasekhar-p 已经在做这个了。

开始于 2026年1月14日。

评估

这个 Issue 还没有评估数据。

描述

contrib needs review

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

主要语言
Java
星标
1.7k
派生
421
平均合并
3 天 8 小时
30 天内合并 PR
36

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/adk-java 的其他 Issue

查看 google/adk-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。