Architecture is proposed and there are also alternative architectures proposed

This commit is contained in:
Steffen committed 2026-10-14 00:38:08 +02:00
1 parent ccf9041183
commit 3426236c6c
24 files changed
+2516

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
# Energy-related design hypotheses
These are anticipated mechanisms, not measured results. No numerical savings, energy measurement procedures, code tuning, compiler flags or algorithm replacement are proposed. Energy is distinct from CPU utilization, memory, throughput and latency. Equal behaviour/data/access guarantees remain necessary when comparing architectures.
| Decision | Mechanism and anticipated effect | Assumptions / dependencies | Counter-effects and limits |
| --- | --- | --- | --- |
| ADR-01 single application runtime | Removes duplicated runtime/listener/housekeeping work and internal calls; may lower idle and request energy | Baseline processes actually consume avoidable resources; host power responds to released resources or capacity can be consolidated | Same always-on host may draw similar power; co-scaling entire app can cost more than scaling only analytics; shared GC/contention can extend active time |
| In-process module composition | Removes JSON copies, TLS and loopback/remote HTTP on internal legs, including gateway callbacks | Equivalent validation/access and result semantics; internal contract calls replace real network legs | External TLS and DB work remain; fewer hops/less latency do not prove lower energy; network equipment may have high fixed consumption |
| ADR-02 database/schema consolidation | Shared connection management and transactions avoid coordination and duplicated pools; source snapshot may avoid repeat reads | One app/database is acceptable; baseline uses separate databases/configuration | A baseline single PostgreSQL server already shares server overhead; one combined pool/snapshot can create contention; FK/index writes have costs |
| ADR-03 one atomic association | Avoids separate association network/persistence step and recovery coordination | Profile owns account association; DB uniqueness/transaction capability | Unique index, locks and failed concurrent attempts still perform work; baseline already used one row so no relative saving necessarily exists |
| ADR-05 on-demand results | Avoids periodic wakes, projection writes, broker and stored-result invalidation on corrections/deletions | Interactive queries modest; fresh data required; results not repeatedly expensive | Repeated large trend queries may cost more than a correct versioned cache or projection; concurrency admission can lengthen waits |
| Request-local snapshot/reuse | Captures selected series once for overview insight; avoids duplicated owner/data reads where safely reusable in same snapshot | No cross-request reuse; preserve actual-owner authorization; request datasets manageable | Repeatable-read snapshot may retain DB versions and increase resource pressure; materializing full series costs memory; snapshot consistency is mainly a correctness benefit |
| Bounded pooled DB connections | Reuses connection/authentication setup rather than reconnecting per operation | Pool sized for deployment; secure remote transport when needed | Idle sockets/connections consume resources; excessive pool capacity increases footprint; scarce pools can prolong work; no asserted energy result |
| Patient/time indexes | Reduces unnecessary data access for current patient/period/latest queries | Selective queries and adequate table size; index remains useful | Extra writes, storage and maintenance; small tables may gain little. Additional context indexes are conditional, not automatic |
| Reviewed static guidance/reference bundle | Avoids request-time publisher calls and always-on content refresh service; immutable content may be cached publicly | Versioned review/release process maintains applicability | Review/redeployment has costs; outdated content risks correctness; availability of static data does not establish clinical validity |
| Tokens verified per request, password checked at login | Avoids expensive password verification on every business call while preserving policy checks | Same account/expiry behaviour; protected keys persist securely | Logins/expiry/validation still cost work; shorter lifetime increases login frequency; this retained baseline mechanism may offer no architectural delta |
| ADR-08 colocated app/DB default | Can avoid unnecessary extra hosts/network paths; administrative tool exits after installation | Modest resource demand, supported Linux, acceptable shared failure domain | Virtual hosts may share physical hardware already; remote shared DB can be more efficient at scale; contention can prolong activity; energy depends on physical placement |
| No always-on broker/gateway/provisioner | Avoids added runtime/services for responsibilities served in-process or only at install time | No external integration/event durability or independent gateway requirement | Loss of isolation and platform-specific optimizations; a shared existing gateway could have negligible marginal overhead |
Selection balances these hypotheses with security, clinical correctness, maintainability and deployability. Unknown workload, active/idle balance, repeated-query frequency, physical host sharing and peak analytics demand prevent a universal energy ranking. The reduced service or five-service alternatives can be preferable where independent scaling or isolation offsets their overhead. No power/energy evidence was gathered in this architecture assignment.