News for hackers. Stuff that matters.
Re:Netlify raises $53M Series C as microservices approach to... by veeralpatel979 on Friday March 06, 2020 @09:05PM (#22509235)
I've used Netlify as a "Heroku for static sites".

I deploy my React apps and landing pages there and don't need to worry about the underlying compute, or load balancing, or anything else. Thankfully I didn't do any frontend work before Netlify was available!

I don't really get all the hype around the Jamstack (https://jamstack.org/), though.

Netlify's hypothesis seems to be that if you deploy websites on CDNs, instead of on web servers, then you'll get better performance.

Also, because it's just a static site, there's no backend or database, so you get better security.

I accept this hypothesis, but it seems like you still need a backend. Netlify is promoting functions as a service [1] so you can avoid having web servers for the backend too, but I'm a little skeptical you get the flexibility to build applications with dependencies or non-trivial business logic or design with this approach.

If anyone's tried a FaaS and this is incorrect, please describe your experience!

[1] https://www.netlify.com/products/functions/

Re:Netlify raises $53M Series C as microservices approach to... by jacobpake on Friday March 06, 2020 @09:32PM (#22509321)
In my experience you can achieve a lot with FaaS - but you still need an API, database and storage - which Netlify Functions doesn’t offer out of the box. I have a couple of sites deployed on Netlify with a ‘serverless’ backend deployed to AWS separately.

Their functions are also limited to triggers relating only to Netlify events: https://docs.netlify.com/functions/trigger-on-events/#availa...

Re:Netlify raises $53M Series C as microservices approach to... by swyx on Saturday March 07, 2020 @02:11AM (#22510280)
> Their functions are also limited to triggers relating only to Netlify events

to be clear the functions are also exposed to the public internet as http endpoints so you can ping them from anywhere else, including, for example, your frontend app, or Zapier [1], or GitHub Actions or cron service of your choice

(i work at netlify)

1: https://www.netlify.com/blog/2018/11/07/automate-your-netlif...

Re:Netlify raises $53M Series C as microservices approach to... by VWWHFSfQ on Friday March 06, 2020 @10:29PM (#22509545)
Netlify is glorified S3 + Cloudfront hosting.

They did a very good job at marketing "HTML5 hosting"

Re:Netlify raises $53M Series C as microservices approach to... by dexterdog on Friday March 06, 2020 @11:04PM (#22509657)
It's glorified in the sense that it's much cheaper. I have had small sites on s3 plus cf and have gotten a bill that boggles the mind because I could be hosting the content for free on netlify.
Re:Netlify raises $53M Series C as microservices approach to... by wilkystyle on Friday March 06, 2020 @11:29PM (#22509738)
As someone who is currently hosting a static site with S3 + CloudFront, I'd be interested to hear more about this. Were you hosting something more heavyweight than mostly text?
Re:Netlify raises $53M Series C as microservices approach to... by speleding on Saturday March 07, 2020 @07:00AM (#22511165)
Make sure that you've set the correct cache control headers on the S3 objects. So "Max age" should be something far future for static assets and something near future for HTML files.

If you forget that then Cloudfront will retrieve the objects from S3 every time there is any activity on your site and your bill will go up really fast.

Re:Netlify raises $53M Series C as microservices approach to... by nicoburns on Saturday March 07, 2020 @07:15AM (#22511209)
This is precisely why netlify's offering is valuable. It works out of the box with zero config. If you're using a common static site generator you don't even need to setup the build process, just give it your git repo, and push when you want to deploy.
Re:Netlify raises $53M Series C as microservices approach to... by debaserab2 on Saturday March 07, 2020 @05:22PM (#22514629)
That's not really a compelling reason when it's literally a single input field on a form to setup. Also, if you're in the business of web development, HTTP cache control headers are something you should know about regardless.
Re:Netlify raises $53M Series C as microservices approach to... by nicoburns on Sunday March 08, 2020 @09:17AM (#22517865)
As with a lot of AWS, it's easy if you know you need to do it, but there are a lot of gotchas which can be very expensive if hit (and there's no way to limit expenditure).
Re:Netlify raises $53M Series C as microservices approach to... by codebolt on Saturday March 07, 2020 @03:05AM (#22510481)
Any devs out there with a Visual Studio/MSDN as subscription should also be aware of their free Azure credit. I get 50$/Mo, which is more than enough to host a static site with CDN (my blog typically runs at around 1-2$).
Re:Netlify raises $53M Series C as microservices approach to... by BossingAround on Saturday March 07, 2020 @06:04AM (#22511024)
> I get 50$/Mo

For how long? I remember I got something similar for AWS for a year. Hosted my Wordpress, year passed, then prices jumped up. I migrated to Netlify, rebuilding my site as a static one, hosted for free now.

Re:Netlify raises $53M Series C as microservices approach to... by chispamed on Saturday March 07, 2020 @02:43AM (#22510398)
If you regularly serve bigger files but have low traffic DigitalOcean S3 Spaces and a custom Cloudflare Workers CDN might be an interesting solution for you. Cloudflare Workers are based only on requests and priced at 5$/10M and if you cache everything heavily DO’s 5$ S3 plan should be enough for most use cases. (I’m not affiliated with either company)
Re:Netlify raises $53M Series C as microservices approach to... by pier25 on Saturday March 07, 2020 @07:22AM (#22511230)
Check Zeit Now. You get cloud functions but you can almost architecture your code as if you were writing a monolith. Probably better as each function can be in its own language.
Re:Netlify raises $53M Series C as microservices approach to... by ris on Saturday March 07, 2020 @07:35AM (#22511264)
> Probably better as each function can be in its own language.

That sounds awful. How do you share any of your common logic? Do you have to write versions of your important routines once in each language, each with its own set of quirks and bugs?

It's bad enough in microservice land, where every time you want any shared code you have to extract it to a e.g. "utils" library and massage the versioning to get it in to the right apps.

End result: most people don't and you end up with many different little versions of your routines that do important things.

Re:Netlify raises $53M Series C as microservices approach to... by throwaway894345 on Saturday March 07, 2020 @09:38AM (#22511683)
I don’t think anyone is advocating for choosing a different language per function, but rather you can use the best language for the job. For example, we have a Python monolith that has one route that is CPU-bound and would otherwise be an ideal use case for a language with real multithreading. The Python version often times out (60s) while a native Go (or perhaps Java) version would probably be on the order of a single second.

In our case the limitation is less about the monolith architecture and more about our team’s unwillingness to learn a new language.

Re:Netlify raises $53M Series C as microservices approach to... by ris on Saturday March 07, 2020 @06:07PM (#22514903)
> a Python monolith that has one route that is CPU-bound and would otherwise be an ideal use case for a language with real multithreading

Sounds nasty. The classic python answer is to try rewriting the innermost loops in cython/c/cppyy etc or try using numba/pypy.

> best language for the job

The problem with this "best ... for the job" phrasing is that there's an objectively, indisputably right answer, where I've experienced atrocious choices being inflicted upon a team under that guise, resulting in a component that nobody wants to maintain because it's foreign to everyone.

Re:Netlify raises $53M Series C as microservices approach to... by throwaway894345 on Saturday March 07, 2020 @07:20PM (#22515243)
> Sounds nasty. The classic python answer is to try rewriting the innermost loops in cython/c/cppyy etc or try using numba/pypy

Yep, we’re doing this. The problem is that we’re still calling back and forth between C and Python very frequently and rewriting that next layer in C or similar is prohibitively unmaintainable.

> The problem with this "best ... for the job" phrasing is that there's an objectively, indisputably right answer, where I've experienced atrocious choices being inflicted upon a team under that guise, resulting in a component that nobody wants to maintain because it's foreign to everyone.

Fine, then let’s at least not use the wrong tools for the job, in this case, Python and language’s that impose similar tradeoffs.

Re:Netlify raises $53M Series C as microservices approach to... by ris on Sunday March 08, 2020 @11:10AM (#22518369)
> calling back and forth between C and Python

Yes - the trick really is to move your accelerated code away from python's object model, because then you can drop a lot of overhead and also release the GIL. Tricky, though. Out of interest, did you see any improvement from pypy or numba?

> prohibitively unmaintainable

I don't think well written cython should be any more unmaintainable than Go IMHO.

Re:Netlify raises $53M Series C as microservices approach to... by throwaway894345 on Monday March 09, 2020 @03:41PM (#22528965)
We didn't try numba and couldn't get pypy working; we had dependencies that didn't work with Pypy. I'm curious about numba though.

> I don't think well written cython should be any more unmaintainable than Go IMHO.

I've written a lot of Go, it's always struck me as about as maintainable as Python (I would put it at a bit more maintainable than Python given its mature static typing story--mypy still has lots of problems). I haven't given Cython a fair shake, but it doesn't seem very well-invested in; this is generally what has kept me away from it.

Re:Netlify raises $53M Series C as microservices approach to... by pier25 on Saturday March 07, 2020 @05:27PM (#22514665)
This. Or maybe you need a dependency that is not available in your main language.
Re:Netlify raises $53M Series C as microservices approach to... by manigandham on Sunday March 08, 2020 @06:18AM (#22517328)
You can, but you don't have to. Each route is built separately but it can all be a single monolithic app underneath.
Re:Netlify raises $53M Series C as microservices approach to... by city41 on Friday March 06, 2020 @10:13PM (#22509487)
You can also pair with something like firebase, userbase, etc.
Re:Netlify raises $53M Series C as microservices approach to... by meritt on Friday March 06, 2020 @09:14PM (#22509265)
> but it seems like you still need a backend

Of course. It's just managed by someone else and you often are paying per usage. And you'll find yourself needing to wrangle numerous serverless platforms to actually build out relevant business logic if you want to do something meaningful, one third-party microservice at a time.

> Also, because it's just a static site, there's no backend or database, so you get better security.

It's not as trendy to think of it this way, but "static sites" are just caches with manual invalidation.

Re:Netlify raises $53M Series C as microservices approach to... by mpoteat on Friday March 06, 2020 @09:19PM (#22509281)
It might be more expensive in the long run, but it's an operational expense rather than a capital expense, which I would argue most software projects are.
Re:Netlify raises $53M Series C as microservices approach to... by dgb23 on Saturday March 07, 2020 @08:26AM (#22511433)
You typically hook up changes in your data with static site rebuilds.

Thinking of it as a cache has some merit, but it is more exciting to think of it as a event driven system as a whole, where instead of triggering a render on demand (user wants to look at something) you trigger it when a change happens.

This pattern reduces the need for ad hoc caching and eliminates some accidental complexity as well because it reduces the coupling of management and representation.

Re:Netlify raises $53M Series C as microservices approach to... by TeMPOraL on Saturday March 07, 2020 @01:13AM (#22510102)
They are only if you make them that way.