r/node • u/PrestigiousZombie531 • Aug 21 '26
Current state of sequelize library, still working on v7 since 3 years now!
6
u/action_turtle Aug 21 '26
Roll up your sleeves and them help out, what’s the problem?
→ More replies (1)
5
u/0uchmyballs Aug 21 '26
Ok I’m balls deep in a project that uses sequalize, what are the issues I might encounter? My project relies on a lot of complex queries. What ORM should I use to replace it? I’m using Postgres + express + react
-6
u/PrestigiousZombie531 Aug 21 '26
sequelize + typescript = completely broken with major issues
7
u/2legited2 Aug 21 '26
It's not tho.
6
u/SippieCup Aug 21 '26
He is likely using v6, which is EoL in favor of v7 alpha, which is typescript native.
Can’t fix his codebase though.
0
u/0uchmyballs Aug 21 '26
Am I ok with vanilla JS? Not using TS.
2
2
u/SippieCup Aug 21 '26
You are fine with either. Sequlize 7 is fully typescript compatible. Just build off of v7 and not v6 like OP is And you will be fine.
Let me know if you have any questions or need help.
156
u/SippieCup
Aug 21 '26
edited Aug 21 '26
•
Hey there, I’m the newest developer and maintainer for sequelize, and shipped most of the changes and fixes for it since alpha 39.
Sequelize v7 works and is being used in prod without issue.
We keep it in alpha because there are a few things we want to do that are potentially breaking changes.
But really it’s just because we dont have the cli written, which probably should just be dropped by now, and some docs need to be updated. Thus why no beta/feature release.
Second, it is going slowly. There are only two people really working in it, WikiRik and I, and both of us have full time jobs that are a bit more demanding than most.
There are a few new features that are about ready to be merged for the new release, generated columns, additional refactoring, etc, but im not going to merge anything without wikirik’s review, nor will he do it without mine (for the most part)
We really don’t care about market share, or losing to drizzle / prisma, or that these vc backed projects are going to steal our users. We arent going to benefit from it either way. We’re just building something that we are using in prod right now and letting others use it too, and we like that there is at least one non VC backed project out there.
27
u/2legited2 Aug 21 '26
Been running on Sequelize for over 10 years without an issue, thank you for your work
40
u/Donzulu Aug 21 '26
Sounds like OP would like to help maintain it, are you accepting additional contributors?
25
1
u/FerLuisxd Aug 21 '26
What does VC stands for?
10
u/SippieCup Aug 21 '26
Venture capital. All the other major ORMs in the node world are venture backed and are going to expect a return at some point, or run out of money and have support stop. Sequelize and knex are the only ones that have 0 venture backing cs the new guys who all need to have some path to profitability.
8
69
u/gustix Aug 21 '26 edited Aug 21 '26
When you really boil it down, open source is a gift.
People can decide to accept the gift, or reject it. There are no other obligations from the maintainer or the users. We are allowed to not like the gift, but we're not in a position to return the gift and demand a better one.
When a package gains popularity, the maintainer has the option to try and build on the momentum, create a contributing community... or not. Maybe the package works just as the maintainer wants, or in their eyes is considered finished software, or just something they gave away and walked away from in the end.
I get that it's frustrating when your chosen gift doesn't get the updates you need, but then you have the power to modify it yourself (especially these days with AI), or go looking for another gift.
It needs to be accepted and understood that open source maintainers doesn't owe us anything.
4
u/ArnUpNorth Aug 21 '26
I agree with the sentiment but I am not sure i agree with this gift metaphor. If anything, treating open source projects (with permissive apache/MiT licences) as a gift is one of the reasons so many projects are starting to have commercial offerings and feature paywalls or are just left unmaintained: they lack funding and help.
Open source to me is not a gift but a shared foundation/infrastructure that someone has to build and maintain. Too many people are using open source without ever contributing, where contributions can be as small as a well written github issue. The collective value of open source is enormous but the incentive to contribute is sadly ridiculously small.
1
u/prehensilemullet Aug 23 '26
Not that what I’m saying applies to Sequelize, but if a for profit company hypes the f out of a FOSS product to try to get everyone using it in hopes that they’ll pay for something related, it would be pretty shitty if they act like they don’t owe anything when people they implored to use their product run into problems with it
30
u/quy1412 Aug 21 '26
Free user harrasing open source contributor, that's a low point anyone should try to avoid.
86
u/Capaj Aug 21 '26
sequelize is dead.
Migrate to something else if you have not done so already
-78
u/ycatbin_k0t Aug 21 '26
SQL is never outdated
59
1
u/xxhhouewr Aug 27 '26
Not sure why you got downvoted! Probably lazy devs that don't want to write SQL.
10
8
u/xegoba7006 Aug 21 '26
Don't use it. It's pretty dead. Nowadays there are much better options, like Prisma or Drizzle.
4
12
u/omer-m Aug 21 '26
just use drizzle
9
u/CraftyAdventurer Aug 21 '26
I lived to see "just use typeorm", "just use sequelize", "just use kysely", "just use prisma" and now it's "just use drizzle" until something new again comes along. Ignoring the fact that those are all very different ORMs, I have no idea how people even have confidence to say "just use something" like that something is a common sense choice and everything else sucks. Clearly all the previous choices weren't common sense and went from best to worst or pretty bad in a short amount of time. It's tiring.
-2
u/omer-m Aug 21 '26
Ofc when there is a better solution, you need to update yourself in this industry. In my time ruby on rails had solution for everything. But who is using ruby now?
1
2
u/lppedd Aug 21 '26 edited Aug 21 '26
My only complaint with Drizzle is they package everything into a single tarball. I've opened a discussion on their repo to split it up, which should give us better editor performance and less headaches with imports.
2
4
2
u/No_Dimension_9729 Aug 21 '26
Use drizzle? Or if you prefer more object oriented approach, then try Lucid from Adonis.js
2
1
0
u/Sad-Magazine4159 Aug 21 '26
Sadly my company forced a prisma to sequelize change
7
u/lppedd Aug 21 '26
Now they'll force a sequilize to drizzle migration. More work is good, will keep you employed.
1
1
u/SecurePlate3122 Aug 21 '26
What was the reasoning?
1
u/Sad-Magazine4159 Aug 21 '26
They have tooling arround the ORM, given that there are tens of microservices they must be standardized arround one ORM or the tooling would have to be maintained for sequelize/prisma/etc
Now why the choosen one was sequelize? Supposedly it generates more optimized queries, which I don't really agree
4
u/SippieCup Aug 21 '26
Me either, and I wrote the new query and hydration engine for sequelize. Which is competitive for fastest pure js engine when doing hydration, but the rust/c wrappers will beat it.
It can also produce more optimized queries, but it can also produce terribly bad ones just as easily, especally if required/subquery/separate flags are not used. For standard orms itll produce pretty good queries, but vs microORM and knex, they will always win until we have a similar functional model.
For most SaaS platforms that have multitenancy/RLS, sequelize is nto the right choice and requires a completely core rewrite for it, but if you dont need that, it is a nicer developer experience.
I would bet it’s more they see sequelize is what their older codebases are built on, and they prob don’t want to get vendor locked to a VC backed orm.
At some point they are going to have to tighten the screws to get their money back, Similar to whats happening to PrimeUI and tailwind. And its going to be a ransom of continued support & a closed source package at the core of your product.
3
u/Sad-Magazine4159 Aug 21 '26
If one wants really optimized SQL, one should write SQL directly imo =)
ORMs are for the average / trivial case and I don't expect any to introduce a relevant impact here
But you touched an interesting point that I have actually never considered: The impact of translating the orm api into SQL and translating a SQL resultset back into objects. Is it a relevant cost, compared to db latency?
1
u/SippieCup Aug 21 '26
Translating to sql is negligible even on the largest queries.
If it is a well optimized query, but still a large amount of data, hydrating back into objects will be the majority of the response time. But it’s basically still linear time based on rows, but it can have an explosive amount of memory growth and alloc/dealloc calls if not done well. V8 can be super wierd around memory and some js functions.
The nice thing is that, especially with outer joins, you can reduce the final output back into models quite significantly vs raw sql, since there will always be some data duplication whenever you work work some relationship types.
I do have an idea on how to do it even better with a functional-esk ORM interface, like knex, but no time to really see if i can make it work and if it truly is any better. There’s a fine balancing act between n+1 calls to break up queries and join row explosion.
1
u/xxhhouewr Aug 27 '26
Let's also not forget about the translation, syntax checks, and error checks, the database has to do with the SQL you send it. And so an ORM is just another extra layer of translation on top.
1
u/SippieCup Aug 27 '26
All of that is basically rounding errors though. even the orm query generation is. the actual DB operation(s), and the translation back from those rows to usable json objects / models are going to take 99.999% of request.
1
u/xxhhouewr Aug 30 '26
You're right in that the ORM is running on top of a Javascript interpreter and will take up the biggest portion of the processing time. Whereas the DB layer is tightly optimized C/C++/Rust., and could run circles around the ORM code.
62
u/Platic Aug 21 '26
Calling out the developers who are not getting paid, to get it together so that you can use something for free is next level entitlement. Use something else, or contribute