Skip to main content

02 - On-Prem Infrastructure TCO: An Honest Calculation Framework

The total cost of in-house infrastructure splits into six items: a Python program shows when it pays off and what changes on 12 January 2027.

What do you think about this article?

02 - On-Prem Infrastructure TCO: An Honest Calculation Framework
Data Sovereigntyfedericocalo.dev

At a Glance

The total cost of in-house infrastructure splits into six items: a Python program shows when it pays off and what changes on 12 January 2027.

The cost of running infrastructure in-house is a sum of six items, and two of them decide almost everything

When you are weighing whether to keep sensitive data, and the service that processes it, in-house or to hand them to a managed service, the first figure you are asked for is the monthly fee of the machine. It is also the item that weighs least. Total cost of ownership, TCO, adds up six items, and the two that move the result most are the time of whoever runs the system and the volume of work the system actually does. This article builds the calculation with a Python program, executed, whose assumptions are yours to replace, and adds an item that superficial comparisons forget: the exit cost, which for cloud services changes on 12 January 2027 because of Regulation (EU) 2023/2854.

Level: advanced. The article stands on its own, and it is the second in the series on data sovereignty: the next two apply the same method to healthcare data and to the documents of a law firm. To estimate memory and model speed yourself, see the costs of a server of your own and when a managed service is the better choice. No figure below is a price list or a measurement from a provider: they are test values, declared as such.

Why "how much does it cost" is a badly posed question

Take a professional firm of ten people that wants a document archive with search and an assistant that summarises case files. It receives two quotes: a server at 200 euro a month and a pay-per-use service at 45 euro per million tokens processed. Comparing 200 with 45 makes no sense, because the first number is a fixed amount that is paid even when the machine is idle, and the second grows with use. On top of that, the first quote does not contain the hours of whoever installs the patches, checks the backups and works out why a request has slowed down. A question with a single figure hides at least two variables, the volume and the management time, and that is why the comparison looks rigorous without being so.

The six items of an honest TCO

A TCO is built by listing the items before adding them up. For an infrastructure that keeps data inside the organisation's perimeter, these are at least the following:

  • Hosting or hardware. The monthly fee of the machine or the instalment of the purchase: it is fixed and is paid regardless of volume.
  • Day-to-day operation. Security patches, updating the software and the models, checking the logs: these are hours of work, so a cost computed as hours times an hourly rate.
  • Continuity. Backups, restore tests, monitoring: what a managed service includes in its fee and what, in-house, falls on whoever runs the system.
  • Skills. Someone has to be able to read a log, size an index, understand a slowdown. If that skill is missing, the item is not zero: it becomes an outside consultancy or a risk.
  • Capacity and growth. A machine has a ceiling of work; beyond that ceiling a second machine is needed, and the cost rises in steps, not continuously.
  • Exit. What it costs to leave the solution: migrating the data, rewriting the integrations, being without the service for a few days.

The first two items are the ones the quote shows or forgets: hosting can be read on the price list, management cannot. The criterion that holds the six together is whether an item is fixed or proportional to volume: hosting, continuity and skills do not depend on how much you work, whereas the usage of a managed service does. For an entity that falls within the scope of the NIS2 Directive, continuity is not even optional: Article 21(2)(c) lists among the minimum measures business continuity, such as backup management and disaster recovery, and point (d) supply chain security, that is, the relationship with suppliers, including providers of cloud services. Whether you fall within that scope is a question for your lawyer, and I do not decide it here.

The calculation, with assumptions you can replace

The program below puts the six items into two functions. costo_proprio adds hosting, management (hours times rate), continuity and a monthly share of the exit, amortised over 36 months; when the volume exceeds the declared capacity, it doubles hosting and continuity, and that produces the step. costo_gestito multiplies the volume by a price per million tokens and adds the same share of exit, but computed on the fee the provider may charge on that day. The pareggio function searches, in steps of 0.01 million tokens, for the first volume at which the managed service costs as much as the self-run one. The variations use dataclasses.replace, which creates a new instance of the assumptions without modifying the original, so every row of the sensitivity analysis starts from the same base values. None of the numbers is a market price: 200 euro is not the fee of any provider, 45 euro is not a price list.

