Watchtower-Course-Project

ADR-0007: Migrate WatchTower Event Storage from SQLite to PostgreSQL

Status

Accepted

Date

2026-05-30


Context

ADR-0003 selected SQLite as the primary database for WatchTower due to its lightweight setup and suitability for rapid MVP development.

As WatchTower has evolved, the project has moved toward a fully hosted architecture consisting of:

While SQLite was appropriate during local development, its file-based architecture introduces challenges in hosted environments:

WatchTower requires a database solution that is designed for hosted and production environments.


Decision

Replace SQLite with PostgreSQL as the primary database for WatchTower.

PostgreSQL will be used for:

This decision supersedes ADR-0003.


Rationale


Alternatives Considered

Continue Using SQLite

Rejected because SQLite is primarily intended for local and embedded use cases. Its file-based storage model creates deployment and infrastructure limitations for a hosted observability platform.

MongoDB

Rejected because WatchTower’s DB accesses are configured for relational queries and migrating would incur a big overhead.


Consequences

Positive

Negative


Supersedes

ADR-0003: Use SQLite for WatchTower Event Storage


Conclusion

PostgreSQL was selected because it better aligns with WatchTower’s transition from a local prototype to a hosted observability platform. While SQLite was effective for MVP development, PostgreSQL provides a more suitable foundation for deployment, maintenance, and future expansion.