7 ms·
Any current or planned support for existing ORMs, such as Prisma or TypeOrm? Also, I wonder how hard it will be to migrate existing PostgreSQL databases and SQ
by mwcampbell 4y ago
Any current or planned support for existing ORMs, such as Prisma or TypeOrm?
Also, I wonder how hard it will be to migrate existing PostgreSQL databases and SQL statements. Of course, I understand if Cloudflare is focused on greenfield applications.
- jgrahamc 4y agoWe are definitely interested in ORMs. Want to make it easy to use. I hope someone creates the next Rails using Workers. And having other models on top of our SQL offerings will be important. Get in contact and let us know what you'd like.
- eatonphil 4y agoWill not any existing ORM that supports SQLite support D1? I looked in the post for details on how it extends SQLite (is the query language different or extended, semantics very different, etc.) but didn't notice anything.
- jgrahamc 4y agoThey should.
- mwcampbell 4y agoI think the main issue will be with ORMs that are tightly coupled to a specific SQLite driver, such as Prisma.
- joshstrange 4y ago> I hope someone creates the next Rails using Workers I too am eagerly waiting for a good serverless nodejs framework that is "batteries included". I've deployed on Lambda using the "Serverless Framework" but once your app grows to a certain size everything starts to fall apart and you lose some of the magic. Unfortunately, most of the things that advertise themselves as serverless/lambda/worker nodejs frameworks are monoliths and/or an existing monolith framework that "supports" lambda (with a billion asterisks after that). There is absolutely nothing wrong with monolith frameworks, I love them, but just not for lambda, I want to deploy a single endpoint as a single function (or as a cron, or queue listener, etc), not all of my code for every function (you hit size limits quick with this method). I want express/nestjs/etc-type routes that I define with code or annotations that result in /only/ that function (endpoint) being bundled up and deployed. I ended up rolling my own "framework" on top of Serverless Framework (uses serverless.ts config file that scans my directories for a special file that defines the routes defined in that directory) but Serverless Framework is pretty shaky ground. Their documentation is a mess, Serverless Components appears dead, and they seem to be busy with their own "cloud" so I don't know how much longer I can keep building on top of them. When it works it's like magic but there are a ton of walls you run headfirst into: Cloud formation entity limits, package size limits, typescript/bundling support, clear disregard for medium/large projects ("Just use multiple services", this leads to a terrible dev experience), and long deploy times. I wish CF Workers had been out when I first started building my current project, I might have gone in that direction instead, I still might.
- mwcampbell 4y agoDoes Cloudflare Workers now support a large number of workers under a single domain without having to use an expensive pricing tier?
- joshstrange 4y agoI'm not sure, I've not done the full research into CF Workers since I'm on AWS Lambda right now and don't have the capacity to evaluate alternatives. I just like a lot of the CF products and their general ethos/vibe so I'm interested in it. Who knows, it might have a whole new set of issues (most likely) but I don't know if those issues are worse or better than what I'm dealing with now.
- jpcapdevila 4y agoHey Josh, I'm building a serverless firebase alternative that uses SQLite. If CF gives me access I will totally support D1 & workers. Check it out: javascriptdb.com
- joshstrange 4y agoThanks! I'll check it out.
- jpcapdevila 4y agoI'm building an open source firebase alternative using sqlite. I'll be reaching out, I was thinking to build the distribution & durability part myself, but I would rather use D1! I guess it would count as a client focused ORM :) I'll be reaching out from jp@javascriptdb.com Great addition, congrats!
- gen220 4y agoYou might want to consider adding Deno [1] to the language examples: https://developers.cloudflare.com/workers/platform/languages/ https://developers.cloudflare.com/workers/platform/languages... Deno can compile to wasm, so it can plug in through that vertical. But it's just TS on the frontend. I'm mainly a python programmer, but Deno's been the most alluring development in the JS ecosystem since typescript for me. Might be helpful to you all to capture some steam from source. [1]: https://deno.land/ https://deno.land/
- irq-1 4y agoThis should have a virtual file system. CF should write it so each user doesn't have to load a JS abstraction and it has better performance.
- Cthulhu_ 4y agoBefore you consider using an ORM, try using regular SQL and some tooling first; your future self will thank you. Just write the code, it's only volume and it's not so bad.
- joshstrange 4y agoI took this advice on my last project and ended up re-writing the whole thing to use Prisma later. I launched and had a successful event with raw sql but it quickly became unwieldy. Prisma gives me type safety throughout my app (written in Typescript) and would have prevented a number of bugs/pain points as my app grew. And I'm only 1 developer, this gets worse if you have multiple people working on it. I still write raw sql for reporting/aggregation (Prisma's features here only work for basic examples in my experience) and I'm not "scared of raw sql" but I can move much faster when I have the guardrails of types.
- pier25 4y agoTotally agree. Source: someone who avoided learning SQL for 20 years.
- gigatexal 4y ago+1 to this as well.
- Cthulhu_ 4y agoBefore you consider using an ORM, try using regular SQL and some tooling first; your future self will thank you. Just write the code, it's only volume and it's not so bad. What is bad is learning a 3rd language on top of SQL and JS/TS that you somehow have to manually map to SQL.
- sorenbs 4y agoPrisma won't work with D1 out of the box. The primary limitations are: - SQLite is traditionally embedded in an application, so Prisma interacts with it by mounting a file. Workers does not have a local filesystem, and D1 is exposed over the network through an API accessible from a Worker. Prisma will have to create a specific connector for D1. - Workers have a script size limit which is currently 1MB. My understanding is that Cloudflare will be increasing this in the future. We also have specific work to decrease the size of Prisma. Both of those will have to happen before Prisma could be used with D1. Note that Prisma already support querying Postgres, MySQL, SQL Server and MongoDB from Cloudflare Workers through the Prisma Data Proxy, which will see a GA release next month. We are also very excited about D1 as a way to bring a subset of data closer to users in order to deliver faster experiences. We hope this will be a way to bring the benefit of edge computing to larger organisations who cannot simply rearchitect everything to run on Workers.
- geelen 4y ago> We are also very excited about D1 as a way to bring a subset of data closer to users in order to deliver faster experiences. We hope this will be a way to bring the benefit of edge computing to larger organisations who cannot simply rearchitect everything to run on Workers. I am also excited about this :)