"""Monthly cost of a self-run service against a pay-per-use one, with the six cost items and the exit fee. All values are test values."""
from dataclasses import dataclass, replace
from datetime import date

DATA_ZERO_TARIFFE = date(2027, 1, 12)  # art. 29, par. 1, regulation (EU) 2023/2854


@dataclass(frozen=True)
class Ipotesi:
    hosting_eur_mese: float = 200.0
    ore_gestione_mese: float = 10.0
    costo_ora_eur: float = 50.0
    backup_monitoring_eur_mese: float = 40.0
    migrazione_eur: float = 2000.0
    ammortamento_mesi: int = 36
    capacita_mtok_mese: float = 20.0
    prezzo_gestito_eur_per_mtok: float = 45.0
    tariffa_uscita_gestito_eur: float = 1500.0


def costo_proprio(volume_mtok: float, ip: Ipotesi) -> dict:
    # above the capacity ceiling a second machine is needed: stepped cost
    macchine = 1 if volume_mtok <= ip.capacita_mtok_mese else 2
    voci = {
        "hosting": ip.hosting_eur_mese * macchine,
        "management": ip.ore_gestione_mese * ip.costo_ora_eur,
        "backup": ip.backup_monitoring_eur_mese * macchine,
        "exit": ip.migrazione_eur / ip.ammortamento_mesi,
    }
    return {**voci, "total": sum(voci.values())}


def costo_gestito(volume_mtok: float, ip: Ipotesi, oggi: date) -> dict:
    tariffa = 0.0 if oggi >= DATA_ZERO_TARIFFE else ip.tariffa_uscita_gestito_eur
    voci = {
        "usage": volume_mtok * ip.prezzo_gestito_eur_per_mtok,
        "exit": tariffa / ip.ammortamento_mesi,
    }
    return {**voci, "total": sum(voci.values())}


def pareggio(ip: Ipotesi, oggi: date) -> float | None:
    """First volume (Mtok/month, step 0.01) at which the pay-per-use service costs as much as the self-run one."""
    for passo in range(0, 10001):
        v = passo / 100
        if costo_gestito(v, ip, oggi)["total"] >= costo_proprio(v, ip)["total"]:
            return v
    return None


def testo(v: float | None) -> str:
    return "none within 100" if v is None else f"{v:.2f}"


base = Ipotesi()
oggi = date(2026, 11, 13)
print("Monthly cost (euro), test assumptions, reference date", oggi)
print(f"{'Mtok/month':>10} {'self-run':>9} {'managed':>9}")
for v in (0.5, 2, 5, 10, 15, 20, 25):
    p = costo_proprio(v, base)["total"]
    g = costo_gestito(v, base, oggi)["total"]
    print(f"{v:>10} {p:>9.2f} {g:>9.2f}")

print("\nItems of the self-run cost at 10 Mtok/month")
for nome, val in costo_proprio(10, base).items():
    print(f"  {nome:<10} {val:>8.2f}")

print("\nBreak-even (Mtok/month) when a single assumption changes")
print(f"  base                          {testo(pareggio(base, oggi)):>6}")
for ore in (2, 20):
    print(f"  management hours = {ore:<2}        {testo(pareggio(replace(base, ore_gestione_mese=ore), oggi)):>6}")
for h in (100, 300):
    print(f"  hosting = {h} euro/month      {testo(pareggio(replace(base, hosting_eur_mese=h), oggi)):>6}")

print("\nEffect of the exit fee on the pay-per-use service, at 10 Mtok/month")
for d in (date(2026, 11, 13), date(2027, 1, 12)):
    print(f"  {d}: exit {costo_gestito(10, base, d)['exit']:.2f} euro/month, "
          f"break-even {testo(pareggio(base, d))} Mtok/month")

