No video

Why I Stopped Using Backend Frameworks

  Рет қаралды 9,550

Ben Davis

Ben Davis

Күн бұрын

This is basically just me explaining why the "double backend" thing is often not great (and I generally don't like it anymore) and which I've moved to full stack JS (sveltekit or nextjs or remix or htmx).
TD:DR: full stack frameworks are good
my stuff
discord: / discord
x (twitter): / bmdavis419
insiderviz: www.insiderviz...
blok: www.theblokapp...

Пікірлер: 114
@t3dotgg
@t3dotgg 7 ай бұрын
Thankful more people are saying this. The future is full stack, and these tools make it so much better
@Metruzanca
@Metruzanca 7 ай бұрын
Wild Theo appears. Ben's getting attention he deserves.
@pawel_890
@pawel_890 7 ай бұрын
Fullstack is back to the past :)
@aadarshkumarshah8795
@aadarshkumarshah8795 7 ай бұрын
Don't tell me about the future...people know nothing
@eptic-c
@eptic-c 6 ай бұрын
"The future is full stack". It always was, client side rendering is, was and will always be dumb.
@pawel_890
@pawel_890 7 ай бұрын
Oh shit, here we go again. 1-2 years and we will find that decoupled services are better.
@bmdavis419
@bmdavis419 7 ай бұрын
If they make a way for me to get end to end typesafety from Go to TS then yea 100%, but with what is here now? Fullstack all day
@mpiorowski
@mpiorowski 7 ай бұрын
There is an option for typesafety between Go and TS - gRPC :) It generates types for both Go and TS, and it is the data that is beeing send, so nothing is beeing ommited here@@bmdavis419
@dyto2287
@dyto2287 7 ай бұрын
@@bmdavis419 **cough** code generation **cough** gRPC **cough** OpenAPI **cough** 😂
@Mikenight120
@Mikenight120 7 ай бұрын
Not an expert, but wouldnt gRPC provide you type safety end to end between Go and Typescript?
@pawel_890
@pawel_890 7 ай бұрын
@@Mikenight120 author removes comments like this
@The6DAZ6
@The6DAZ6 7 ай бұрын
Answer: because you are a frontender
@georgiyanev7822
@georgiyanev7822 7 ай бұрын
Did you even watch the video? The dude prefer the FullStack framework, a FS framework is still a backend(Laravel is also a FS framework what you write there? FE code?). What he means is that in the server you fetch the data from the DB and send it as a response and in the client you again fetch the same data and parse it and he is saying that it is better to skip second step, which is leading us to SSR which is the traditional way to create apps. You fetch the data and send the HTML directly and you don't need to fetch again on the FE. He likes Meta Frameworks for JSX because he doesn't like HTMX(which can be used in PHP, GO, Python and so on), that way he can return JSX instead of HTML. What is so hard to understand lol.
@The6DAZ6
@The6DAZ6 7 ай бұрын
@@georgiyanev7822 I did. The problem with all the statements is that the frameworks you quoted (just for example, is not for saying that are bad choices or to go against you) run on interpreter sacrificing speed and control over the machine for dx. The reason why he is going for full-stack frameworks is that he needs and want to create a website. He doesn't really care of the rest nor the speed nor the scalability. Basically he is approaching the problem as a frontender and creating first the client and then the infrastructure. Personally I would made a go server and serve the page statically /using templates, as the application scales you can detouch an API part and the fe into separate threads and use the apis for mobile apps ecc... 😅
@theuser384
@theuser384 6 ай бұрын
@@georgiyanev7822 Inertia and its (even GO is there) adapters can solve that, it works as a glue for both sides and reduces a lot of complexity.
@Ahduciekwndnbbbsvvvghhhyyyyy
@Ahduciekwndnbbbsvvvghhhyyyyy 4 ай бұрын
@@The6DAZ6great comment. interesting to see it from that perspective.
@The6DAZ6
@The6DAZ6 4 ай бұрын
@@Ahduciekwndnbbbsvvvghhhyyyyy Thanks ^^
@tobias--
@tobias-- 7 ай бұрын
SvelteKit is great, and the idea of building fullstack apps with good SSR experience is definitely something worth giving a try. The thing is, the more bussiness logic you have, the less applicable the fullstack technologies are. Using such fullstack frameworks for something more complex than e-commerce sounds like a complete madness to me.
@readywhen
@readywhen 7 ай бұрын
When I look at software architects and how cleanly they implement smth like monoliths in .NET, I just feel like a total mess working with a framework -- or at least if I imagine scaling up. It makes me want to learn more and more and more... but I'm at the point where I just got to pick a technology and stick with it.
@jatiquep5543
@jatiquep5543 7 ай бұрын
I do not agree with you
@tobyCornish
@tobyCornish 7 ай бұрын
I don't remember him saying "this is the best solution in all circumstances without exception"
@ooijaz6063
@ooijaz6063 7 ай бұрын
What about handling bff data in full stack framework and business logic inside of proper backend language?
@bmdavis419
@bmdavis419 7 ай бұрын
it definitely has a limit, but I would argue that the ceiling is a lot higher than you think, at work we have some MASSIVE projects in fullstack JS t3 stack projects that work great (one was basically a linkedin clone)
@lcarv20
@lcarv20 7 ай бұрын
The only downside is when you want to go beyond web (like mobile, tv or whatever) Then you will have to maintain two separate “backends”. But if it’s only web I agree
@bmdavis419
@bmdavis419 7 ай бұрын
yea expect a video about this soon, mobile does need a seperate backend, go might be coming back lol
@strmchsr1537
@strmchsr1537 7 ай бұрын
Why, you can add api routes in your routes folder like /routes/api/v1/whatever/+server.ts to make external api routes. They'll perhaps have some different (authentication) logic but it still all in your one environment.
@Leeway4434
@Leeway4434 7 ай бұрын
You just architect your code with repository pattern and you can have a json API adapted from what your html API already uses
@captainnoyaux
@captainnoyaux 7 ай бұрын
why would mobile need a specific backend ? I never encountered that case (10+ years of experience)
@Leeway4434
@Leeway4434 7 ай бұрын
@@captainnoyaux we are talking about using something like htmx for a web app. Unless you want to render your mobile app in a web view, you will need a json adapter for your API to build out the mobile screens with native UI components for iOS/android
@viniciusmachadorodrigues1724
@viniciusmachadorodrigues1724 7 ай бұрын
I dont believe js should be used to on the server
@Zuranthus
@Zuranthus 3 ай бұрын
i bet you don't like pineapple on pizza either >:(
@austincodes
@austincodes 7 ай бұрын
Full stack is the only way to go with small teams
@eileennoonan771
@eileennoonan771 7 ай бұрын
I’m a fan of go+htmx atm but I totally agree full stack / monolith is the way to go unless and until there’s some pressing reason to change
@n8o_
@n8o_ 7 ай бұрын
Is Go+HTMX... not fullstack/a monolith itself?
@eileennoonan771
@eileennoonan771 7 ай бұрын
@@n8o_ yes it is. The "but" is just in contrast to Ben having recently moved from Go to Sveltekit and saying he just isn't into HTMX, which is all good. Different strokes and whatnot
@dovh49
@dovh49 7 ай бұрын
What's nice about HTMX is that you can make your back end into microservices and still use HTMX, so HTMX doesn't necessitate a monolith on the back end. Also, you can have the SPA on the front end with HTMX and have the front end be a micro front end - it is much easier to have a micro front end with HTMX than it is with React, et. al., where with React you are creating monoliths on the front end. Yes, you can break up React, but it is much more difficult.
@gadgetboyplaysmc
@gadgetboyplaysmc 7 ай бұрын
Reason why I'm still writing separate backends for some apps is because I do more than just REST APIs that return data. When you need a stateful and persistent backend for usecases like websockets, server sent events, and CRON jobs, I feel like you'd still have to use it. Is this wrong? I know Vercel has those options but I still prefer to host on a VPS tbh. Also because sometimes of a requirement to write a different app that will consume that API.
@bmdavis419
@bmdavis419 7 ай бұрын
This is actually a good point and something I should have probably mentioned. In serverless land (which is where I'm living more and more) most of that stuff does end up needing to be done with either a server (for stateful stuff) or with a server (websocket service). Vercel has stuff for CRON jobs which I recommend, but yea u do loose state on the server which CAN be an L, although I'd argue it is less of an L then people think
@ginjaturtles
@ginjaturtles 7 ай бұрын
I definitely understand the sentiment for coupling full stack. Especially for small teams and startups, next js + backend as as service (supabase etc) allows you to hit market very fast. I've written next JS app before which had a landing page, stripe checkout etc. It's a great DX experience I personally just don't enjoy writing JS/TS everywhere (but if I have had to pay the bills this way I would) I definitely prefer something like C# or Go on the back end. I need to give Go + HTMX a try sometime but haven't because I really enjoy component libraries like ShadCN because I suck at design. Also, to remedy your frustrations couldn't use an interface on the front end for type safety or consider using something like GRPC? Anyways great video keep building cool stuff
@readywhen
@readywhen 7 ай бұрын
5:00 I agree. I'd say having fullstack devs where each has a distinct strength within the spectrum is the way to go. So for example, more of a back-end-like full-stacker vs more of a front-end/designer-like full-stacker.
@bmdavis419
@bmdavis419 7 ай бұрын
This is what we have, everyone has strengths, but we can each handle everything
@TheJubeiam
@TheJubeiam 7 ай бұрын
This is valid but only for pure landing pages
@bmdavis419
@bmdavis419 7 ай бұрын
This is the exact same thing I once thought. And it is just wrong, there are a huge number of real apps built with fullstack JS, I have built/published many myself
@gadgetboyplaysmc
@gadgetboyplaysmc 7 ай бұрын
In what world would you ever write REST for a landing page?
@zakraw
@zakraw 7 ай бұрын
Htmx needs a backend framework, the thumbnail is kinda confusing
@bmdavis419
@bmdavis419 7 ай бұрын
Yea its the best stand in I could think of for fullstack Go
@iBezlepkin
@iBezlepkin Ай бұрын
I agree with you completely. I did NestJs + Angular in my project, now I regret it..... I should have done MPA in PHP or NodeJs and not complicate everything
@robpando8086
@robpando8086 7 ай бұрын
Basically you like monoliths is what I hear you saying fullstack. I definitely agree it is the productive way that people have always done fast and amazing things with for so long, its just hilarious we have gone full circle now. I personally prefer the more backend monoliths like Elixir/Phoenix or RoR.
@bmdavis419
@bmdavis419 7 ай бұрын
I am more arguing for full stack type safety, but yea monoliths are also better then 20 different codebases
@dyto2287
@dyto2287 7 ай бұрын
I use grpc separate backend API and connect it to my sveltekit directly. Works quite well when API client gets generated and there is no duplication of code. And I can create more API endpoints on sveltekit that are needed only for web, making SvelteKit similar to BFF (backend-for-frontend) & frontend combo.
@yazidridwan6917
@yazidridwan6917 7 ай бұрын
i dont quite know grpc and kinds of web tech, "when api client get generated" is it equivalent to api docs ? the duplication of code in the video I think it's when you typed the structure of the response api call in frontend.
@dyto2287
@dyto2287 7 ай бұрын
@@yazidridwan6917 It basically generates client class, methods and data types you pass to those methods. You can implement server in one language and generate client for any other programming language.
@sleepyslothsocietyofficial2914
@sleepyslothsocietyofficial2914 7 ай бұрын
tip: for hono you can export the type and instantiate a client which guarantees typesafety when calling your API. You can also add zod validators.
@CodeZakk
@CodeZakk 7 ай бұрын
Yeah that is true. But if your hosting company doesn't support edge functions does it still work. Also should you use api folder in all cases when you use fullstack frameworks like nextjs?❤
@bmdavis419
@bmdavis419 7 ай бұрын
Nah u don't need edge, just serverless (which any major hosting provider has). For nextjs I would just run my logic in my components (server components)
@RemotHuman
@RemotHuman 7 ай бұрын
Is rails, php. django etc full stack as well? I think so. I think the whole backend/fronted distinction might be a relatively recent concept
@bmdavis419
@bmdavis419 7 ай бұрын
Yea, these terms are not well defined anymore, and even saying "backend framework" in the title is kinda wrong, b/c like u can use SvelteKit or Next as a normal rest api
@riendlyf
@riendlyf 7 ай бұрын
Hope there will be a good DX in go ecosystem in near future, maybe it will be htmx idk
@bmdavis419
@bmdavis419 7 ай бұрын
Its probably HTMX, unless they make something to TRPC style connect Go + TS, which seems VERY unlikely
@Darbokst
@Darbokst 6 ай бұрын
such an on point opinion.
@ThingEngineer
@ThingEngineer 7 ай бұрын
I haven't been this excited about the direction DX is starting to go since jQuery went stable and I thought I had super powers. (realized I had...)
@knofi7052
@knofi7052 7 ай бұрын
I don't get it. Who needs more than a console as a front end? 😂
@daveoki
@daveoki 3 ай бұрын
This is a problem I often see with inexperienced or front-end fullstack-wannabe developers who don't know much beyond dom manipulation and API integration. Most tend to think backend development is all about building apis. Now that they have API routers they call themselves full stack developers. An API is just an interface that allows other applications to communicate with the backend. It's not thee "backend". What we have are tools so pick the best one for the job. If you understand the history of software engineering, then you'll appreciate why all these technologies exist.
@enesbala5195
@enesbala5195 2 ай бұрын
Funnily enough I have been using Sveltekit and been stuck with the same pain of creating API endpoints everywhere and with very little Type Safety - having to still go through the fetch(endpoint, body) dance and custom validations everywhere. I think Astro Actions that just dropped may be a good solution, but I am starting to feel that Sveltekit is failing to address this issue. I would love to get your opinion on this - subscribing just in case.
@Glitch-txs
@Glitch-txs 7 ай бұрын
The only reason I could have a separated backend is for strict security, e.g. I'm a bit scared of having backend envs around a metaframework
@sandersonstabo
@sandersonstabo 7 ай бұрын
SvelteKit allows you to flag envs as backend only, and if you try to import it from the frontend you will get an error stopping you
@duznt-xizt
@duznt-xizt 7 ай бұрын
api client generation is the way to go
@boccobadz
@boccobadz 6 ай бұрын
Sveltekit is a game changer and the way to go forward. That or Go + HTMX (throw in templ). You don't need anything else. Let's retire the mess that React became and force all those "react devs" to learn proper CS/engineering practices.
@bmdavis419
@bmdavis419 6 ай бұрын
templ makes a world of difference
@IvanRandomDude
@IvanRandomDude 7 ай бұрын
Laravel is king
@dandogamer
@dandogamer 5 ай бұрын
I'm using astro + grpc and had no problems with it. Feels productive and I dont have to write yucky JS on the server
@bmdavis419
@bmdavis419 5 ай бұрын
Grpc is more productive then writing db.findMany() at the top of your file? 🤨
@dandogamer
@dandogamer 5 ай бұрын
@@bmdavis419 bit of a disappointing reply as grpc hasnt got anything to do with querying data from a database.
@armanradan
@armanradan 7 ай бұрын
I'm on your side about using full stack frameworks but I prefer using backend languages in frontend instead of js/ts for backend. And it's possible through web assembly. My personal choice is leptos.
@victormendoza3295
@victormendoza3295 7 ай бұрын
What are the pros and cons of adapter static on s3? Does that mean im missing the full stack backend? I think you can do go on the frontend with wasm containers. When i worked on a ship, deff had to have everything cached to the server.
@bmdavis419
@bmdavis419 7 ай бұрын
Static adapter just means that like ur serving static stuff, so full SPA, no server attached. You cannot do what I'm talking about in this video that way and would need a seperate backend
@mauricioe.matamoros8993
@mauricioe.matamoros8993 7 ай бұрын
I prefer my backend and front end being agnostic from each. Even my db. Writing all the rules inside the db instead of the backend.
@dole-kf5tg
@dole-kf5tg Ай бұрын
To solve the problem you have that is lack of expressiveness in the contract (between BE and FE), you are advocating for just getting rid of the contract and have everything into one giant tangled ball, where the alternative is having a working contract, a working process between teams. This will work only up to the point where the app is small enough to fit the inner workings in everyone's brains. The moment it grows bigger, nobody will have full context of anything, and development will slow to a crawl, everyone stepping on others' feet. In my experience, the complexity accumulates quite fast. If you just do this, I guess it would end up an unmaintainable mess by the 1 year or 2 year mark.
@sidekick3rida
@sidekick3rida 6 ай бұрын
By "full-stack" you mean "full-stack js" or "isometric."
@MrJfergs
@MrJfergs 7 ай бұрын
I suppose if you have 1 client this is likely the most efficient approach.
@oussamasethoum1665
@oussamasethoum1665 7 ай бұрын
what about realtime stuff? and dashboards etc?
@berndeveloper
@berndeveloper 7 ай бұрын
This is a good solution only for small teams and small projects, ideally for MVP. You need to be a backend dev to understand it. EDIT: I'm fullstack dev btw.
@nexovec
@nexovec 7 ай бұрын
You can just use a modular monolith design and use NATS for routing requests to the api running in the same app. It produces apps you can actually run a debugger on. It also makes it possible to hand roll request tracing. The event bus also functions as a storage layer so you can dump logs into it. Unless you have literally 100s of thousands of CONCURRENT users, this works fine. You still have too many levels of indirection for my taste(e.g. html renderer -> NATS -> logical endpoint -> ORM -> SQL - jesus), but it's way better than convoluted python javascript stacks with thousands of packages that run slower than your grandmother.
@bmdavis419
@bmdavis419 7 ай бұрын
Yea but like I would rather just use SvelteKit or NextJS or Nuxt, like JS has its problems obviously but the idea it can't handle anything above a toy app is silly
@nexovec
@nexovec 7 ай бұрын
@@bmdavis419 well in this case you don't have to use the backend parts of your program. You don't have to touch the routing at all, for me the 'frontend' part is just a golang server, so I do my database lookups directly there. EDIT: Presumably the same can be done in js?
@LucasAlexK
@LucasAlexK 7 ай бұрын
Would you care showing some examples of business logic in your JS full stack app and it working "really freaking well" like you said?
@bmdavis419
@bmdavis419 7 ай бұрын
Yea: github.com/bmdavis419/SvelteKit-Ecommerce, I also have multiple in development that are not public yet. Also a ton of big sites work like this (vercel, upload thing, and a lot more)
@impostor8984
@impostor8984 7 ай бұрын
what do you think of fastify microservices + trpc in a monorepo with frontend
@bmdavis419
@bmdavis419 7 ай бұрын
Would work great, but still would probably be more of a pain than SvelteKit or NextJS app dir, for very little gain b/c ur not leaving TS land
@impostor8984
@impostor8984 7 ай бұрын
@@bmdavis419 how would sveltekit or nextjs work tho if i wanted a mobile app, do i have to rewrite the backend again?
@taquanminhlong
@taquanminhlong 7 ай бұрын
I prefer a separate backend because js can't solve problem perfectly Even just proxying the request, rust helps reduce the js server's response time from 100-200ms to around 1-20ms Htmx with pure rust is even faster, around micro seconds
@bmdavis419
@bmdavis419 7 ай бұрын
while true, not to be that guy but why? does 80ms really matter if it is 100x harder to build stuff?
@FabuBrik
@FabuBrik 7 ай бұрын
You lost me at the backend devs writing CSS. 😂
@bmdavis419
@bmdavis419 7 ай бұрын
hey man I've gotten better at it
@darah.k3221
@darah.k3221 3 ай бұрын
Go is not good for prototype
@mintdev
@mintdev 7 ай бұрын
You should try Laravel 😊
@georgesava9092
@georgesava9092 7 ай бұрын
Why would you use JS for the backend? Except as a junior trying to learn backend? JS is a horrible language for a backend language. Go, on the other hand, simple and powerful language
@bmdavis419
@bmdavis419 7 ай бұрын
This just isn't true, and let me to over complicating the hell out of multiple projects, and more often then u think JS would get it done JS servers/backends do not explode if you have more then 5 users, I unironically thought this for a long time, its not true. They may never go quite as far as Go, but they can go pretty damn far, certainly far enough to build a business
@solomonogu1393
@solomonogu1393 Ай бұрын
Go is not easy
@user-xj5gz7ln3q
@user-xj5gz7ln3q 7 ай бұрын
Typescript.. ewww..
How and Why I Rebuilt my SAAS App
13:24
Ben Davis
Рет қаралды 20 М.
2024 JS Backend Frameworks Are Getting Weird...
31:06
Ben Davis
Рет қаралды 14 М.
Meet the one boy from the Ronaldo edit in India
00:30
Younes Zarou
Рет қаралды 19 МЛН
Incredible Dog Rescues Kittens from Bus - Inspiring Story #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 28 МЛН
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 37 МЛН
7 Days Stranded In A Cave
17:59
MrBeast
Рет қаралды 95 МЛН
Svelte 5 is Bigger Than You Think
9:35
Ben Davis
Рет қаралды 20 М.
Theo Browne: Next.js is a backend framework
11:44
Vercel
Рет қаралды 155 М.
i didn't know these Svelte tips
18:56
Nev the Dev
Рет қаралды 5 М.
Bash? Nah, I Have Bun.
12:38
Theo - t3․gg
Рет қаралды 72 М.
JavaScript Framework Tier List
40:57
Theo - t3․gg
Рет қаралды 324 М.
From React To HTMX
40:01
ThePrimeTime
Рет қаралды 323 М.
What is the BEST Backend Language For You?
6:26
conaticus
Рет қаралды 125 М.
UI Libraries Are Dying, Here's Why
13:28
Theo - t3․gg
Рет қаралды 304 М.
Mobile App Development is Hard
16:29
Ben Davis
Рет қаралды 6 М.
5 Things I Wish I Knew When I Started Using SvelteKit
7:27
Ben Davis
Рет қаралды 14 М.
Meet the one boy from the Ronaldo edit in India
00:30
Younes Zarou
Рет қаралды 19 МЛН