Skip to content

Documentation on multi-codebase environments? #58

Open

Description

@haylinmoore

I believe there should be docs on how to optimally setup workerd for multiple different JS codebases. Based on https://github.com/cloudflare/workerd/blob/main/src/workerd/server/workerd.capnp#L114-L115 it seems like we can't currently doing that using Host Headers natively, but can use a main javascript script to do so. Having an example of that would be ideal, otherwise my idea is to make a unix socket per site, and hook nginx into those.

Activity

  1. jasnell commented on Oct 1, 2022

    @jasnell
    Collaborator

    workerd as it currently stands is not at all intended for multi-tenant environments ... specifically, it does not implement any mechanisms for ensuring the necessary sandboxing required for proper multi-tenant support. We do not intend to include that support here. As you note, it is possible to support dispatching based on Host header but I would definitely caution against using that as a reliable multi-tenant mechanism.

  2. kentonv commented on Oct 1, 2022

    @kentonv
    Member
  3. changed the title [-]Documentation on multi-tenant / multi-tenant environments?[/-] [+]Documentation on multi-codebase environments?[/+] on Oct 1, 2022
  4. haylinmoore commented on Oct 1, 2022

    @haylinmoore
    Author

    Ah sorry for the confusion, yes I was talking about multiple nanoservices from the same company as @kentonv believed, apologies for the confusing title

  5. chenthillrulz commented on Nov 11, 2022

    @chenthillrulz

    On the similar note, If there is a use case to run custom javascript functions (or a nanoservice) from a different company, is it possible to use a custom sandbox (such as https://github.com/patriksimek/vm2) inside a worker to achieve certain level of security ?

    Am also looking for some samples around nanoservices. Want to see the benefits pointed out in the documentation such as homogenous deployment and nanoservices, performance benefits compared to microservices, with a POC. Some of our use cases involve using workerd for executing nanoservices as well as a worker engine.

  6. kentonv commented on Dec 7, 2022

    @kentonv
    Member

    On the similar note, If there is a use case to run custom javascript functions (or a nanoservice) from a different company, is it possible to use a custom sandbox (such as https://github.com/patriksimek/vm2) inside a worker to achieve certain level of security?

    I would say that you only need intense sandboxing if you are intending to run arbitrary code from anonymous, possibly-malicious sources, who might attempt to exploit bugs in V8 or workerd.

    If you are running code from a different company -- but you know specifically who the company is -- then you probably don't need to worry about them trying to exploit you (if they did, you could prosecute). In that case, workerd's sandbox should be good enough. Services in workerd cannot access any resources other than what you give them in your configuration (except through exploits).

  7. tom-sherman commented on Feb 2, 2023

    @tom-sherman

    Hey @kentonv do you have any samples to share yet?

    I'm currently investigating workerd as an option in our organisation and would love to see how this could work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions