?? Golang Weekly #381: Database Abstractions for Golang

?? Golang Weekly #381: Database Abstractions for Golang

?? GoPa Golang Weekly Newsletter is part of?FAUN Developer Community. We help developers learn and grow by keeping them up with what?matters.


?? Opening

?????Tech Enthusiasts, Assemble!?????

Calling all DevOps heroes, Kubernetes sailors, Golang wizards, and Cloud-natives! ??

FAUN has Subreddits just waiting for you. Join the community, where sharing is caring, and knowledge is limitless! ??


Engage in thought-provoking discussions, share your mighty projects, soak in wisdom from industry gurus, and forge bonds with tech aficionados around the globe! ??????

The realms of knowledge are infinite – let's explore them together!?????


?? From the web

How Big Should a Programming Language Be?

Programming languages have a tendency to grow in size over time, making them more difficult to use reliably. This growth is driven by the desire to add new features and solve specific problems, but it comes at the cost of increased complexity and cognitive load for users.

python ?? `defer`

Python has a library called?sorcery?that allows the implementation of per-scope finalizers similar to Go's defer statement. This library utilizes AST rewriting and live compilation techniques to achieve the desired behavior without the need for decorators or excessive indentation.


???From 26 Minutes to 20 Seconds: Using pprof to optimize large GraphQL Operations in Go

The open-source GraphQL engine, graphql-go-tools, used by WunderGraph, experienced a significant performance difference when a customer routed a mutation through their gateway built on top of graphql-go-tools. While the mutation took around 1 minute when executed directly against their GraphQL servers, routing it through the gateway resulted in approximately 70 minutes. Investigation revealed that the performance issue was caused by handling a large bulk operation with 70,000 input items, and a workaround was found by moving the data to the variables JSON. By implementing optimizations for JSON encoding and input value injection, the execution time of the operation was drastically reduced from 26 minutes to 150 milliseconds, impressing the customer with a 98.71% improvement. Additionally, using the gateway proved faster than executing the mutation directly against the GraphQL server due to the optimized parser and normalization engine of graphql-go-tools.


Announcing GoReleaser v1.19 — the big release

GoReleaser's latest release includes almost 200 commits, introducing features like Nixpkgs support, Winget manifest generation, and pull request integration with Homebrew, Krew, and Scoop. It also includes security improvements, deprecations, template enhancements, and bug fixes, making it a comprehensive update for Go developers.


Code Review: Should the Go project stop importing PRs?


???The Tragic Death of Inheritance

After years of advocating for inheritance in programming, the author eventually realized the benefits of composition over inheritance, particularly in terms of code duplication and readability. They explain the differences between the two paradigms and provide examples to support their argument.


AutoML pipeline for tabular data on VertexAI in Go

Automated Machine Learning (AutoML) has revolutionized the machine learning model development process by automating various stages of the pipeline, eliminating manual labor, and making it faster and more accessible. With AutoML, developers and data scientists can accelerate model development, democratize machine learning, and focus on higher-level tasks and domain-specific challenges.


Time is not a synchronization primitive

Using time as a synchronization mechanism in programming can lead to flaky and unreliable code, causing tests, scripts, and applications to break randomly. Instead, it is recommended to use proper synchronization mechanisms like channels to ensure the desired state. To discourage the use of time.Sleep in tests, a tool called nosleep is introduced as a Go linter that fails the code if it detects the presence of time.Sleep. However, if there is a genuine need to use time as a synchronization method, a magic command "https://nosleep:bypass" can be added with a valid reason to override the linter's check.


Rust Module System Encourages Poor Practices (Comparing to Go)

Rust's design of crates and modules, with the ability to have cyclic dependencies and organize modules as a tree within a crate, promotes the growth of large crates rather than encouraging the use of numerous reasonably-sized crates. In contrast, Go's design of packages and files, with acyclic dependencies and a flat directory structure, naturally discourages the creation of large packages and makes it easy to manage multiple packages. This difference in design choices affects code organization and compilation speed, ultimately leading to better-designed systems in Go compared to Rust.

