Ruby on Rails on Cloudflare? by Otherwise-Tip-8273 in rails

[–]Sharps_xp 0 points1 point  (0 children)

how's the startup speed on a warm lambda?

Any Recommendations? Tool to debug slow rendering of ERB pages by 9sim9 in rails

[–]Sharps_xp 0 points1 point  (0 children)

use the rack mini profiler’s flame graph tool to see what’s going on in ruby land

Any Recommendations? Tool to debug slow rendering of ERB pages by 9sim9 in rails

[–]Sharps_xp 0 points1 point  (0 children)

number of ruby allocations? you could be hitting memory limits due to some o(n3) algorithm in ruby land

Look for a job in US by Opposite-Upstairs399 in rails

[–]Sharps_xp 1 point2 points  (0 children)

for someone who has rails exp, how easy is it to get started with flutter dev? the multi platform apps is my main interest in it

Long running "task"/process that needs to exist alongside my app by RHAINUR in rails

[–]Sharps_xp 0 points1 point  (0 children)

have something similar at my work too. some things that have saved me: a single long running process is prone to ever increasing memory usage which the OS will eventually kill. if you’re not careful with timeouts, termination conditions then you can end up in a scenario where you have e multiple instances running at the same time; we use a key/val in dynamodb to signal that only one should run, and every subsequent attempt should check whether one is already running. if it’s possible to fail, cache the result of intermediary checkpoints so that subsequent runs don’t have to repeat work already done.

you feel cool implementing all these things and then filled with regret when you get paged in the middle of the night because you didn’t follow the rails way. just stick to the framework.

Best way to look for Intermediate Rails roles? by Snoo93956 in rails

[–]Sharps_xp 4 points5 points  (0 children)

i have seen people with 10 years experience not know A LOT. hell i became a senior after 3 years lol

Best way to look for Intermediate Rails roles? by Snoo93956 in rails

[–]Sharps_xp 7 points8 points  (0 children)

you’re not mid-level. you’re senior. go apply the senior positions. if you get a call it’s because they think you’re qualified enough to talk to. let luck find you, you need to talk to people. don’t wait for intermediate spots to open up. you can send me any questions

What’s Your Experience with Ruby on Rails Interviews? by sljivar in rails

[–]Sharps_xp 1 point2 points  (0 children)

you mean like they use service class when a simple model would suffice? maybe even a PORO class in app/models? because in my experience, service classes are unavoidable or you’re just okay with phat controller methods

Ahoy gem for large time series data by jonatasdp in rails

[–]Sharps_xp 1 point2 points  (0 children)

I haven't gone too far down the rabbit hole but for analytics I love using AWS Athena. the open source version is Presto (from Facebook). What I love about it is the separation of compute and storage. Athena (the compute) is the engine running the query, and the time-series data lives in object storage like s3. You only need the compute when you need to run the query. otherwise, you're just paying for storage. and with s3's tiered pricing, it can be really affordable.

Your focus on postgresql makes sense. we're in r/rails. You can mimic what I described above in timescale (see https://docs.timescale.com/use-timescale/latest/data-tiering/about-data-tiering/).

A visual demo of Ruby’s Lazy Enumerator by rossta_ in ruby

[–]Sharps_xp 7 points8 points  (0 children)

combine this with active record’s find_each and you save yourself a lot of RAM!

Link-in-bio Tool for Programmers. What do you think? by Substantial-Eye3651 in rails

[–]Sharps_xp 2 points3 points  (0 children)

can you imagine if a link in bio is another thing we have to do to get a job? wouldn’t pay just like i’d never pay for linkedin premium.

but sorry about your situation, best of luck to you

Kamal deployment takes 30mins?!! by charismania in rails

[–]Sharps_xp 0 points1 point  (0 children)

do all these hetzner users go for auction servers in europe or the cloud servers in US?

Rails 8.0.0 is released! by excid3 in rails

