A couple of months ago we released Encore.ts — an Open Source backend framework for TypeScript.
Since there's already a lot of frameworks out ther...
For further actions, you may consider blocking this person and/or reporting abuse
The speed comparisons are compelling, but I’m curious about real-world use cases. Has anyone implemented EncoreTS in a production environment? How did it perform under heavy load, and were there any significant challenges?
Lots of teams are using Encore in prod, here are some: encore.dev/showcase
But then benchmark encore with db calls and some logic. Against for example fastify, with plugins like CORS, helmet, jwt, mysql, swagger and under pressure.
See: github.com/fastify/demo
Yeah more benchmarks are coming!
also any memory leak issue, i heard bunjs has memory leak. but bunjs has amazing startup time
Encore is literally a transparent proxy in front of your application. This is a powerful concept. You can compare it with AWS Load Balancer + AWS Lambda or any function runtime. After processing the request, Encore will make an optimized RPC call to your application. Blocking tasks like parsing the request, compression, or validation are done at the proxy level in parallel, which allows your application to do more in the single-threaded environment. A downside that isn't mentioned here is that you have to opt in fully into the framework. You won't be able to work with Node.js HTTP Request/Response objects or Web standards to leverage community plugins and frameworks. You have to wait until Encore provides all these as part of the core, or you have to develop your own modules from scratch.
The benchmarks are the best example of comparing apples and oranges. You shouldn't compare HTTP frameworks while your solution offloads work on a proxy and communicating RPC. The real benefits of Encore are the benefits a transparent proxy/RPC protocol can enable, like automatic tracing, pre/post processing, client generation, and extending your platform with features without building them twice, like CRONs, WebHook, PubSub handling, etc.
In comparison, Fastify is performing quite well here. Run twice as many instances, and you can handle the same load without opting into a full-blown solution. In practice, you still have to deal with a single-threaded JavaScript process. The performance benefits of Encore can become negligible if you don't take care of your application logic. For this purpose, Encore could provide built-in process spawning and load balancing.
Thanks Dustin! I'll just add that Encore does support exposing the "raw" HTTP request/response. Not sure what plugin/framework you think is unsupported?
Agree it can get a little Apples/Oranges, Encore operates across a bigger share of the stack than most other tools so making a 1:1 comparison is tricky. That's why we included examples of using e.g. Zod for validation as well to show what the performance difference is when the scope is closer to 1:1.
In our benchmarks against Fastify, we've found Encore to be much more performant in various use cases. We're working on the full report to be published soon!
Encore looks amazing! Specially for putting two of my prefered languages together. But, a question, I get it's performance boost if you have a 8c 16t vps running your backend. But in the age of cloud/k8s is this gain real? I mean now we are running stuff in pods of 1c 1t and we scale up pods when something is overload? I mean... I get the rust is probably better in single core when compared with anything else, but is it bottlenecked but the lack of threads?
This looks really promising. I'll check it out soon.
it's interesting Encore uses multi threading. yet bun is single threaded. Bun offers something called workers as an alternative to multi threading.
Node supports workers. (Most JS runtimes do.)
Can we use encore.ts with sveltekit ? If yes, then how? Is there any example?
Yeah Encore is frontend agnostic. Don't have any pre-made examples right now though. But give it a go and ask any questions in encore.dev/discord
Awesome work guys! I'm curious to know if you will also do some benchmark against nest
Thanks! Yeah we can probably make that happen!
Looks good at first glance, but it seems that some of its core functionality is tied to the proprietary platform offering (such as cloud deployments).
Part of the package installed on our machine appears to be closed source, as I couldn't find the source code for the local dashboard.
Correct me if I am wrong.
Hey @monjai, there's no runtime dependencies on Encore's platform and everything you need to self-host is open source and documented.
You're right that the local dashboard isn't fully open source yet, this is actively being worked on and will be part of the open source project very soon.
I feel from the documentation that encore was built as a development platform and the purpose of it is totally different from what introduced in this article, I see now you are trying to introduce it as an alternative framework to expresses and other nodejs http libraries but it's bigger than that and also harder than that, is there details how this runs on normal infrastructure rather than cloud, what setup I need and libraries and tools to be installed on the OS to run it on a production server? I think it's more a new environment rather than saying it's a nodejs framework. Great work for sure but I noticed something, u still need to make the platform support more and more tools and libraries that already there, for example regarding event driven, it's not just Gcloud pub sub and aws, there are tons of pub sub tools and queuing tools as well and used on production, how someone for example can use rabbitmq or amq and other tools, what if I am using another db like mongodb, cockroachdb, or other dbs, do u need to build drivers for those tools? If yes, is there a way to use the already existing drivers that already exist so we keep the learning curve simple for new users.
Thanks Tarek, great comments. Some thoughts:
This obviously took a lot of work and it's pretty cool how you took as much as you could down into native code. I haven't encountered much need for anything faster than Express though personally. Express is already fast enough that real world response time is dominated much more by latency between the user and the server, then latency between the server and external APIs, then latency between the server and databases, than by the performance of application code, and a well-optimized application on any modern framework should be bringing in enough money per instance for the business that the cost of adding more instances is pretty trivial.
And when you need a dbase call suddenly these performance characteristics do not mean anything anymore, because the dbase trends to become the bottleneck.
Yeah db calls are definitely a bottleneck, but in our real-world testing the uplift is still very meaningful across the entirety of an applications.
https://www.techempower.com/benchmarks/#hw=ph&test=composite§ion=data-r22
I hope you're enlisted here soon, dear Encore.ts.
and also can I use encore on cloud platforms like digital ocean?
I am having serious trouble installing it on my system parrot os, any help with this ?
I am Deno fanboy. Just wondering is there any way to use it with Deno ?
Coming soon!
Why u compare it with one of the slowest validators?
We picked it because it's one of the most commonly used so the information would be most relevant to people.
How to config angular ssr to use Encore instead of express?
Have you considered making a Typescript SDK creator? Think TRPC style, ditching the whole Rest paradigm.
Elysiajs?
https2 and QUICK protocol support available?
"Interface"s are not safe and are usually avoided, I would use TypeScript "Type"s, would it work with "Type"s as well?
It feels like the cocktail of cloud + framework I don't get any better use cases like nestjs but seems cool in case of performance
I think compared to nestjs you get a bunch of benefits when it comes to building distributed applications, like type-safety when using queues etc.
It would be fairer to compare with typia instead of zod, since JSON parsing and validation is a known bottleneck
Interesting. The rationale for including zod in the benchmark is that it's very established and commonly used for validation, which Encore does out of the box.
Looks really great I'll give it a try. Since the encore runtime is very decoupled are there any plans on supporting a python sdk?
It's the next language we're planning on adding support for, our ambition is in the next 6 months.