Database abstractions for Golang

Assembled, a company that has been using Golang as its exclusive backend language since 2018, has developed three abstractions to address the challenges of database access in Golang. These abstractions include an interface for sharing code between single- and multi-row getters, a helper method to handle errors and close rows when scanning from the database, and an interface for sharing code between transactions and non-transactions. These abstractions improve query performance, ensure proper handling of database connections, and facilitate code reuse in different contexts.


Supply chain security for Go: Compromised dependencies

The rise in supply chain attacks on software has made it crucial for open-source developers using Go to monitor and assess the risks of their dependencies. Go provides built-in protections to help trust the integrity of packages, including the ability to detect and prevent malicious versions or withdrawals of dependencies.


Using a Golang package in Python using Gopy

To statically validate PromQL queries in a Python-based CLI tool, the author faced a challenge of finding a suitable Python package. Instead, they decided to use VictoriaMetrics's MetricsQL parser, an open-source TSDB similar to Prometheus. To incorporate Go code into the Python project, they utilized Gopy, a popular library that compiles Go code into a Python module, simplifying the process for Python developers unfamiliar with Go and C.


? Supporters

Exclusive 20% Discount on "Cloud Native Microservices With Kubernetes" - Limited Time Offer!

We are thrilled to announce a special offer for our widely acclaimed book, "Cloud Native Microservices With Kubernetes - A Comprehensive Guide to Building, Scaling, Deploying, Observing, and Managing Highly-Available Microservices in Kubernetes".

Starting today and running until July 31st, we're offering an exclusive?20% discount?off the regular price!

To take advantage of this offer, simply use?this coupon link?.

Don't miss this opportunity. Remember, the offer is only valid until July 31st. Grab your copy now and unlock the full potential of cloud-native microservices with Kubernetes!

We look forward to empowering your journey in the world of cloud computing!

Happy learning!

FAUN Team

No alt text provided for this image



?? Spread the word and help developers find you by promoting your projects on FAUN.?Get in touch?for more information.



??? Swag Store

ByteVibe New Arrivals: Desk Mats

No alt text provided for this image




???20%?exclusive discount for FAUNers on all products (+free shipping included) when you use the code "THANKSFAUN".

?? Discussions

What boosted your confidence as a new programmer?

Novice programmers can gain confidence by starting with small projects and gradually building their skills, similar to how beginners in other crafts can become skilled craftsmen.


?? Tools

TomWright/dasel

Select, put and delete data from JSON, TOML, YAML, XML and CSV files with a single tool. Supports conversion between formats and can be used as a Go package.


frain-dev/convoy

Open Source Webhooks Gateway; For both incoming & outgoing events.


goravel/goravel

A Golang framework for web artisans. Tribute to Laravel.


ent/ent

An entity framework for Go


?? Spread the word and help developers find and follow your Open Source project by promoting it on FAUN.?Get in touch?for more information.



?? Did you know?

The Apollo 11 guidance computer, which helped land humans on the moon, had less processing power than a modern-day smartphone.


?? Meme of the week

No alt text provided for this image



?? Thanks for reading

?? Never miss an issue

Join FAUN Developer Community and subscribe to our newsletter?here.

?? Keep in touch and follow us on social media:

- ??LinkedIn

- ??Medium

- ??Twitter

- ??Facebook

- ??Reddit

- ??Instagram

???Was this newsletter helpful?

We'd really appreciate it if you could share it with your friends! You can also?donate?to help us keep this newsletter going.

???Have a question or feedback?

Feel free to reach out to us at?[email protected]. We'd love to hear from you!

???Want to sponsor our newsletter?

Reach out to us at?[email protected]?and we'll get back to you as soon as possible.



要查看或添加评论,请登录

FAUN - Developer Community的更多文章

社区洞察

其他会员也浏览了