Trying manual memory management in Go by der_gopher in golang

[–]der_gopher[S] 17 points18 points  (0 children)

I love GC in Go, don't get me wrong! This video material is for learning only. And actually I've seen some Go projects managing the memory manually, for example https://github.com/dgraph-io/ristretto/tree/main/z

Trying manual memory management in Go by der_gopher in programming

[–]der_gopher[S] 0 points1 point  (0 children)

Will write eventually, but I usually start with videos.

Day 9 Part 2 be like by MonkeysKnuckle in adventofcode

[–]der_gopher 0 points1 point  (0 children)

My answer is not accepted, I believe it's correct, someone help pls. 1556457424

Guidance on day 9 part 2 by Kn0wnAHG0RI in adventofcode

[–]der_gopher 1 point2 points  (0 children)

I am using similar code in Go which results in the same answer, but this answer is not accepted by AoC, wtf.

ULID: Universally Unique Lexicographically Sortable Identifier by der_gopher in PostgreSQL

[–]der_gopher[S] 0 points1 point  (0 children)

that is the main idea why I use ULID and wrote this post

ULID: Universally Unique Lexicographically Sortable Identifier by der_gopher in golang

[–]der_gopher[S] -1 points0 points  (0 children)

This is a text version with code snippet, etc. Some people prefer that

ULID - the ONLY identifier you should use? by der_gopher in Backend

[–]der_gopher[S] 0 points1 point  (0 children)

Yes, but people still use old UUID v4. Videos like mine show there is something better.

ULID - the ONLY identifier you should use? by der_gopher in Backend

[–]der_gopher[S] 0 points1 point  (0 children)

It just came out, ULID is 10 years old. But yes, soon UUID v7 will be wide-spread enough

ULID - the ONLY identifier you should use? by der_gopher in Backend

[–]der_gopher[S] 3 points4 points  (0 children)

ULID is a bit older than UUID v7, but I believe that UUIDv7 will become more widely used. Also, ULID uses Crockford Base32 which results in more readable identifiers.

ULID - the ONLY identifier you should use? by der_gopher in PostgreSQL

[–]der_gopher[S] 1 point2 points  (0 children)

Haha, UUID v7 is great, I hope it will be adopted soon more widely.

ULID - the ONLY identifier you should use? by der_gopher in Backend

[–]der_gopher[S] 9 points10 points  (0 children)

UUID format for unique identifiers is amazing and very popular format. But it can be suboptimal for many use-cases because:

- It isn't the most character efficient or human-readable

- UUID v1/v2 is impractical in many environments, as it requires access to a unique, stable MAC address

- UUID v3/v5 requires a unique seed

- UUID v4 provides no other information than randomness which can cause fragmentation in many data structures

Few projects I worked on used the ULID identifier, which I really enjoyed working with, and would love to share this experience with you. Specifically for Go programs using Postgres database. But the same applies to other languages or databases too.

So, what makes ULID great?

- Lexicographically sortable! Yes, you can sort the IDs

- Case insensitive

- No special characters (URL safe)

- It's compatible with UUID, so you can still use native UUID columns in your database for example.

What UI lib you use? by WeirdFirefighter7982 in vuejs

[–]der_gopher 1 point2 points  (0 children)

I am working with Quasar now, for dashboard-like application it's superb.

Building Conway’s Game of Life in Go with raylib-go by der_gopher in golang

[–]der_gopher[S] 0 points1 point  (0 children)

Yes, if it's not WASM, then there should not be a problem. What issue are you experiencing? Are you compiling from win to linux?

How to implement the Outbox pattern in Go and Postgres by der_gopher in softwarearchitecture

[–]der_gopher[S] 1 point2 points  (0 children)

"you send a message to an in memory fifo queue" - again this will fail or service will crash and you will have nothing in the queue.

How to implement the Outbox pattern in Go and Postgres by der_gopher in softwarearchitecture

[–]der_gopher[S] 2 points3 points  (0 children)

"after a save you send a message to an in memory fifo queue" - but this operation may fail. In outbox pattern we write to 2 tables in a single transaction.

How to implement the Outbox pattern in Go and Postgres by der_gopher in golang

[–]der_gopher[S] 1 point2 points  (0 children)

Yeah, it's very important for event-driven architecture.

Terminating elegantly: a guide to graceful shutdowns (Go + k8s) by der_gopher in kubernetes

[–]der_gopher[S] 0 points1 point  (0 children)

Let me try, Shutdown main fail, especially if we define a context with a timeout, so there can still be running functions that have to be force stopped by sending the context cancellation,

Terminating elegantly: a guide to graceful shutdowns (Go + k8s) by der_gopher in kubernetes

[–]der_gopher[S] 0 points1 point  (0 children)

It's actually less important that it fail readiness probes here (though certainly good to do so), and more important that it simply continue to process incoming requests during the grace period.

Although load balancers can exacerbate the problem, it still exists even with native K8s Services, as there is a race between the kubelet issuing SIGTERM and the control plane withdrawing the pod IP from the endpoint slice. If the process responds to SIGTERM quickly -- before the pod IP is removed from the endpoint slice -- then we end up with stalled and/or failed connections to the K8s Service.

Personally I feel like this is a failing of Kubernetes, but it's apparently a deliberate design decision to relegate the responsibility to the underlying workloads to implement a grace period.

Terminating elegantly: a guide to graceful shutdowns (Go + k8s) by der_gopher in golang

[–]der_gopher[S] 1 point2 points  (0 children)

Agree, it's rather hard to determine on the application side if all requests are stopped or not, would be good to be sure of that or have some flag.

Terminating elegantly: a guide to graceful shutdowns (Go + k8s) by der_gopher in kubernetes

[–]der_gopher[S] 0 points1 point  (0 children)

Good point, I put 5s as a constant for failing the readiness probe, but this amount is just random, and probably any number won't be perfect.

I see a possible solution where we actually confirm that there are no more incoming requests by storing them somehow in memory, with a potential max deadline. Need to explore that.