Golang Field ordering matters?
https://dev.to/aymanepraxe/golang-field-ordering-matters-2i6m
Greetings, Gophers! During the initial year of working with Golang, I kept thinking that there must...
#webdev #go #performance #beginners
▶️join: @readmemdd
Golang Field ordering matters?
https://dev.to/aymanepraxe/golang-field-ordering-matters-2i6m
Greetings, Gophers! During the initial year of working with Golang, I kept thinking that there must...
#webdev #go #performance #beginners
▶️join: @readmemdd
DEV Community
Golang Field ordering matters?
Greetings, Gophers! During the initial year of working with Golang, I kept thinking that there must...
Tricky Golang interview questions - Part 7: Data Race
https://dev.to/crusty0gphr/tricky-golang-interview-questions-part-7-data-race-753
Here is another code review interview question for you. This question is more advanced than the...
#go #interview #tutorial #programming
▶️join: @readmemdd
Tricky Golang interview questions - Part 7: Data Race
https://dev.to/crusty0gphr/tricky-golang-interview-questions-part-7-data-race-753
Here is another code review interview question for you. This question is more advanced than the...
#go #interview #tutorial #programming
▶️join: @readmemdd
DEV Community
Tricky Golang interview questions - Part 7: Data Race
Here is another code review interview question for you. This question is more advanced than the...
Como abstrair a conexão com base de dados em Golang?
https://dev.to/ortizdavid/como-abstrair-a-conexao-com-base-de-dados-em-golang-374c
A abstracção da conexão com a base de dados e a injecção de dependências organizam o código e trazem...
#go #postgres #webdev
▶️join: @readmemdd
Como abstrair a conexão com base de dados em Golang?
https://dev.to/ortizdavid/como-abstrair-a-conexao-com-base-de-dados-em-golang-374c
A abstracção da conexão com a base de dados e a injecção de dependências organizam o código e trazem...
#go #postgres #webdev
▶️join: @readmemdd
DEV Community
Como abstrair a conexão com base de dados em Golang?
A abstracção da conexão com a base de dados e a injecção de dependências organizam o código e trazem...
Turbocharge Your Go App: Mastering Blazing-Fast Static File Serving Over TCP
https://dev.to/aymanepraxe/turbocharge-your-go-app-mastering-blazing-fast-static-file-serving-over-tcp-1em0
Hey gophers 🐹! Have you ever thought of the best ways to ensure faster serving of static files using...
#webdev #programming #tutorial #go
▶️join: @readmemdd
Turbocharge Your Go App: Mastering Blazing-Fast Static File Serving Over TCP
https://dev.to/aymanepraxe/turbocharge-your-go-app-mastering-blazing-fast-static-file-serving-over-tcp-1em0
Hey gophers 🐹! Have you ever thought of the best ways to ensure faster serving of static files using...
#webdev #programming #tutorial #go
▶️join: @readmemdd
DEV Community
Turbocharge Your Go App: Mastering Blazing-Fast Static File Serving Over TCP
Hey gophers 🐹! Have you ever thought of the best ways to ensure faster serving of static files using...
Forwarded from Go Casts 🚀
یکی از زیبایی های گولنگ اینترفیس هست، چیزی که فلسفه composition over inheritance رو به زیبایی هر چه تمام تر در گولنگ امکانپذیر کرده
ولی نحوه استفاده از اینترفیس با زبان های دیگه متفاوته
این مقاله توضیحاتی در این مورد داده
https://eli.thegreenplace.net/2023/the-power-of-single-method-interfaces-in-go/
اینم یه مقاله زیرخاکی از russ cox در مورد اینترفیس
Go Data Structures: Interfaces
Posted on Tuesday, December 1, 2009
https://research.swtch.com/interfaces
@gocasts
#golang #interface
ولی نحوه استفاده از اینترفیس با زبان های دیگه متفاوته
این مقاله توضیحاتی در این مورد داده
https://eli.thegreenplace.net/2023/the-power-of-single-method-interfaces-in-go/
اینم یه مقاله زیرخاکی از russ cox در مورد اینترفیس
Go Data Structures: Interfaces
Posted on Tuesday, December 1, 2009
https://research.swtch.com/interfaces
@gocasts
#golang #interface
Go: integer overflows
https://dev.to/ccoveille/go-integer-overflows-5dfh
Let's continue my articles about integer overflows in Go. Here are examples var a int var b...
#go
▶️join: @readmemdd
Go: integer overflows
https://dev.to/ccoveille/go-integer-overflows-5dfh
Let's continue my articles about integer overflows in Go. Here are examples var a int var b...
#go
▶️join: @readmemdd
DEV Community
Go: integer overflows
Let's continue my articles about integer overflows in Go. Here are examples var a int var b...
Choosing the Right Programming Language for Low Latency Applications: Go vs. C++
https://dev.to/adityabhuyan/choosing-the-right-programming-language-for-low-latency-applications-go-vs-c-20m4
When developing software that requires extremely low latency, such as high-frequency trading...
#go #cpp #latency
▶️join: @readmemdd
Choosing the Right Programming Language for Low Latency Applications: Go vs. C++
https://dev.to/adityabhuyan/choosing-the-right-programming-language-for-low-latency-applications-go-vs-c-20m4
When developing software that requires extremely low latency, such as high-frequency trading...
#go #cpp #latency
▶️join: @readmemdd
DEV Community
Choosing the Right Programming Language for Low Latency Applications: Go vs. C++
When developing software that requires extremely low latency, such as high-frequency trading...
Go Time and Duration | Programming Tutorials
https://dev.to/labex/go-time-and-duration-programming-tutorials-786
This lab aims to test your understanding of Go's time and duration support.
#labex #go #coding #programming
▶️join: @readmemdd
Go Time and Duration | Programming Tutorials
https://dev.to/labex/go-time-and-duration-programming-tutorials-786
This lab aims to test your understanding of Go's time and duration support.
#labex #go #coding #programming
▶️join: @readmemdd
DEV Community
Go Time and Duration | Programming Tutorials
This lab aims to test your understanding of Go's time and duration support.
Integrating Templ
https://dev.to/caffeineordeath/integrating-templ-3j0m
This is going to be a longer one as we need three (3) files now. Also, we need a static directory for...
#webdev #go #learning #tutorial
▶️join: @readmemdd
Integrating Templ
https://dev.to/caffeineordeath/integrating-templ-3j0m
This is going to be a longer one as we need three (3) files now. Also, we need a static directory for...
#webdev #go #learning #tutorial
▶️join: @readmemdd
DEV Community
Integrating Templ
This is going to be a longer one as we need three (3) files now. Also, we need a static directory for...
Why Everyone Should Learn Go (Even If You Think You Don't Need Another Language in Your Life)
https://dev.to/pranta/why-everyone-should-learn-go-even-if-you-think-you-dont-need-another-language-in-your-life-670
Ah, Go, the programming language. You’ve probably heard about it, maybe from that one...
#go #google #cloud #programming
▶️join: @readmemdd
Why Everyone Should Learn Go (Even If You Think You Don't Need Another Language in Your Life)
https://dev.to/pranta/why-everyone-should-learn-go-even-if-you-think-you-dont-need-another-language-in-your-life-670
Ah, Go, the programming language. You’ve probably heard about it, maybe from that one...
#go #google #cloud #programming
▶️join: @readmemdd
DEV Community
Why Everyone Should Learn Go (Even If You Think You Don't Need Another Language in Your Life)
Ah, Go, the programming language. You’ve probably heard about it, maybe from that one...
Golang Pointers
https://dev.to/nerdherd/golang-pointers-j61
Coming from Ruby, thinking about Golang pointers does require a shift in thinking. In...
#go #beginners #todayilearned #webdev
▶️join: @readmemdd
Golang Pointers
https://dev.to/nerdherd/golang-pointers-j61
Coming from Ruby, thinking about Golang pointers does require a shift in thinking. In...
#go #beginners #todayilearned #webdev
▶️join: @readmemdd
DEV Community
Golang Pointers
Coming from Ruby, thinking about Golang pointers does require a shift in thinking. In...
Cómo escribir archivos de log en Go
https://dev.to/fabkdev/como-escribir-archivos-de-log-en-go-916
Logging en sistemas UNIX UNIX tiene sus propios archivos de log para escribir información...
#go #logging #spanish
▶️join: @readmemdd
Cómo escribir archivos de log en Go
https://dev.to/fabkdev/como-escribir-archivos-de-log-en-go-916
Logging en sistemas UNIX UNIX tiene sus propios archivos de log para escribir información...
#go #logging #spanish
▶️join: @readmemdd
DEV Community
Cómo escribir archivos de log en Go
Logging en sistemas UNIX UNIX tiene sus propios archivos de log para escribir información...
Como criar um Repository Genérico em Golang?
https://dev.to/ortizdavid/como-criar-um-repository-generico-em-golang-47fo
O Repository genérico facilita o agrupamento das operações comuns na base de dados no sistema. É...
#go #architecture #designpatterns
▶️join: @readmemdd
Como criar um Repository Genérico em Golang?
https://dev.to/ortizdavid/como-criar-um-repository-generico-em-golang-47fo
O Repository genérico facilita o agrupamento das operações comuns na base de dados no sistema. É...
#go #architecture #designpatterns
▶️join: @readmemdd
DEV Community
Como criar um Repository Genérico em Golang?
O Repository genérico facilita o agrupamento das operações comuns na base de dados no sistema. É...
Gorm: Sneak Peek of Custom Data Types
https://dev.to/ossan/gorm-sneak-peek-of-custom-data-types-97n
Welcome back, folks 👀! Today, we discuss a specific use case we might face when moving data back and...
#go #gorm #models #database
▶️join: @readmemdd
Gorm: Sneak Peek of Custom Data Types
https://dev.to/ossan/gorm-sneak-peek-of-custom-data-types-97n
Welcome back, folks 👀! Today, we discuss a specific use case we might face when moving data back and...
#go #gorm #models #database
▶️join: @readmemdd
DEV Community
Gorm: Sneak Peek of Custom Data Types
Welcome back, folks 👀! Today, we discuss a specific use case we might face when moving data back and...
From Hack Idea to Release: Reflections on Creating and Releasing a Open Source Project
https://dev.to/janderssonse/from-friday-hack-to-release-reflections-on-creating-and-releasing-a-open-source-project-1ljg
This is part of a series aimed at beginner and intermediate developers, releasing or intrigued by...
#opensource #go #cli
▶️join: @readmemdd
From Hack Idea to Release: Reflections on Creating and Releasing a Open Source Project
https://dev.to/janderssonse/from-friday-hack-to-release-reflections-on-creating-and-releasing-a-open-source-project-1ljg
This is part of a series aimed at beginner and intermediate developers, releasing or intrigued by...
#opensource #go #cli
▶️join: @readmemdd
DEV Community
From Friday Hack to Release: Reflections on Creating and Releasing a Open Source Project
From Friday Patch Hack to Release: Reflections on Creating and Releasing a Open Source...
Stay Updated with PHP/Laravel: Weekly News Summary (09/09/2024-15/09/2024
https://dev.to/poovarasu/stay-updated-with-phplaravel-weekly-news-summary-09092024-15092024-55h1
Intro: Check out this insightful summary of PHP/Laravel Weekly News for September 09th to September...
#php #laravel
▶️join: @readmemdd
Stay Updated with PHP/Laravel: Weekly News Summary (09/09/2024-15/09/2024
https://dev.to/poovarasu/stay-updated-with-phplaravel-weekly-news-summary-09092024-15092024-55h1
Intro: Check out this insightful summary of PHP/Laravel Weekly News for September 09th to September...
#php #laravel
▶️join: @readmemdd
DEV Community
Stay Updated with PHP/Laravel: Weekly News Summary (09/09/2024-15/09/2024
Intro: Check out this insightful summary of PHP/Laravel Weekly News for September 09th to September...
👍1
سوال مصاحبه: چطور میشه بررسی کرد که نام کاربری بین یک میلیارد کاربر تکراری نباشه؟ 🤔
این روزها با رشد سریع کسبوکارها، ثبتنام کاربرهای جدید هم به یه چالش تبدیل شده. یکی از مهمترین بخشها اینه که مطمئن بشیم هر کاربر یه نام کاربری منحصربهفرد داره. اخیراً در مورد این موضوع یه تحقیقی کردم و دو راهحل خوب پیدا کردم: استفاده از حافظه Redis و فیلتر Bloom. هر دو کمک میکنن سریع و بدون فشار زیاد به سیستم، نام کاربری جدید رو بررسی کنیم.
### مشکل کجاست؟ 😟
اگه بخوایم از روشهای سنتی و دیتابیس برای بررسی نام کاربری استفاده کنیم، با زیاد شدن کاربرها سیستم کند میشه و با مشکلات زیر روبهرو میشیم:
- کندی در درخواستها ⌛
- فشار زیاد به دیتابیس💥 که باعث مصرف زیاد منابع میشه.
- مشکل در مقیاسپذیری 🚧 یعنی وقتی تعداد درخواستها زیاد بشه، سرور نمیتونه همه رو مدیریت کنه.
### استفاده از Redis: سریع ولی پرمصرف ⚡💾
ردیس Redis کمک میکنه که بررسی نام کاربری خیلی سریع بشه، چون دادهها رو توی حافظه ذخیره میکنه. اما این روش یه مشکل بزرگ داره: حافظه زیادی مصرف میکنه. مثلاً برای یک میلیارد نام کاربری به 15 گیگابایت حافظه نیاز داریم! 😳 که تو سیستمهای بزرگ، خیلی پرهزینه و غیرعملی میشه.
### فیلتر Bloom: ساده، بهینه و کممصرف 💡
حالا بریم سراغ فیلتر Bloom. این فیلتر یه روش خیلی بهینهتره که فضای حافظه خیلی کمتری استفاده میکنه. برای همون یک میلیارد نام کاربری، فقط 1.67 گیگابایت حافظه نیاز داره! 😎
اما فیلتر Bloom چیه؟ بذار یه مثال ساده بزنم:
فرض کن یه کیف داری که یه سری جیب کوچیک داره. هر بار که میخوای یه نام کاربری جدید رو ذخیره کنی، یه سری کلید (یعنی همون الگوریتمهای هش) بهت میگه تو کدوم جیبهای کیف بذاری. بعد اگه بخوای ببینی اون نام کاربری قبلاً ذخیره شده یا نه، فقط کافیه جیبهای مشخص شده رو چک کنی. اگه تو هر جیب چیزی باشه، یعنی احتمالاً اون نام کاربری قبلاً استفاده شده. ولی اگه یکی از جیبها خالی باشه، مطمئنی که اون نام کاربری وجود نداره. 😄
با این روش:
- حافظه کمی استفاده میشه 🧠
- سرعت بررسی خیلی بالاست ⚡
البته یه نکته کوچیک داره: بعضی وقتا ممکنه به اشتباه بگه که یه نام کاربری هست در حالی که نیست (این همون خطای مثبت یا False Positive هست)، ولی در اکثر مواقع این خطا قابل چشمپوشیه.
### نتیجهگیری 🎯
اگه با سیستمهایی کار میکنید که میلیونها یا حتی میلیاردها کاربر دارن، فیلتر Bloom یه راهحل خیلی بهینه و هوشمند برای بررسی یونیک بودن نام کاربریه. هم توی حافظه صرفهجویی میکنه، هم سرعت بررسی رو بالا نگه میداره.
اگه در مورد بهینهسازی سیستمهای بزرگ کنجکاوید یا دوست دارید بیشتر بدونید، خوشحال میشم با هم بیشتر صحبت کنیم! 😊✌️
راستی مشتی باشید!
▶️join: @readmemdd
این روزها با رشد سریع کسبوکارها، ثبتنام کاربرهای جدید هم به یه چالش تبدیل شده. یکی از مهمترین بخشها اینه که مطمئن بشیم هر کاربر یه نام کاربری منحصربهفرد داره. اخیراً در مورد این موضوع یه تحقیقی کردم و دو راهحل خوب پیدا کردم: استفاده از حافظه Redis و فیلتر Bloom. هر دو کمک میکنن سریع و بدون فشار زیاد به سیستم، نام کاربری جدید رو بررسی کنیم.
### مشکل کجاست؟ 😟
اگه بخوایم از روشهای سنتی و دیتابیس برای بررسی نام کاربری استفاده کنیم، با زیاد شدن کاربرها سیستم کند میشه و با مشکلات زیر روبهرو میشیم:
- کندی در درخواستها ⌛
- فشار زیاد به دیتابیس💥 که باعث مصرف زیاد منابع میشه.
- مشکل در مقیاسپذیری 🚧 یعنی وقتی تعداد درخواستها زیاد بشه، سرور نمیتونه همه رو مدیریت کنه.
### استفاده از Redis: سریع ولی پرمصرف ⚡💾
ردیس Redis کمک میکنه که بررسی نام کاربری خیلی سریع بشه، چون دادهها رو توی حافظه ذخیره میکنه. اما این روش یه مشکل بزرگ داره: حافظه زیادی مصرف میکنه. مثلاً برای یک میلیارد نام کاربری به 15 گیگابایت حافظه نیاز داریم! 😳 که تو سیستمهای بزرگ، خیلی پرهزینه و غیرعملی میشه.
### فیلتر Bloom: ساده، بهینه و کممصرف 💡
حالا بریم سراغ فیلتر Bloom. این فیلتر یه روش خیلی بهینهتره که فضای حافظه خیلی کمتری استفاده میکنه. برای همون یک میلیارد نام کاربری، فقط 1.67 گیگابایت حافظه نیاز داره! 😎
اما فیلتر Bloom چیه؟ بذار یه مثال ساده بزنم:
فرض کن یه کیف داری که یه سری جیب کوچیک داره. هر بار که میخوای یه نام کاربری جدید رو ذخیره کنی، یه سری کلید (یعنی همون الگوریتمهای هش) بهت میگه تو کدوم جیبهای کیف بذاری. بعد اگه بخوای ببینی اون نام کاربری قبلاً ذخیره شده یا نه، فقط کافیه جیبهای مشخص شده رو چک کنی. اگه تو هر جیب چیزی باشه، یعنی احتمالاً اون نام کاربری قبلاً استفاده شده. ولی اگه یکی از جیبها خالی باشه، مطمئنی که اون نام کاربری وجود نداره. 😄
با این روش:
- حافظه کمی استفاده میشه 🧠
- سرعت بررسی خیلی بالاست ⚡
البته یه نکته کوچیک داره: بعضی وقتا ممکنه به اشتباه بگه که یه نام کاربری هست در حالی که نیست (این همون خطای مثبت یا False Positive هست)، ولی در اکثر مواقع این خطا قابل چشمپوشیه.
### نتیجهگیری 🎯
اگه با سیستمهایی کار میکنید که میلیونها یا حتی میلیاردها کاربر دارن، فیلتر Bloom یه راهحل خیلی بهینه و هوشمند برای بررسی یونیک بودن نام کاربریه. هم توی حافظه صرفهجویی میکنه، هم سرعت بررسی رو بالا نگه میداره.
اگه در مورد بهینهسازی سیستمهای بزرگ کنجکاوید یا دوست دارید بیشتر بدونید، خوشحال میشم با هم بیشتر صحبت کنیم! 😊✌️
راستی مشتی باشید!
▶️join: @readmemdd
🔥3💯2❤1⚡1👏1
Optimizing Memory Usage in Golang: When is a Variable Allocated to the Heap
https://dev.to/yudaph/optimizing-memory-usage-in-golang-when-is-a-variable-allocated-to-the-heap-3ggn
When developing applications with Golang, one of the common challenges faced is memory management....
#go #productivity
▶️join: @readmemdd
Optimizing Memory Usage in Golang: When is a Variable Allocated to the Heap
https://dev.to/yudaph/optimizing-memory-usage-in-golang-when-is-a-variable-allocated-to-the-heap-3ggn
When developing applications with Golang, one of the common challenges faced is memory management....
#go #productivity
▶️join: @readmemdd
DEV Community
Optimizing Memory Usage in Golang: When is a Variable Allocated to the Heap
When developing applications with Golang, one of the common challenges faced is memory management....
ZenReactor: Building an AI-Powered Toolkit for YouTube Creators (Dev Exploration)
https://dev.to/thelamedev/zenreactor-building-an-ai-powered-toolkit-for-youtube-creators-dev-exploration-35gb
Hey there, fellow developers! I'm excited to share a side project I've been working on: ZenReactor,...
#product #go #ai #discuss
▶️join: @readmemdd
ZenReactor: Building an AI-Powered Toolkit for YouTube Creators (Dev Exploration)
https://dev.to/thelamedev/zenreactor-building-an-ai-powered-toolkit-for-youtube-creators-dev-exploration-35gb
Hey there, fellow developers! I'm excited to share a side project I've been working on: ZenReactor,...
#product #go #ai #discuss
▶️join: @readmemdd
DEV Community
ZenReactor: Building an AI-Powered Toolkit for YouTube Creators (Dev Exploration)
Hey there, fellow developers! I'm excited to share a side project I've been working on: ZenReactor,...
Mastering Go gRPC Services with Docker: A One-Stop Guide
https://dev.to/narmidm/mastering-go-grpc-services-with-docker-a-one-stop-guide-5298
Ahoy, fellow developers! Are you ready to dive deep into the world of Go, gRPC, and Docker? Whether...
#grpc #go #docker
▶️join: @readmemdd
Mastering Go gRPC Services with Docker: A One-Stop Guide
https://dev.to/narmidm/mastering-go-grpc-services-with-docker-a-one-stop-guide-5298
Ahoy, fellow developers! Are you ready to dive deep into the world of Go, gRPC, and Docker? Whether...
#grpc #go #docker
▶️join: @readmemdd
DEV Community
Mastering Go gRPC Services with Docker: A One-Stop Guide
Hello, fellow developers! Ready to jump into the exciting world of Go, gRPC, and Docker? Whether...