# Output:
# Monthly cost (euro), test assumptions, reference date 2026-11-13
# Mtok/month  self-run   managed
#        0.5    795.56     64.17
#          2    795.56    131.67
#          5    795.56    266.67
#         10    795.56    491.67
#         15    795.56    716.67
#         20    795.56    941.67
#         25   1035.56   1166.67
#
# Items of the self-run cost at 10 Mtok/month
#   hosting      200.00
#   management   500.00
#   backup        40.00
#   exit          55.56
#   total        795.56
#
# Break-even (Mtok/month) when a single assumption changes
#   base                           16.76
#   management hours = 2           7.87
#   management hours = 20         33.20
#   hosting = 100 euro/month       14.54
#   hosting = 300 euro/month       18.98
#
# Effect of the exit fee on the pay-per-use service, at 10 Mtok/month
#   2026-11-13: exit 41.67 euro/month, break-even 16.76 Mtok/month
#   2027-01-12: exit 0.00 euro/month, break-even 17.68 Mtok/month

The output shows three things. The self-run cost stays at 795.56 euro as long as the volume is below the capacity of 20 million tokens a month, while the managed cost grows in a straight line, and the two lines meet at about 16.76 million. Above 20 the self-run cost rises to 1,035.56 for the second machine, and at 25 million it becomes lower than the managed one (1,166.67). The second table shows that, in the test case, management weighs 500 euro against the 200 of hosting: the item that superficial comparisons leave out is worth more than the machine. The third says that moving the hours from 10 to 2 brings the break-even to 7.87 million, while with 20 hours the break-even rises to 33.20, and this value is already beyond the ceiling: there the calculation takes the second machine into account.

Where it goes wrong. The model measures work in tokens, so it holds for an assistant or a summary, not for a vector search whose cost is in memory and in indexed documents: in that case the unit and the ceiling change. The volume has to be measured, not estimated by eye: count the tokens of a month of real use before trusting the break-even. And the program says nothing about what money does not buy, such as the provider's seat or the law it is subject to. When the load is occasional, with a peak in a few hours and the rest of the time idle, the comparison on monthly volume hides the problem, which is sizing for the peak: the article on concurrent users deals with it.

Three profiles, read on the same table

With 2 million tokens a month, a firm that uses the assistant for internal search, the managed service costs 131.67 euro against 795.56: the fixed fee and the management hours do not pay for themselves. With 15 million, a service used all day by many people, the two routes are close (716.67 against 795.56) and the management hours decide: with 2 hours a month instead of 10, the self-run cost falls and the break-even moves below 8 million, so at 15 million the machine of your own is the better choice. With 25 million, a stable and high volume, the self-run cost is lower even with the second machine (1,035.56 against 1,166.67), but the advantage is a little over a hundred euro a month. In none of the three cases does the answer depend on the price of the machine alone.

The exit cost: the item that changes with the Data Act

Regulation (EU) 2023/2854, the Data Act, devotes Chapter VI to switching between data processing services. By "data processing service", Article 2, point (8), means a digital service that is provided to a customer and that enables ubiquitous and on-demand network access to a shared pool of configurable, scalable and elastic computing resources, and recital 81 specifies that the delivery models include IaaS, PaaS and SaaS. The Regulation applies to providers irrespective of their place of establishment, if they serve customers in the Union (Article 1(3), point (f)), and from 12 September 2025 (Article 50).

Three provisions matter for the TCO. Article 25 requires the contract to provide for a mandatory maximum transitional period of 30 calendar days, a notice period not exceeding two months and at least 30 calendar days to retrieve the data; if switching within the 30 days is technically unfeasible, the provider must say so within 14 working days and indicate an alternative transitional period, which shall not exceed seven months (paragraph 4). Article 29 provides that from 11 January 2024 to 12 January 2027 switching charges may only be "reduced", not exceeding the costs directly linked to the switching process, and that from 12 January 2027 none may be imposed at all; the definition of switching charges includes data egress charges (Article 2, point 36). Article 31 instead excludes services custom-built for an individual customer and not offered at broad commercial scale, and non-production versions for testing. On 13 November 2026, the date on which I read the text, 12 January 2027 is still a future date.

