12 ms·
Build and Deploy Serverless React Apps with Next.js 8 and Zeit Now
- infocollector 8y agoAre there any good NextJS tutorials out there that you can link here? I am looking to learn NextJS. Thanks
- matrix0978 8y agoand you call yourself an info collector...
- Scooty 8y agoThe nextjs website has a tutorial that I found very helpful: https://nextjs.org/learn/ https://nextjs.org/learn/
- siquick 8y agoDefinitely one of the better official tutorials out there
- barbecue_sauce 8y agoI dislike the forced login to read the tutorials. I get that it's a Zeit project, but this smacks of user farming.
- Scooty 8y agoIt bugs me too. When found that link to post, the first thing I thought was "I'm gonna get a comment about this shitty forced signup". It's a good guide though. In a few hours I went from knowing very little about next (not a React/Web beginner though) to getting my hands dirty in the internals.
- exogen 8y agoThe actual reason is far more boring: https://news.ycombinator.com/item?id=19137302 https://news.ycombinator.com/item?id=19137302
- reacttricks 8y agoHere's a large list of Next.js tutorials: https://reactresources.com/topics/nextjs https://reactresources.com/topics/nextjs
- yodon 8y agoConceptually one lambda per page (route) sounds super cool, but in practice I suspect it would lead to a ton of cold start wait times for less common routes
- rozenmd 8y agoSounds like a trade-off for extreme scalability
- bpicolo 8y agoShouldn't change your ability to scale. AWS is happy to clone your single lambda an arbitrary amount of times.
- barbecue_sauce 8y agoThe tradeoff is the cold start wait time vs. easy scaling.
- yodon 8y agoYes, where needed, but I suspect for most people it's just a trade off of getting buzzword compliance in exchange for slow cold start responses
- matrix0978 8y agothese individual pages get compiled into a single file with zero dependencies leading to super fast cold start times. I'm a bot, beep boop.
- painful 8y agoHave you actually found cold-start delays to be an issue with serverless services, or are you just speculating? To my knowledge, the cloud provider keeps enough instances hot based on a forecasted demand. I have not found cold-start delays to be a real issue.
- zdragnar 8y ago
- dane-pgp 8y agoFor apps that just do basic things like read and write to a database (e.g. DynamoDB) would it be possible to go a stage beyond serverless and have the code that runs in the user's browser talk to the database directly? Obviously you'd have to be careful about permissions, and integrate with Cognito, but there are REST APIs for talking to AWS services so I'm sure there are use cases where even the lambdas are not necessary. I don't know what such an architecture would be called, other than "serverlessless".
- cldellow 8y agoDepending on your threat model, absolutely. Cognito supports issuing temporary IAM credentials, so you can have granular permissions, billing and auditing. I debated doing this for a side project but decided it was a little too risky for my use case. For a corporate/intranet thing, though, it'd absolutely be reasonable.
- dustingetz 8y agoyou can’t trust the browser client at all, but setting that aside it isn’t very reliable, much better to queue up commands and then do real work on server (what happens when some third party service is down?)
- zinckiwi 8y agoUntil the introduction of Cloud Function support, I believe that was essentially the execution model for Firebase.
- eranation 8y agoOther than what others mentioned (Cognito with temporary credentials) I think AppSync might be close to what you are looking for https://aws.amazon.com/appsync/ https://aws.amazon.com/appsync/ It has a GraphQL API and supports DynamoDB as a data source
- tirumaraiselvan 8y agoApart from permissions, which can perhaps be solved by temp credentials etc, how do you prevent 1) DDoS: someone fiddling the queries to result in db outage, 2) scale: browsers can't leverage connection pooling so not sure if DB can handle so many client connections.
- cwyers 8y agoThis article hits one of my biggest pet peeves -- _tell the reader what you're about_. Presumably, the reason you have this on the Hasura blog is at least in part lead generation, right? And it worked, in that I showed up on Hasura's website never having heard of them before. But the article makes no effort to tell me what Hasura is before throwing me in the deepend. A link wouldn't go amiss, either. (Yes, I know there's one in the header. It's better to have one in the article text too. Links are free, better to have more than fewer.)
- painful 8y agoI recommend against using Zeit. I tried their offering this year and it was too much in beta. I honestly couldn't even get a basic service deployed because my defined dependencies wouldn't install. My web service deployed fine using the serverless offering of another cloud that I won't name, although it was not AWS. As a disclaimer, I have no conflict of interest.
- Untit1ed 8y agoNow is hit-and-miss for me. Works great for the most part but they seem more focused on moving fast than stability. At one point they (without any warning that I could see) turned on a CDN for all my deployments that didn't take the host header into account... so suddenly all the various URLs leading to my landing page generator all returned a single customer's page. Annoying.
- JMTQp8lwXL 8y agoThey killed their Docker offering right about after they launched it, mostly because it's too difficult/expensive to scale containers, so they forced their entire user base onto the serverless paradigm, because it was convenient for them. Their PR story is it's "better for everyone", except there remain use cases (aka websocket support) that remain unsolved for months on their new platform. To give them credit, they didn't fully deprecate Docker-- old customers can use it, for an indeterminate amount of time.
- nahtnam 8y agoAnyone know of an alternate hosting service that is as simple as including a Dockerfile and changing your DNS, other than Zeit and Heroku?
- Rotareti 8y agoHow about https://github.com/dokku/dokku https://github.com/dokku/dokku ? There is a one-click install for Dokku on digitlocean.
- hurricaneSlider 8y ago
- fulafel 8y agoIs the headline benefit really paying only for use? Trading increased complexity & dev effort for this seems like a backwards development when vm/container/heroku-style hosting is so cheap & getting cheaper.
- tirumaraiselvan 8y agoThe complexity and dev effort is higher initially because the paradigm is so different from "localhost" development. But once the initial boilerplate and yak-shaving work is done, serverless can actually be easier to manage because you deal at a much smaller functional level.
- collyw 8y agoI have never used "serverless", but how does that differ from say a Django app? You have the initial boilerplate setting up the project, then you map urls to functions. Once the initial setup is done its trivial to map a new urls to new functions. I am genuinely curious as I can't really work out what all the hype is about regarding serverless. Am I missing something?
- fulafel 8y agoI think this list can give a helpful picture if you remember that it's written by marketing people at a serverless company: https://serverless.com/blog/when-why-not-use-serverless/ https://serverless.com/blog/when-why-not-use-serverless/ It downplays/skips over the complexity costs from learning, configuring, debugging, deploying, testing, etc the big zoo of woven together cloud services. Ideally you'd also want some dev time and cognitive capacity left over to think about your domain problems...
- tirumaraiselvan 8y agoYes. So in serverless, there is no concept of a long running service. So you can't listen on port 3000 and have any routing within the app. You will rather write one function, add a route to it via API Gateway and then use it in your app. You can probably use django library to help you write code in django style but you can't use it fully for e.g. 1) you can't do migrations in serverless the same way, 2) everytime your function is invoked Django will map the database to models, etc so it could be very slow.
- eoinmurray92 8y agoI love now.sh - its the best developer experience out there and we really really tried to use it at my company - but we kept on having latency issues. It was consistently 5-10x the TTFB of Heroku or an ec2 instance (all in the same locations, or super close).