DEV Community

Cover image for How to make your Express app 9x faster (and type-safe)

How to make your Express app 9x faster (and type-safe)

Marcus Kohlberg on October 07, 2024

💡 This guide shows you how to migrate an existing Express.js app to Encore.ts, an Open Source backend framework for TypeScript, to unlock a 9x perf...
Collapse
 
inspiraller profile image
steve

Yeah I saw another article on encore. Looks like a great alternative. Though I'd suggest changing your title because that's not making your 'express app 9x faster'. Thats 'replacing your express app to me it 9x faster'. It reads like how to write express better. Also, another point is, making it typesafe is just a matter of using typescript, which you can continue to use with express id so desired.

Collapse
 
imamdev_ profile image
Imamuzzaki Abu Salam
  1. 'express app 9x faster' and 'replacing your express app to me it 9x faster', are the same if we see it from the end-user/our client viewpoint, our client/end-user is our number one priority. So, who cares it is replacing or not, the point is my user became happier to give me more money :)
  2. The type-safety discussed here is not compile time type-safe like TypeScript gave. But, runtime type-safety requires an additional library in most frameworks nowadays, reducing performance.
Collapse
 
mindplay profile image
Rasmus Schultz

The title is click bait.

It implies a change to your Express app - it does not imply you'll have to migrate your entire app by hand.

Is a title like this intended to convey what's in the article? or is it intended to trick Express users into reading about a competing framework?

Encore looks amazing, by the way - and Express is an outdated piece of junk. There are plenty of honest ways to market Encore against Express.

But let's be real, you're not going to simply trick someone into migrating their entire project to a different framework. That's a potentially huge commitment.

And nobody likes to be tricked. 😒

Thread Thread
 
marcuskohlberg profile image
Marcus Kohlberg

Fair point about the title! Although, the very first sentence in the article does make it clear what it is about. I don't imagine anyone being tricked into changing frameworks. :)

Thread Thread
 
mindplay profile image
Rasmus Schultz

you only trick them into clicking.

that's what click bait means.

Collapse
 
marcuskohlberg profile image
Marcus Kohlberg

Nice to see someone reading carefully :D

Collapse
 
mikeaig4real profile image
Michael Aigbovbiosa

Either way, it's still a commercial for using Encore rather than using Express. Hope this helps.

Collapse
 
devnenyasha profile image
Melody Mbewe

Thank you for sharing

Collapse
 
retakenroots profile image
Rene Kootstra

Yay, another commercial in a dev community.

Collapse
 
imamdev_ profile image
Imamuzzaki Abu Salam

COSS era my fellow dev :)

Collapse
 
asken profile image
Kristian Ask

If performance and type safety was an issue I'd pick a real typed language like C# or go. Then there's always rust for some real performance...

Collapse
 
marcuskohlberg profile image
Marcus Kohlberg

Yeah there's lots of options. A lot of people these days seem to want to use TypeScript to be able to have one language across frontend/backend, helps with hiring and organizing teams. (This is based on several conversations CTOs at primarily smallish companies <100 engineers.)

Collapse
 
asken profile image
Kristian Ask

That's a separate discussion from performance though.

Thread Thread
 
marcuskohlberg profile image
Marcus Kohlberg

It's rarely realistic to only optimize for one parameter :D

Thread Thread
 
asken profile image
Kristian Ask

Then c# only...

Collapse
 
danztensai profile image
Danial Habibi

Bzzzzzzz just another ads? Just change your tittle to another one. Its not make the express faster... its just migrate to another framework that faster than express js.. for god sake. Wasting my time ....

Collapse
 
officialjs profile image
Jacques Stander

# TODO: Change misleading title

Collapse
 
imamdev_ profile image
Imamuzzaki Abu Salam

The only reason I'm not trying encore is in my local, I can't encore eject, it gives me error.

Collapse
 
marcuskohlberg profile image
Marcus Kohlberg

We're dropping lots of improvements in this area later this week—should hopefully resolve your problems—stay tuned!
We'll try to help you out on Discord in the meantime (encore.dev/discord)

Collapse
 
imamdev_ profile image
Imamuzzaki Abu Salam

AS consumer , :) I LOVE competition :)

Collapse
 
melkmeshi profile image
Mohamed Elkmeshi

I had this error

error: unable to resolve module ../db/schema

Collapse
 
marcuskohlberg profile image
Marcus Kohlberg

Join Discord and we'll help you out: encore.dev/discord

Collapse
 
tun_nguynnh_ff121124 profile image
TUẤN NGUYỄN ĐÌNH

Ecore is a new freamwork of nodejs right?
May be i can try it. Looks interesting

Some comments have been hidden by the post's author - find out more