Readit News logoReadit News
kgeist commented on Avoid UUID Version 4 Primary Keys in Postgres   andyatkinson.com/avoid-uu... · Posted by u/pil0u
AtNightWeCode · 6 hours ago
The counter argument I would say is that having all these integer ids comes with many problems. You can't make em public cause they leak info. They are not unique across environments. Meaning you have to spin up a lot of bs envs to just run it. But retros are for complaining about test envs, right?

Uuid4 are only 224bits is a bs argument. Such a made up problem.

But a fair point is that one should use a sequential uuid to avoid fragmentation. One that has a time part.

kgeist · 5 hours ago
Some additional cases we encounter quite often where UUIDs help:

- A client used to run our app on-premises and now wants to migrate to the cloud.

- Support engineers want to clone a client’s account into the dev environment to debug issues without corrupting client data.

- A client wants to migrate their account to a different region (from US to EU).

Merging data using UUIDs is very easy because ID collisions are practically impossible. With integer IDs, we'd need complex and error-prone ID-rewriting scripts. UUIDs are extremely useful even when the tables are small, contrary to what the article suggests.

kgeist commented on Why Twilio Segment moved from microservices back to a monolith   twilio.com/en-us/blog/dev... · Posted by u/birdculture
waterproof · 2 days ago
The only rationale given for the initial switch to microservices is this:

> Initially, when the destinations were divided into separate services, all of the code lived in one repo. A huge point of frustration was that a single broken test caused tests to fail across all destinations.

You kept breaking tests in main so you thought the solution was to revamp your entire codebase structure? Seems a bit backward.

kgeist · 2 days ago
We had a similar problem in our monolith. Team #1 works on a feature, their code breaks tests. Team #2 works on another feature, their code is OK, but they can't move forward because of the failing tests from team #1. Plus often it takes additional time to figure out if it the tests fail because of feature #1 or feature #2, and who must fix them.

We solved it by simply giving every team their own dev environment (before merging to main). So if tests break in feature #1, it doesn't break anything for feature #2 or team #2. It's all confined to their environment. It's just an additional VM + a config in CI/CD. The only downside of this is that if there are conflicts between features they won't be caught immediately (only after one of the teams finally merges to main). But in our case it wasn't a problem because different teams rarely worked on the same parts of the monorepo at the same time due to explicit code ownership.

kgeist commented on Microservices should form a polytree   bytesauna.com/post/micros... · Posted by u/mapehe
kgeist · 3 days ago
I think what the article is doing wrong is treating all microservices the same.

Microservices can be split into at least 3 different groups:

  - infrastructure (auth, messaging, storage etc.)
  - domain-specific business logic (user, orders)
  - orchestration (when a scenario requires coordination between different domains)
If we split it like this, it's evident that:

   - orchestration microservices should only call business logic microservices 
  - business logic microservices can only call infrastructure microservices
  - infra microservices are the smallest building blocks and should not call anything else
This avoids circular dependencies, decreases the height of the tree to 3 in most cases, and also allows to "break" the rule #2 in the article, because come on, no one is going to write several versions of auth just to make it a polytree.

It also becomes clearer what a microservice should focus on when it comes to resilience/fault tolerance in a distributed environment:

  - infra microservices must be most resilient to failure, because everyone depends on them
  - orchestration microservices should focus on compensating logic (compensating transactions/sagas)
  - business logic microservices focus on business logic and its correctness

kgeist commented on Programmers and software developers lost the plot on naming their tools   larr.net/p/namings.html... · Posted by u/todsacerdoti
kgeist · 4 days ago
I think if a project name is easily googleable, it's a good name. If I see "generic-tool-name failed" in the logs and can't immediately find what that thing even is, because I get lots of irrelevant search results, it's a bad name. This can happen with both descriptive and cutesy names.

Deleted Comment

kgeist commented on Golang's big miss on memory arenas   avittig.medium.com/golang... · Posted by u/andr3wV
kgeist · 5 days ago
>Instead of asking the runtime for memory object-by-object, an Arena lets you allocate a large pool of memory upfront. You fill that pool with objects using a simple bump pointer (which is CPU cache-friendly), and when you are done, you free the entire pool at once

>They have been trying to prove they can achieve Arena-like benefits with, for example, improved GC algorithms, but all have failed to land

The new Green Tea GC from Go 1.25 [0]:

  Instead of scanning objects we scan whole pages. Instead of tracking objects on our work list, we track whole pages. We still need to mark objects at the end of the day, but we’ll track marked objects locally to each page, rather than across the whole heap.
Sounds like a similar direction: "let's work with many objects at once". They mention better cache-friendliness and all.

[0] https://go.dev/blog/greenteagc

kgeist commented on If you're going to vibe code, why not do it in C?   stephenramsay.net/posts/v... · Posted by u/sramsay
badRNG · 6 days ago
> Speaking of vibe coding in archaic languages

Well, I think we can say C is archaic when most developers write in something that for one isn't C, two isn't a language itself written in C, or three isn't running on something written in C :)

kgeist · 6 days ago
If we take the most popular programming languages and look at what their reference (or most popular) implementations are written in, then we get:

  C++: JavaScript (V8), Java, C#

  C: Python, PHP, Lua, Ruby

  Self-hosted: Go, Rust
Far from archaic indeed. We're still living in the C/C++ world.

Deleted Comment

kgeist commented on Client-side GPU load balancing with Redis and Lua   galileo.ai/blog/how-we-bo... · Posted by u/lneiman
PunchyHamster · 7 days ago
I'm gonna guess just switching from round-robin to leastconn (most balancers offer that option) would solve that just fine. You can then go to dynamically tune server weights if you have servers of unequal size or some other issues.
kgeist · 7 days ago
Yeah, that can work. Just yesterday I benchmarked load balancing of LLM workloads across 2 GPUs using a simple least_conn from nginx. The total token/sec scaled as expected (2 GPUs => 2x token/sec), and GPU utilization reached 100% on both, as I increased concurrency from 1 to 128 simultaneous generations.
kgeist commented on Google Titans architecture, helping AI have long-term memory   research.google/blog/tita... · Posted by u/Alifatisk
bethekidyouwant · 8 days ago
In what world can you not always break the response of an AI by feeding it a bunch of random junk?
kgeist · 8 days ago
I mean, currently LLMs are stateless and you can get rid of all the poisoned data by just starting a new conversation (context). And OP introduces "long-term memory" where junk will accumulate with time

u/kgeist

KarmaCake day4005March 7, 2021View Original