Тёмный

Rails - Database Transactions and Distributed Locks 

TypeFast
Подписаться 4,7 тыс.
Просмотров 2,6 тыс.
50% 1

TypeFast
www.typefast.co/
We go over database transactions and distributed locks that backend developers can utilize to help prevent race conditions at the database level.
In Rails, this feature is called Pessimistic Locking:
api.rubyonrail...
It's a useful feature to help you prevent race conditions.

Опубликовано:

 

30 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 12   
@InvincibleMan99
@InvincibleMan99 2 года назад
Great voice Great explanation 👍
@typefastco
@typefastco 2 года назад
Thank you! 😃
@enjoythements777
@enjoythements777 3 года назад
can you make a video explanation if you have multiple jobs running, lets say user import a csv sheet with headers (id, fruits) and rows 1, apple 2, apple 3, apple 4, banana 5, banana 6, kiwi and you want to send the user one email with all the fruits not containing apple. in my case now, there is an email send after every background job has run, but i want to bundle them all in one mail.... i hope this makes sense.. thansk anway!
@enjoythements777
@enjoythements777 3 года назад
im not sure where my first comment went but i was struggling with this for days! this video couldnt come at a better timing! www.reddit.com/r/rails/comments/nl1xw9/struggling_with_this_sidekiq_service_object_issue/
@typefastco
@typefastco 3 года назад
I'm not really sure what you're struggling with, but I can cover some CSV importing into the db if you would like. I skimmed your reddit post and I think you want to do it in one job rather than multiple batches.
@enjoythements777
@enjoythements777 3 года назад
@@typefastco i want to send 1 mail with the rejected rows, not multiple mails....
@enjoythements777
@enjoythements777 3 года назад
@@typefastco so instead of a job per row, one job for the whole csv?
@typefastco
@typefastco 3 года назад
@@enjoythements777 This is what I would do. Pass in the directory in a string format of the CSV into your background job. Loop through the rows in your CSV that has your user information, and save them to the database. While you do this, have an array that you push onto the rejected records. After the initial loop where you're saving the CSV records into your database, take the resulting array that contains your rejected user data, and send your email using that array. Hope that makes sense.
Далее
Avoiding ActiveRecord callbacks
19:30
Просмотров 454
Solving one of PostgreSQL's biggest weaknesses.
17:12
Просмотров 209 тыс.
На кого пойти учиться?
00:55
Просмотров 202 тыс.
Upgrading from Rails 7.1 to 7.2
25:58
Просмотров 320
SQLc is the perfect tool for those who don't like ORMs
28:11
Extracting out common classes in tailwind
31:06
На кого пойти учиться?
00:55
Просмотров 202 тыс.