In the model the effect is small: the assumed exit fee, 1,500 euro, amortised over 36 months, is worth 41.67 euro a month and moves the break-even from 16.76 to 17.68 million. But the point is not the figure. The Regulation removes a surprise, not the work: the "exportable data" defined in Article 2, point 38, exclude assets or data protected by intellectual property rights, or constituting a trade secret, of providers, so you do not get everything the service can do, and rebuilding the integrations on the new system remains a cost of yours. That is why in the program the migration (2,000 euro) is a separate item. The case of a service that locks documents in proprietary formats is developed in the article on the walled garden.

What the number does not say

The TCO answers "how much", not "where and under which law". A European provider may rely on a processor or on staff in a third country, and in that case Chapter V of the GDPR on transfers comes in: Article 44 sets the general condition, Article 45 allows a transfer to a country with an adequacy decision, Article 46 allows it with appropriate safeguards. The current status of the adequacy decision for the United States and its dates are in the article on reading geopolitical events. These constraints do not enter the monthly cost and for that reason must not be confused with it: a cheaper service may be outside your legal perimeter, and a more expensive one may be inside.

The questions to ask yourself before looking at a number

  • Is the load dominated by repetitive tasks (internal search, classification, summarisation) or does it require complex reasoning that a smaller model cannot do?
  • How many tokens do you process in a real month, and how much does the volume vary between the quietest month and the busiest?
  • Who runs the system today, how many hours a month, at what cost, and what happens when that person is absent?
  • What happens to the data if you change provider: in which format does it come out, in how long, at what fee?
  • Does the data you handle have a constraint on location or provider, by law or by contract with your clients?

The questions are independent, and the order does not change the meaning: each corresponds to a variable of the program or to what the program leaves out. The first three are the parameters to replace (volume, hours, fee), the fourth is the exit item, the fifth is the constraint that no monthly cost measures. If you cannot answer one of the first three, the break-even you compute is an estimate of your ignorance, not of your case.

Frequently asked questions

Is it always cheaper to keep the data in-house?

No. In the test case the managed service costs less up to about 17 million tokens a month, because the fixed fee and the management hours are spread over few tokens. The verdict changes with the volume and with the hours: measure them on your own case before deciding.

Why does management time weigh so much?

Because it is a fixed item that does not appear on the price list. In the program 10 hours a month at 50 euro an hour are worth 500 euro, more than twice the hosting: if you remove this item from the calculation, the break-even moves from 16.76 to 5.65 million tokens and the choice looks more favourable than it is.

What changes on 12 January 2027?

For providers of data processing services, Article 29 of Regulation (EU) 2023/2854 forbids imposing on customers switching charges for moving to other providers. What remains is the cost of your own migration work, and the limit of the exportable data defined in Article 2, point 38.

Does the Data Act also apply to a service hosted outside the Union?

It applies to providers of data processing services that serve customers in the Union, irrespective of their place of establishment (Article 1(3), point (f)). Whether one of your specific services falls within the definition is an assessment to make on the contract and the service, not on the name of the product.

What you can do now

You can break the cost of an infrastructure down into six items, tell the fixed ones from those proportional to volume, and compute with a program the volume at which a pay-per-use service costs as much as a self-run one, replacing the assumptions with your own numbers. You know that management often weighs more than the machine and that cost grows in steps beyond a ceiling. You know what changes in the exit cost on 12 January 2027 and what remains at your expense. And you know that the TCO does not answer the question of where the data sits and under which rule: for that, the series continues with healthcare data.

The series begins with the article on on-prem AI and cloud: privacy, cost and data sovereignty.

Sources

The program was run with Python 3.14.4 (python3 -I), twice, with identical output. All prices, hours, capacity and the exit fee are declared test values, not price lists or measurements. The break-even without the management item (5.65 million) comes from the same program with ore_gestione_mese=0.

Commenti

Caricamento commenti...

Sign in to comment

New articles and tools on Telegram too

The Telegram channel flags the site's new articles and tools.

Did you like this article?

Explore other content on the blog or discover my projects