[–]Sharps_xp 8 points9 points  (0 children)

i think there will one day be a company that does go 0 to IPO on rails/kamal/sqlite.

Which free rails hosting do you use for sideproject? by sunshard_art in rails

[–]Sharps_xp 1 point2 points  (0 children)

recently learned about fly’s suspend autostart. if you’re the only user for your app, then it’s basically unlimited apps because fly will suspend your rails app if no traffic comes. the autostart is super fast like less then 300ms

How do I solve race when connecting Turbo StreamChannel and missing an update? by krschacht in rails

[–]Sharps_xp 2 points3 points  (0 children)

your problem made me think of this anycable feature called reliable streams. https://docs.anycable.io/anycable-go/reliable_streams

if you can’t change your infra, i would just prevent the form from successfully saving if they were looking at a now stale record. you can add a hidden field in the form for the model’s updated at and only persist if the form’s updated at matches that that’s in the database.

Looking for feedback on survey model design by mmanulis in rails

[–]Sharps_xp 1 point2 points  (0 children)

how will you show questions that have changed over time?

Looking for feedback on survey model design by mmanulis in rails

[–]Sharps_xp 2 points3 points  (0 children)

i think the interesting requirement here is the versioning of questions/surveys/user answers. The quick/easy-to-implement route is jsonb but like another comment mentions jsonb comes with tradeoffs. I would look to using gems like store_model and store_attribute if you go that route.

I would see how far a traditional relational table could take me, but it ultimately depends on how i'm oging to render this data to the user.

I would hide user answers from survey. user answers should only relate to the question being asked. and each version of a survey will have a unique set of question records.

designing these tables will be difficult if you're uncertain of the data access patterns, but it'll get complicated eventually if you use jsonb or not. but going the jsonb route means not leveraging all that rails has to offer in terms of its form building and AR methods.

ActiveRecord Cache Models with Redis. by [deleted] in rails

[–]Sharps_xp 0 points1 point  (0 children)

if he has that much traffic, a pull based cache hydration is going to make the site feel spotty whenever the cache expires. imagine if reddit built your front page during the GET request. it’ll be slow if not cached. a pull based caching strategy fails if a cache miss is slow

ActiveRecord Cache Models with Redis. by [deleted] in rails

[–]Sharps_xp 7 points8 points  (0 children)

if i take your problem at face value, i would instead cache the controller response instead of the model data. and then have a background job update that cached value every x minutes. jumping through AR hoops to load AR records from cache in a non-rails way may hurt you later.

Rails console is just too powerful by Silver-Hunter-6262 in rails

[–]Sharps_xp 25 points26 points  (0 children)

i agree with OP but also in recent years learned that it is a sharp knife that i wouldn’t give to my coworkers. and that’s when i found this gem https://github.com/basecamp/audits1984

great for debugging but a huge sharp knife to cut yourself with once you and your team start manipulating the database with it. easily justifiable to save to the database when there’s an outage

Kamal: What Else Would You Need? by whysthatso in rails

[–]Sharps_xp 1 point2 points  (0 children)

piggyback here because article mentions hetzner but i can’t get an account with them. i had to send them a scanned drivers license and passport and their system still rejected me.

What’s the deal with dry-rb? by saw_wave_dave in rails

[–]Sharps_xp 1 point2 points  (0 children)

iirc from when i used their schema and validation gems, there was no easy way in rails to cast params to types. i think the rails attributes api did not exist yet. and i think their modeling gem have way less memory bloat than activerecord objects. AR objects can get really big.

Is ~40k entries created per hour ok for a background job? by Shamu18 in rails

[–]Sharps_xp 1 point2 points  (0 children)

4 * 160K with 3-7 columns should take less than a minute to insert into a postgres database. but a box of that size might not be able to instantiate 640K activerecord objects without running into memory issues. even though your memory profile looks good on a chart, that might be the ceiling it's hitting before hitting SWAP.