kenn
Joined 15 years ago
Joined 15 years ago
I'm on Remix / Drizzle ORM / Render.com / Render Postgres / Cloudflare R2 / DaisyUI + shadcn/ui these days.
Drizzle can be a bit tricky if you're coming from ActiveRecord but once you have your own helpers with a base class that implements common method such as find_by({ key: value}) / create({ data }) / update(id, { data }) / delete(id), things get better.
Render is really good - you don't need any specific configs, just set env vars on their dashboard and git push to deploy. Simpler and better than Heroku workflow.
You can take a look at https://github.com/remix-run/blues-stack to learn how you'd manually implement cookie-based auth on this framework.
Remix is the closest thing to Rails in the JS ecosystem IMO
If you EXPLAIN that query, it's a DEPENDENT SUBQUERY which has to fetch N*M records. It would be mitigated if the columns are property indexed, but two separate queries (N+M) just as eager loading would be faster and more predictable than nested scans in terms of IOPS.
I wish if we could do something like:
has_one :approved_comments_count, -> { select(:post_id, 'COUNT(comments.post_id) as comment_count').group(:post_id) }, class_name: 'Comment'
and
posts.includes(:approved_comments_count).map(&:comment_count)
I've learned to not invest too much on the project, staying with the minimum server cost, and that's the only sustainable way for me. In fact it costs me almost nothing and users have built trust on me for running it for 6 years.
I'd give her tons of credit for trying to turn it into a real business. That's what I've been failing so far, or maybe I just don't even have the guts to do. I admire her courage and thus feel really sorry.
Hopefully I'll find another course, who knows.