14 ms·
Four ways to build web apps
- McPoopie24 4y ago[dead]
- CantTouchThis1 4y ago[dead]
- DeeDawg7768 4y ago[dead]
- dgb23 4y agoThis is a nice little overview that is not afraid of being opinionated. It leaves out some of the affordances that CF Pages, Vercel and Netlify provide. (Discussed as option 1 in the article). Those are of course moving targets that provide more stuff every few months.
- razor_router 4y ago[flagged]
- glutamate 4y agoSo sad. So the choice is closed source platform lock-in, a single Linux server with SQLite as database, or kubernetes? -an old man yelling at the cloud.
- paulgb 4y agoOption #4 will give you autoscaling without having to deal with k8s. IIRC all of the options listed still involve writing a Dockerfile, though. Render.com, Cyclic.sh, and Railway.app are also in that category(ish) but will automate the build more like Heroku. (this is off the top of my head, please correct if I misremembered anything)
- jjtheblunt 4y agofly.io can construct the dockerfile and shenanigans for your source code tree, last i saw.
- selcuka 4y agoYes, it can autodetect your framework and generate a basic Dockerfile. Writing a Dockerfile is not harder than deploying to a bare metal server anyway.
- glutamate 4y agoI quite like Docker. It solves the "it works on my machine" problem by being reproducible-enough. And I can still run it locally. My argument is not against innovation but against mindshare capture by platform capitalism.
- fijiaarone 4y agoThe problem with deploying using Docker is that you no longer have any of the advantages of Docker, unless you count a Dockerfile as an advantage. But it’s really just a non-standard way to write shell scripts to configure a system. Deploying using Docker containers means hosting multiple nested operating systems on multiple separate hardware, and then trying to coordinate them, when you most likely actually want them living on the same machine sharing the same loop back interface (like you have during development) or on the same physical or at least logical network with a hardware firewall between them. Instead, when you deploy Docker containers to the cloud, they are on different machines (often in different data centers) connected only by a VPC with only primitive software firewalling and no way to monitor the traffic. Docker is meant to run isolated systems together, to share resources. You get none of that benefit. But the hosting provider does, at your cost.
- bertjk 4y ago> Eliminate the need to manage and inject API tokens into containers and servers and instead authorize containers and servers to perform those operations. What does this look like in practice? Can someone provide example scenarios that this is describing?
- linux2647 4y agoExample: you don’t need AWS keys to write to SQS because the EC2 instance has an identity (“principal”) applied to it, and SQS has been configured trust requests from said identity for some set of queues. It’s typically cloud-specific in the implementation and the resources being requested
- whartung 4y agoDo you know how they make this work?
- oasisbob 4y agoFor example, with containers on AWS ECS: https://docs.aws.amazon.com/AmazonECS/latest/userguide/task-iam-roles.html https://docs.aws.amazon.com/AmazonECS/latest/userguide/task-...
- sebazzz 4y agoSo with environment variables. I had supposed they would create a derived container and put it in a file somewhere.
- tphummel 4y agomy understanding is that the major public clouds operate Public Key Infrastructure on end users' behalf. It feels like magic because there are large teams of very smart and capable people making it feel like magic.
- acedTrex 4y agoSo really we are just recreating windows auth
- margorczynski 4y agoWell there's also another, more oldschool, option - distribution via floppies and CDs. Lot of good zines were distributed this way. Just joking. On a more serious note - it is good to be aware and track how much we are tied to a given service. Because we might end up being taken hostage by the Cloud provider who can extort us for a long time before we manage to migrate.
- glutamate 4y agoyou could also just `apt install nginx docker.io postgresql` then `docker --restart=always ...`
- deleted 4y ago[deleted]
- thepasswordis 4y agoBlog posts like this always strike me as…weird. This seems like “how to build a web app for a very tiny subset of people who don’t want to learn about deploying web apps”. Maybe I’m in a bubble? It seems like 99% of the people I know actually running profitable companies have an infrastructure that roughly matches to “some Linux server somewhere”, and then upward from there it all just moves to AWS/azure, but it’s still just some Linux machines maybe with a load balancer in front of them. If you’re writing software and don’t seem covered by this blog post, don’t feel like you’re out of the loop on something. I think this author is just writing about the subset of the ways that he knows about. I mean honestly “HUGO static sites”…how about a directory of html files hosted by nginx or Apache?
- dgb23 4y ago> I mean honestly “HUGO static sites”…how about a directory of html files hosted by nginx or Apache? Whether you put HTML files on the mentioned services or have a build step with a static site generator is not the point. Where does your nginx server run, how do you keep it up and running, how you do provision it, how do your files end up on the server? You can write a bunch of shell scripts and do all of this on a cheap VM for 5 bucks. Or you can get it for free on some of these services with git integration, global caching, web hooks, previews, cheap storage, image optimization etc. You get unlimited or at least a lot of sites and it's all automatic. On some you can even just drag and drop a directory into their web interface and the website is there in a couple of seconds. It's basically a different layer of abstraction that's free/cheap and works nicely for simple use cases or as a specialized part of a more complex deployment architecture. I have personally recommended netlify, cloudflare etc. to people who have the technical ability to write HTML/CSS or use a static site generator. Those things are very easy to use and carry around less risk than having to provision and configure a web server yourself.
- satvikpendem 4y agoFree, for now. Once the higher interest rate environment becomes more normalized, I would not be surprised to see many services become paid.
- rexreed 4y agoWhy not PHP on a shared or dedicated hosted server?
- FinalBriefing 4y agoI think because that's still very similar to a dedicated server.
- alexklarjr 4y agoand keep data on actual SQL server? No thanks, only boomers do it.
- dgb23 4y agoI wouldn't recommend PHP to anyone who isn't already invested/emerged in the language. Wordpress for blogs or websites on a shared host with automatic updates and a few select plugins? Yes. Laravel or Symphony for applications? Ok. But just PHP has way too many footguns and doesn't provide nearly enough affordances to make them worth it IMO. Plus it's a language that breaks backwards compatibility way too often, stops support for older versions. You need some sort of protection layer that shields you from all of this. So you might end up with something that is way more complex and slow than it needs to be.
- arcturus17 4y agoI could do this, or I could just throw good old React or a derivative framework at whatever UI I have to build and be done with it.
- omarfarooq 4y agoHow does that solve for backend? This mentions web apps.
- bryancoxwell 4y agoA UI is not a web app.
- jraph 4y ago> and be done with it That's how I feel when I write a bunch of HTML and CSS files and send this to prod. Less so with an app written with a JS framework of which I now need to maintain the dependencies.
- flippinburgers 4y agoHis ordering is all wrong. Lambda-like websites are significantly more difficult to program and manage than a monolithic linux server. Graduating from the lambda to the linux server? No thanks.
- deleted 4y ago[deleted]
- fijiaarone 4y agoHe’s talking about serverless functions for a contact form.
- siquick 4y agoWhere would you host a container based Node API that connects to a non-public Postgres database?
- auspex 4y agoAWS Fargate connecting to RDS
- deleted 4y ago[deleted]
- notmars 4y agoGoogle CloudRun with direct serverless VPC access of a CloudSQL instance with no public IPs
- alex_suzuki 4y agoI use AWS AppRunner with Docker. It understands Node.js natively also, I think.
- webjunkie 4y agoJust if you're interested in AWS: look into AWS Copilot CLI to get started really fast with getting a container up (and have a database with it).
- vcryan 4y agoI agree with this, except I would take 3 out of the list.
- 2h 4y ago3 is the most attractive option to me. I have a tiny localhost server I wrote, and have been looking for a simple way to deploy
- DangitBobby 4y agoConsider creating a tunnel with Cloudflare Argo (think more sophisticated ngrok). I just finished deploying a toy app from a local machine about 15 minutes ago.
- 2h 4y agoI read this entire page, and it doesn't offer what I am wanting at all. I have a localhost server, that I want to deploy so it's publicly accessible, like option 3 in the original article. https://www.cloudflare.com/products/argo-smart-routing/ https://www.cloudflare.com/products/argo-smart-routing/
- DangitBobby 4y agoMaybe the branding is a bit opaque, you might have more luck searching for Cloudflare Tunnels since they've changed some names. That's probably my bad for not using the word "Tunnel" in my original comment. Here's a blog post describing the product [1], and here's a link right into the middle of CLI docs to a command where they publish a site from localhost, and here's [3] a link to my crappy "blog" post that summarizes the process. Like I said, I literally just deployed apps from localhost yesterday and today. 1. https://blog.cloudflare.com/argo-tunnel/ https://blog.cloudflare.com/argo-tunnel/ 2. https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/local/run-tunnel/ https://developers.cloudflare.com/cloudflare-one/connections... 3. https://blog.jorissen.xyz/posts/self-hosting-with-cloudflare-argo/ https://blog.jorissen.xyz/posts/self-hosting-with-cloudflare...
- selcuka 4y agoI guess the title should have been "Four Ways to Deploy Web Apps", not "build" them. Granted, option #2 (functions) is a different beast, but all others can be built the same way but deployed differently. For example - You can develop a static (Hugo) web site then deploy it on Fly.io using containers. or - You can develop a container based web site, then deploy it on a bare Linux server (k8s is not necessary for a few containers).
- toastal 4y agoSkip the containers and have it all be reproducible with Nix/Guix
- deleted 4y ago[deleted]
- oldstrangers 4y ago5th option: Webflow, airtable, whalesync. I could recreate one of his examples (https://oldgames.win/ https://oldgames.win/) in 10-20 minutes off just a CSV file... And I could use something like https://simplescraper.io/ https://simplescraper.io/ to scrape that data + find imagery.
- monroewalker 4y agoSurprised not to see Render.com listed under option 4 despite that being an option discussed often here with comparable simplicity of deployment to Heroku
- tnzk 4y agoI love Render, have been using it heavily personally as well as professionally. I like it for fulfilling my demands efficiently. But I sometimes find the name is a pain point, it is really hard to search especially combined with some generic words. It seems fixed now but I remember at some point of time even "render status" wouldn't lead me to the right place.
- anurag 4y agoIt's getting better every day!
- graycat 4y agoMy Web site is designed and programmed and runs as intended. I was delayed by independent events, beat those back, and now am collecting some initial data. But from the original post (OP) about "Four Ways" here, apparently I made a really big mistake, nope several biggies: I wrote the software using Windows 7 Professional, Visual Basic .NET, ASP.NET, ADO.NET, and SQL Server. What a user receives is old HTML and some CSS with little, maybe no, JavaScript. I didn't write any JavaScript at all, but ASP.NET wrote a little for me. At one point, I wanted a key-value store so used two instances of one of the .NET collection classes instead of Redis. That was a biggie mistake? So, apparently my work is none of the "Four Ways" of the OP. Biggie mistakes, right??? I don't get it: Looks to me like for some decades now, all around the world, people have been able to build (program, develop, etc.) Web sites using Windows 7, .NET, SQL Server. E.g., as I recall, Markus Frind developed a Web site using those tools, had the usage grow, ..., and sold the site for $500+ million. He did something wrong? Now there are some rules I don't know about, rules that say I must just junk my code, 100,000 lines of typing, and start over????? Those "Four Ways", they include something for my use of collection classes as simple versions of Redis? Or they include Redis? Oh, at it's core, my Web site has some original applied math -- those "Four Ways" have that already? I didn't get the memo that I can't use Windows 7, .NET, and SQL Server!!! What am I supposed to do, use better than Windows 7 Professional, .NET, SQL Server, and my applied math code????
- arsome 4y agoLearning dozens specific cloud services and shelling out money everywhere I go is way less appealing to me than buying a cheap dedicated server and firing up exactly what I need. It'll take me far longer to figure out what FarGate and Cloudflare Pages and all these are and infinitely longer to keep up with the latest and greatest because it keeps changing constantly. And even once I get it, I'll have very limited control or understanding of my stack, and migration? I'm screwed. I'm not interested in playing games like that. nginx is comparatively simple, run it, it serves. Config is easy, learn it once, run it anywhere, it doesn't get a dozen new features and breaking changes every month, just does its job. I guess I'd just rather understand the real underlying technologies than some crappy commercial wrapper for them that will differ every time someone tries to rip me off.
- nindalf 4y agoFor what it’s worth, there isn’t much to learn with cloudflare pages. You grant it Oauth access to a particular repo, it builds master and serves the output directory. Only thing you specify is the build command and the output directory. For example “hugo build”/“npm run build” and directory “out/“. I use it for a few reasons. I like that it’s free and the hosting of the static content is at the edge. They also take care of some things automatically, like compressing the assets once at build time and serving them with the right headers. I don’t think this is unique. I believe netlify and others have similar offerings. These providers are excellent for the use case of serving static content at low latency and low cost.
- pantulis 4y agoThat's the "Linux Server Singleton" pattern from the FA, isn't it? I find it surprising that it's in 3rd position. While SSG looks simple enough to merit the first position, going with the Cloudflare serverless proposition as the next step for beginners feels strange to me. I think you would be able to "graduate" to serverless-edge functions after you grok the traditional web client/server approach, not before.
- ZephyrBlu 4y ago1) Almost all of these services have generous free tiers. Even if you're running a relatively high traffic site your bill will be practically $0. 2) These technologies are stable and usually not that complicated. You are missing out on a lot of productivity by not looking into them. Understanding the "real underlying technologies" is a myth. The "underlying technologies" are constantly changing, unless you are using an extremely outdated stack: https://www.youtube.com/live/hWjT_OOBdOc?feature=share https://www.youtube.com/live/hWjT_OOBdOc?feature=share.
- dzink 4y agoWhy recommend lock-in vendors when there are better options in between? There was no mention of Heroku which is easy and scalable. Hugo is wonderful, until a deployment bug or misconfiguration exposes all of your server settings in a page that should be serving a 404 instead. Wordpress, Hugo and others also get constant attacks from hackers who can exploit each bug found on thousands of sites all at once. Go has fantastic server examples and plenty of starter templates you can use to build your own server, and deploy to Heroku and scale to millions of users far cheaper in engineering and financial terms.
- Swalden123 4y agoSeems overly complicated. Easier way > HTML + CSS + Javascript (vanilla or framework) + Server side language of choice. Deploying is not building.
- sophiabits 4y agoA particular application of #2 which works well as an extension of #3 is to have your workers implement a lightweight backend-for-frontend layer in between your frontend and more traditional API This approach works pretty well when you have a pre-existing API and need to, say, minimize # of round trips to fetch data without wanting to couple your frontend(s)<->backend too tightly.
- zoomzoom 4y agoIn bucket number four, there’s also the option of a PaaS experience in your own cloud. Of course there are always trade-offs on control and complexity, but if you want to deploy to fargate or Google Cloud Run, without getting bogged down in writing pipelines and infra as code, and you want to get the Vercel-level developer experience that we all are getting used to - check out this category of tools. Including one where I’m a cofounder - withcoherence.com! Feel free to ping hn@withcoherence.com if we can answer any questions or help you get running…
- techaqua 4y ago0th way: php scripts on shared web hosting. it still exists.
- coolhand2120 4y agoAnother option is to use S3 + Cloudfront + SPA with your services running as web socket lambdas.
- MicBase45 4y ago[dead]
- DoodieButt33 4y ago[dead]
- LoudMouth2 4y ago[dead]
- TheBrickStall 4y ago[dead]
- LittleRooster09 4y ago[dead]
- PooFace45 4y ago[dead]
- TheSniffer55 4y ago[flagged]
- CrazyLegs78 4y ago[dead]
- StinkyPete56 4y ago[dead]
- BennyNana67 4y ago[dead]
- LegsOnKegs 4y ago[dead]
- DirtyHarry67 4y ago[dead]
- KissMyAxe 4y ago[dead]
- SourDiesel34 4y ago[dead]
- FatsoKid34 4y ago[dead]
- CallMeMaybe45 4y ago[dead]
- DeezPeez099 4y ago[dead]
- PoopedMyPants56 4y ago[dead]
- SnoopD5678 4y ago[dead]
- DontBeASnoop 4y ago[dead]
- ForeverBored9 4y ago[flagged]
- BurningDesire 4y ago[dead]
- InsecureButter4 4y ago[dead]
- StinkyFeet900 4y ago[dead]
- TacoBelle78 4y ago[dead]
- BeerGut09 4y ago[dead]
- LazyBum17 4y ago[flagged]
- DirtyPutter08 4y ago[dead]
- SmellyPants70 4y ago[dead]
- HairyHarry09 4y ago[flagged]
- 2OldForIt 4y ago[dead]
- LazeCraze56 4y ago[dead]
- SillyDuckling0 4y ago[dead]
- TeacherPet09 4y ago[dead]
- LuckyDuck09 4y ago[dead]
- SlyGoose3 4y ago[dead]
- DoctorNerd09 4y ago[dead]
- SnitchySnitch12 4y ago[dead]
- NotABaby70 4y ago[dead]
- DontBeAScared 4y ago[flagged]
- OnTheRocks4 4y ago[dead]
- TacoBellDiego 4y ago[dead]
- SupremeDud09 4y ago[dead]
- deleted 4y ago[deleted]
- SereneBeauty7 4y ago[flagged]
- PlayfulSpirit5 4y ago[dead]
- QuietConfidence 4y ago[dead]