While this is true, the idea behind this was not merely to collaborate on coal and steel production. The intention from the very beginning was that such tight economic coupling would make war impossible.
Germany has the idea of "Wandel durch Handel" (change through trade)[1], which is essentially that you can prevent and make war non-viable and eventually even change countries to follow democratic norms. The EU is the most extreme version of this.
"By pooling basic production and by instituting a new High Authority, whose decisions will bind France, Germany and other member countries, this proposal will lead to the realization of the first concrete foundation of a European federation indispensable to the preservation of peace."
You don't need a conspiracy theory here when there is a far simpler explanation:
China has 1B potential viewers/customers that hollywood wants as an audience to grow and increase profit, so they'll do their best not to anger the chinese government. As a consequence movies avoid showing China in a bad light and they avoid topic that could get movies censored or forbidden in China.
If you operate at the scale where you consider the performance implications of foreign keys, you probably are not ok with anyone accessing the database or running just any query against it.
It is not realistic that you can trust everyone who needs to access the data with access to the database as they might easily cause problems with poorly written queries.
Additionally you may want invariants maintained, that the database cannot maintain but an application in front of it can.
Also for historical data or analytical queries postgres is not ideal either, so you probably want to move the data into some OLAP database or datalake.
> I can implement a website as a SSR app that talks directly to the db. Maybe tomorrow I decide I need to work on a web scraper that will use python, instead of adding more API endpoints to allow the scraper to talk to the database, I just talk to the database...
If the website and the scraper are just parts of the same application, it makes sense to do this but if they are genuinely different applications. I would use different databases here.
> If you operate at the scale where you consider the performance implications of foreign keys, you probably are not ok with anyone accessing the database or running just any query against it.
I used to work on an application where ALL database accesses were via stored procedures. Genuinly the best dev experience, to me, so far.
> I used to work on an application where ALL database accesses were via stored procedures. Genuinly the best dev experience, to me, so far.
I found such an environment to be simply terrible.
In general, I think stored procs certainly have their place, but if ALL access is through stored procs, you better have a schema that’s basically set in stone otherwise dev will turn into a nightmare.
> Just like API's, databases have tools to allow you to evolve - for example, maintaining views that keep a contract while changing the underlying schema.
What are the database tools for access logs, metrics on throughput, latency, tracing etc.? Not to mention other topics like A/B tests, shadow traffic, authorization, input validation, maintaining invariants across multiple rows or even tables...
Databases often either have no tools for this or they are not quite as good.
- Throughput/latency: pg_stat_statements [1] or Prometheus' exporter [2]
- A/B tests: aren't these frontend things? recording which version a user got is an INSERT
- Auth: row-level security [3] and session variables
- Tracing, shadow traffic: I don't think these are relevant in a "ship your database" setup.
- Valdation: check constraints [4] and triggers [5]
Maybe by some measures they're "not quite as good", but on the other hand you get them for free with PostgreSQL. I've lost count of how many bad internal versions of this stuff I've built.
Honestly, there's plenty of tools out there that can do the same thing.
The important crux of the counterpoint to this article is "if you ship your database, it's now the API" and everything that comes along with that.
All the problems you _think_ you're sidestepping by not building an API, you're actually just compounding further down the line when you need to do things to do your database other than simply "adding columns to a table". :\
Edit: re-reading, the point I didn't make is that having your database be your API _is_ viable, so long as you actually treat it as an API instead of an internal data structure.
It's far from shallow minded. In Germany that's actually how the law is interpreted.
The theory is that under an indirect third party effect free speech becomes effectively limited, if large companies censor people. As a result they can be compelled not to do so within reason. For example, if a social media platform bans you, you can sue them and they have to show that they have sufficient reason and that they gave you opportunity to appeal etc. If they fail, they have to unban you.
The german term you want to look for is "mittelbare Drittwirkung". On this particular topic there is an interesting case from the Bundesgerichtshof about facebook accounts that were banned. German press release: https://juris.bundesgerichtshof.de/cgi-bin/rechtsprechung/do...
A foreign key doesn't necessarily imply an index. If you are using postgres, you would have to add an index in addition to the foreign key, if you want one.
On delete cascade, depending on how many rows it cascades to, can be problematic because it's a very long running blocking operation. That's something one might want to do as a background operation and in batches. Although that won't make it faster.
> A foreign key doesn't necessarily imply an index. If you are using postgres, you would have to add an index in addition to the foreign key, if you want one.
Sure, I meant an index in which the key is primary. But, on second thought, that's probably me misreading the GP's message.
> On delete cascade, depending on how many rows it cascades to, can be problematic because it's a very long running blocking operation. That's something one might want to do as a background operation and in batches. Although that won't make it faster.
That can definitely be a problem (just like destructor deallocation stampedes in C++ or Rust). Still less risky than cascading manually and asynchronously, I suspect.
And if FOSS is not a business, it's excluded from this regulation as well.
If you make business with said FOSS you need to provide security just like how a food truck making food from open recipes has to make sure to not poison people either.
What if you give self baked cookies to a restaurant owner, and he sells them? Then the commercial entity assumes the risks and is supposed to safety check them.
Shockingly it's actually the fact you gave them food poisoning that decides that one. But I wouldn't be surprised if the Europeans thought that in need of fixing too.
There is a difference between being held accountable if your negligence ends up hurting someone vs. proactive audits and reporting requirements - the second has overhead even for those that already have high standards, overhead that is unreasonable outside a business setting.
Proactive audit system seems to be better one to me. It is more predictable - you know in advance which rules you are supposed to follow. It also allows for widely accepted risk standard know in advance to both customers and providers.
The "do what you want and we will punish you hard if luck strikes badly" is less predictable. It has unfair results. It leads to both excessive risk avoidance (because if you are unlucky punishment is disproportionate) and risk taking customer is unable to proactively avoid.
This problem is by no means limited to the US. Germany has that problem as well in rural areas and there government is also providing subsidies to expand broadband access.
Sometimes this can even be a problem in cities when the available infrastructure is at the limit. It's quite possible to move to an area, after having checked that good internet is available and suddenly the provider says no when signing up.
Germany has the idea of "Wandel durch Handel" (change through trade)[1], which is essentially that you can prevent and make war non-viable and eventually even change countries to follow democratic norms. The EU is the most extreme version of this.
[1]: https://en.wikipedia.org/wiki/Wandel_durch_Handel