Architecture is proposed and there are also alternative architectures proposed
This commit is contained in:
1 parent
ccf9041183
commit
3426236c6c
24 files changed
+2516
No files matched your search
@@ -0,0 +1,62 @@
|
||||
# Recommendation: the most likely lowest-energy Health App architecture
|
||||
|
||||
2026-10-13. This recommendation compares the modular-monolith proposal with the service-preserving suggestions. It is a reasoned prediction for the documented prototype, **not an established energy result**.
|
||||
|
||||
## Recommendation and scope
|
||||
|
||||
My leading candidate is an **efficient modular monolith on one suitably sized Linux host with PostgreSQL**. Combine the topology with bounded connection pooling, request-local reuse of current source data and on-demand calculations. Retain explicit module responsibilities, private persistence adapters, secure authorization and the complete required results.
|
||||
|
||||
The nine suggestions in this folder are mostly complementary architectural changes, rather than nine mutually exclusive complete architectures. Several apply to both a monolith and independent services. The meaningful comparison is therefore between complete combinations under equivalent behaviour, data, workload and hosting assumptions.
|
||||
|
||||
This recommendation follows the previously authorized freedom to reconsider topology. It requires the [US-16 revisions](../ArchitectureProposal/us16-revision.md) already documented in the proposal. It does not claim to satisfy original independent-feature installation requirements or authorize implementation. The main [architecture specification](../ArchitectureProposal/software-architecture.md) remains authoritative.
|
||||
|
||||
## Assumptions behind the prediction
|
||||
|
||||
Assume modest, intermittent interactive use with synthetic patient data; profile and observation operations plus current insights/trends/overviews; no demonstrated need for independent feature scaling, separate deployment teams or mandatory process isolation. Assume one host can accommodate the application and database with appropriate operating headroom. Workload volume, history size, query repetition, hardware power response and physical host sharing remain unknown.
|
||||
|
||||
The predicted advantage concerns total operational energy for equivalent useful work over equivalent periods, including idle operation. Fewer requests, incomplete results, stale assessments or weaker access protection cannot count as improvements. CPU utilization, memory, latency and throughput alone do not establish lower energy consumption.
|
||||
|
||||
## Why this is the leading candidate
|
||||
|
||||
| Architectural characteristic | Expected energy mechanism | Qualification |
|
||||
| --- | --- | --- |
|
||||
| One application runtime | Avoids duplicating application runtime, listener and housekeeping resources across five feature processes | Runtime footprint does not translate directly into a known energy saving; fixed host power may dominate |
|
||||
| In-process module calls | Removes internal HTTP handling, serialization and TLS work, including gateway callback detours | External HTTPS and database communication remain; efficient colocated services may have a small marginal communication cost |
|
||||
| Direct request composition through module interfaces | Captures current source values and reuses them within an authorized request, avoiding redundant retrieval where possible | This benefit can also be designed into microservices; do not attribute every avoided read exclusively to consolidation |
|
||||
| Bounded shared connection management | Reuses database sessions and avoids duplicating unbounded per-service resource budgets | Idle pooled connections and contention still cost resources; efficiently bounded service pools may achieve similar benefits |
|
||||
| On-demand calculations without an added broker/cache server/worker | Avoids extra resident components and unsolicited background work | The documented baseline already calculates on demand without these components, so this is a retained advantage over more elaborate variants, not a new saving against that baseline |
|
||||
| One appropriately sized physical deployment | May avoid powering separate underused application/database hosts | If all five services already share the same host/PostgreSQL server, physical consolidation supplies no additional advantage |
|
||||
|
||||
The strongest rationale is that this combination removes internal communication and duplicated application-runtime overhead without adding coordination machinery for a workload that does not yet justify it. Simpler deployment and transactions also support correctness and maintainability, although those benefits are not energy measurements.
|
||||
|
||||
Physical hosting deserves separate attention. Static power and energy proportionality mean software work and host energy need not move in direct proportion. The [Green Software Foundation's energy-efficiency guidance](https://learn.greensoftware.foundation/energy-efficiency/) describes those mechanisms. Applying them to this Health App is an inference; the guidance does not demonstrate that this application's monolith beats its microservices.
|
||||
|
||||
## Expected ranking under these assumptions
|
||||
|
||||
| Expected position | Complete candidate | Reason and uncertainty |
|
||||
| --- | --- | --- |
|
||||
| 1 | Efficient modular monolith; one app host with local PostgreSQL; bounded pooling, request reuse, current on-demand results | Removes internal application-network calls and multiple runtime footprints. Leading candidate with limited confidence |
|
||||
| 2 | Efficient colocated independent services; one suitable host and PostgreSQL server, two owned databases; bounded pools and safe duplicate-read removal | Retains process isolation and independent installation while addressing physical overhead and repeated work. Could be close to, or outperform, the monolith depending on resource behaviour |
|
||||
| 3 | Independent services distributed across several dedicated, continuously powered hosts | Likely higher idle infrastructure cost at modest demand. This prediction does not apply automatically when those services instead share existing physical capacity or a more efficient hosting platform |
|
||||
|
||||
This is an ordinal prediction, not a quantified ranking. It does not prescribe adding idle hosts to the service alternative, overprovisioning either candidate or comparing different security/result guarantees. Equal software behaviour on different hardware can also change the ordering.
|
||||
|
||||
## Conditions that could change the recommendation
|
||||
|
||||
**Heavy, uneven analytics demand:** Independent services can scale only Insights while leaving lightly used features small. A monolith may replicate the whole application to handle that load. If the avoided replication exceeds service communication and coordination overhead, service separation could use less energy.
|
||||
|
||||
**Frequent repeated expensive queries:** Source-revision-validated result reuse could avoid repeated data transfer and calculation. It can apply to either architecture. A cached service design could outperform an uncached monolith, but that would not prove that service boundaries caused the difference. Cache memory, source revision checks, invalidation correctness and query repetition determine whether the mechanism is worthwhile.
|
||||
|
||||
**Different physical hosting:** Five services on an already shared host may have little avoidable infrastructure overhead. Conversely, a dedicated oversized monolith host can be wasteful. Remote shared database capacity may be preferable to another mostly idle local server. Physical host count and suitability matter more than deployment labels alone.
|
||||
|
||||
**Resource contention or isolation needs:** A shared process may experience contention or require excess headroom that isolated services avoid. Mandatory independent deployment/fault isolation can also make services the more suitable architecture even if a small energy penalty remains. The recommendation must continue to respect security, correctness and operational requirements.
|
||||
|
||||
**Acceptable intermittent activation:** Hosting that can remove unused capacity may favour independently activated services for some workloads. Cold starts, dependency activation, availability and platform overhead require an explicit design decision; no scale-to-zero benefit is assumed here.
|
||||
|
||||
## Practical recommendation
|
||||
|
||||
For the current clarified architecture assignment, retain the efficient modular monolith as the **most plausible lowest-energy candidate**, while recording the efficient colocated five-service design as the strongest alternative. Confidence in the qualitative mechanisms is greater than confidence in the final energy ranking, because workload and hardware evidence are absent.
|
||||
|
||||
If preserving original service installation/isolation is important, choose [Candidate A from the suggestions](energy-with-independent-services.md): it addresses several energy mechanisms without a runtime merger and requires fewer structural changes than direct-call delegation or distributed caching. Do not introduce brokers, cache servers, orchestration platforms or additional replicas solely on the assumption that they will save energy.
|
||||
|
||||
No universal winner, numerical saving or energy measurement procedure is claimed. Current information supports a conditional recommendation; it does not establish actual consumption. Application code, original inputs and the architecture proposal remain unchanged by this document.
|
||||
Reference in new issue
Block a user