Giter Site home page Giter Site logo

Comments (3)

geelen avatar geelen commented on September 2, 2024 3

Going to leave this discussion open, but am gearing up for a real v1 release now without any multi-entry-point support. I'm open to the idea, or potentially something like a "FAB of FABs" where each "entry point" gets rendered to its own FAB, then you produce something of a router FAB that sits in front, at the edge, and proxies to the other.

While that's a bit awkward, it does mean that we could experiment with building more complex production systems out of single-purpose, optimised runtimes, rather than have to extend the spec and, as a consequence, make every runtime more complex.

Let's see how FABs start getting used and we'll know a bit more.

from fab.

geelen avatar geelen commented on September 2, 2024

Yeah I've had this question come up a few times, and I admit that the FAB design as-is doesn't map well to the backend-split thing, so it's something i've got in the back of my mind.

So, there are two problems. The first is that I want programmatic control of the routing layer, not a config file. Zeit's infra requires a routing layer in front of your apps to load the correct partial backend, but I don't want a "config export" to be part of a FAB deploy if we can avoid it. I talked briefly with @mjackson about this: potentially there's scope for a first-class routing format that's shared between all platforms, but I'm not pursuing that actively. But I would more than happily raise it for discussion (either in an issue, on a call, or in person).

The second problem is that I'm not actually convinced of this statement: "more fault-tolerance, easier scaling ... see this pattern growing going forward". I see Zeit's backend code-splitting as being very driven by the Now v2 infrastructure on AWS Lambda, where each route-server has no concurrency, and cold starts are a major issue. Is that approach still valuable if you're running on Cloudflare Workers' infrastructure with cold-starts 1-2 orders of magnitude smaller? And, what's the impact of coding your server against the Fetch api rather than NodeJS HTTP (in terms of bundle size), like FABs do. I don't think what Zeit have done with Now is bad in any way, I just can't see clearly how much of their approach is applicable in different execution environments.

Not to mention the impact of a platform like Google Cloud Run, where you get a full docker container that can run fab serve with concurrency up to 80, but scales up and down like a Lambda. No idea if it's performant/cost-effective for front-of-line web traffic, but I can definitely see it outperforming Lambda, purely due to the option of having a single server dealing with concurrent requests. In that case, I'd argue that you'd want the entire backend in a monolithic server to maximise reuse of your servers and smooth out load.

My gut feel is that the FAB spec will extend to handle multi-part FAB backends, but they'll be unified behind a single entry point. So routing can still be programmatic, but your execution environment allows your entry.js bundle to call a route-a-handler.js bundle. In some environments, all the bundles will live together and get loaded once, and in others, each piece will get a dedicated serverless container and call into each other.

Happy for you (or others) to expand on why you'd like such a featureโ€”so far I haven't encountered an app that's simply unviable with a single server.js but is viable with a route-split one, so my thoughts are a bit hypothetical to form a good conclusion.

from fab.

NathanielHill avatar NathanielHill commented on September 2, 2024

Yes, I agree with most everything you just wrote. Only thing I can see at the moment is large apps that can't fit within the 50ms/1MB limits of Cloudflare Workers.

I like your idea in the second to last paragraph.

I love this project idea, and see it as one of the top three ideas making web development more sane over the next few years:

  • Server-less (pretty much solved)
  • Build-less with tools like @pika/web and browser ESM support
  • Runtime-less with new frameworks like Svelte, lit-html, or pure Web Components
  • Lock-in-less with fab.dev ๐Ÿ˜„

from fab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.