In the last few days I’m experimenting with substituting CRUD API code with Stored Procedures which directly produce the endpoints JSON as a single-row scalar value. API is then just a wrapper that authenticates, validates input and streams the DB’s JSON directly to the client.
No ORMs, no SQL generators etc.
All SQL is where it should belong: in the database
API does only single „CALL myfunc(…)“ db calls
A simple centralised error handler can accurately report errors from the database
No weird mixed row/json columns scanning into structs and re-marshalling everything to JSON
Codebase is collapsing to 20% (by LOCs)
Stored Procedures can use wonderfully declarative SQL code
Response times in the microseconds, even for multiple queries, all happens inside the DB
More side effects:
the data model can change and evolve without touching the API at all
Zero deploys mean zero downtime
the API application is so tiny, I could easily switch it to any programming language I want (yes, even Common Lisp) without worrying about available databases libraries, type mapping and rewriting tens of thousands of lines of intermixed language/SQL-code.
The general direction of the dev industry is heading in the opposite direction. More ORMs, more layers, more database abstraction. More weird proprietary cloud databases with each their own limited capabilities and query language.
So you tell me: Is it crazy? Is it wrong? Why do I have doubts despite everything working out beautifully?
@encthenet@louis it also means that you're stuck with your database choice for the foreseeable future. I am no fan of ORM, but one of their selling points is the database engine choice flexibility.
@RememberUsAlways there was a version of that story where both neighbors claim that each want the whole plot for themselves, and that each has the goal of exterminating the other with absolutely no intention for compromise. Problem is, one of them is actively working towards that goal (building garden fence, video cameras, Alam systems). the other is not able to build such capabilities, there is busy with doing inconvenient but provocative actions like throwing dead rats or trash.
قريت التعليق دا بكذا صيغة و اضيف عليه منظمة ايتا الانفصالية و حزب العمال الكردستاني ومناضلي تيمور الشرقية الي اخره (قائمة المقاومة\الارهاب طويلة). ياسر عرفات نفسه كان ارهابي لكن اخد نوبل للسلام. طيب فين الانّه؟ الانه مش بس في "وسائل" النضال\المقاومة\الارهاب, لكن في اهدافه المعلنة والمخفية. اهداف المقاومة\الارهاب هي اللي تعرفك ينفع في يوم تصنيفك يتغير وتقعد علي طاولة واحدة مع العدو\الارهابي الاخر؟ بالرغم من ان الافعال قد لا تقود الي النتيجة المطلوبة. لكن النتيجة المطلوبة دائما تقود الافعال
@ButterflyOfFire exactly. the point here is, being labeled as terrorist (or not) does not "on its own" mean anything to final result. for me, what counts, first and foremost, is the target, the end goal. this is what I meant by: الافعال قد لا تقود الي النتيجة المطلوبة. لكن النتيجة المطلوبة دائما تقود الافعال
if you want to be an engineer (end result) in the future, you'd study physics and math NOW. but studying math and physics NOW doesn't guarantee that you'd become an engineer in the future.
Meanwhile #Israel's defence minister, Yoav Gallant, has said Israel will sever all ties with the #Gaza Strip once its war with #Hamas is over -- it would, as he put it, end its "responsibility" for life there.
The #Hamas authorities say #Israeli attacks have now killed more than 4100 people.
Over 1400 Israelis were killed in Hamas' unprecedented extremist attacks within Israel earlier this month
My return to using #Linux full-time has been mostly great. Performance is better from consoles to games, package management means not having over a dozen updaters running and screaming for my attention, and perhaps best of all, no AI malware.
There's still two major, blocking issues that are making this frustrating, though. I don't want to return to Windows, and I'm not willing to buy new hardware to try Apple.
Instead, then, I'm going to post one of those blockers here and plea for help.
We're so used to social media feeding us whatever is trending, that I myself today was a bit like: 'Hey nobody is talking about #Israel and #Hamas here!', then I made a simple hashtag (and with the latest version you can also search simple text), and woo, surprise surprise, a lot of people are posting about it.
I was forgetting a simple rule: reading the news is my responsibility, and looking for people talking about it online is my responsibility too, not the algorithm's.
@SarraceniaWilds@alx maybe I didn't write it clearly. I understand that algorithmic feed can be useful, adjustable...etc if designed in that way (i.e. not evil on its own) but as far as I know, none of the existing social media algorithms do that. I was simply referring to my experience in twitter, where, once it identifies your interests, it's almost impossible to change your feed and slowly becomes a monotonic feed with a couple of topics. comparing that to how mastodon works currently
@ainmosni not that I am aware of. Just out of curiosity, by robocalls, you mean automated calls (e.g. with pre recorded message) or just spoofed numbers but with real person talking?
@AbandonedAmerica people I know usually charge additional 50% of the agreed contract if there is a recording and/or streaming regardless if it's private or public.
@clarablackink@Jorsh@davidaugust sorry to jump in, but my problem is with the attitude of "entitlement" and the selfish approach of "you expect people to treat you fairly [without you treating them fairly]" and "your needs are important [above the needs of everybody else]" 🤷♂️
@clarablackink@Jorsh@davidaugust yes, but it's the "self-evident entitlement" that is the problem. that people need to cater for my needs without asking me to do something in return. access to high quality healthcare, clean water, housing, but without paying high taxes, getting long term gainful employment (with all inconveniences that comes with it) ...etc. so it's not that "I want to be treated fairly", it's the lack of understanding of how the real world works.
@nafnlaus@mistakenotmy sorry to jump in, EPA range tests, there are two options either you follow EPA tests or do your own, Tesla does its own. result is consistently exaggerated. also, the "more-realistic" estimates (i.e. when you add a destination) are still consistently overstated the range. other EVs such as Ford, Chevrolet, Hyundai follow EPA tests and give more consistent and realistic ranges. so yes, it seems #Tesla is cheating with the "fine-print your-milage-can-vary" footnote
#help#fedihelp regarding #ClimateChange research, are there any researches/studies about the direct impact of heating systems to changes in temperature anomalies? I am asking about how, for example, kilometres of heated-water-pipes of district heating passing through cities contribute to heating the planet (not asking indirect impacts via carbon emissions) thanks in advance #climate#ClimateCrisis#renewables#GHG#klimakrise