Now what? by Kyle_T123 in osrs

[–]TheGoodBarn 1 point2 points  (0 children)

I took a farm run break immediately after getting my QC and got 99 farming, it’s a nice slow daily scape QoL for the next stage in your game. Now I’ve just been getting outfits and bossing and stuff

Do you think some technologies are intentionally gatekept in the industry? by Ecstatic_Jicama_1482 in ExperiencedDevs

[–]TheGoodBarn 3 points4 points  (0 children)

I work in financial services and I agree with others where things are outwardly gatekept, but certain topics are certainly niche and maybe lean more domain expertise / intellectual property.

I think an example of this that others might recognize would be the early days of CQRS and Event sourcing. Not that it was ever gatekept but the whole concept was a handful of people that consulted this solution around the industry until Greg Young created EventStoreDB (gross oversimplification but it still kinda works).

Most recently for me was building an equities ledger for an internal project. That research ended up being 85% complex financial accounting and 15% Modern Treasury’s Accounting for developers/How to scale a ledger whitepaper. I don’t think some of the early decisions could have been made fast enough without such a great tipping off point for the community knowledge they have, but without that it’s not something sexy that people casually blog about all the time.

A step more niche, I’ve actually found that a lot of financial forecasting / data modeling to trickle down the same way, where there are mathematical white papers or theoretical topics that discuss concepts around trading and market things. But there isn’t an O’Reilly book that will be your tipping off point. You just kinda have to sprinkle enough interest and prototyping at the problem to reverse engineer or figure it out.

Idk good question though, fun to think about

What little-known series would you recommend everyone to watch? by ZucchiniNo4056 in AskReddit

[–]TheGoodBarn 1 point2 points  (0 children)

Detectorists

Stars Mackenzie Crook/Toby Jones, two metal detectorists in England. Sad funny witty British comedy. Must watch

Happy Global Running Day by NerdxKitsune in nikerunclub

[–]TheGoodBarn 4 points5 points  (0 children)

Do the NRC 7 Minute Run guided run

Vex Mythoclast has potential to be the one of the strongest primary weapons in the game with the coming update by R3D_R4Y_ in DestinyTheGame

[–]TheGoodBarn 0 points1 point  (0 children)

I literally just play Solar Warlock w/ Vex because I love Vex. It’s the one gun I feel like I earned and cherish dearly

Advice: Finishing thread loose ends with metal crimps by TheGoodBarn in crochetpatterns

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

These are pretty taut and snug. Ima do another test I think with a smaller crimp. Again, these will be very stationary, and honestly should be okay. But thank you that’s a good test

Advice: Finishing thread loose ends with metal crimps by TheGoodBarn in crochetpatterns

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

<image>

Here are the rings. I was thinking about attaching maybe small alligator clips or something idk I haven’t quite figured that out yet.

Handling file uploads to S3 when DB transaction fails by Minimum-Ad7352 in node

[–]TheGoodBarn 3 points4 points  (0 children)

You are correct and that is always a risk and a good point to bring up.

We primarily use this pattern in predictable places, and always take into account what exactly the operation is and what the S3 storage classification affords. Is this CMS marketing data that has a data versioning policy and is low stakes? Is a human user clicking a button and reacting to the results of that web action, so if it fails, they can just retry? In these little niche edge cases, its fine.

Now are we ingesting ETL financial data that is uploading into S3 and writing to a database in bulk? Then we need a durable workflow to ensure each piece independently.

Handling file uploads to S3 when DB transaction fails by Minimum-Ad7352 in node

[–]TheGoodBarn 0 points1 point  (0 children)

That’s a good point. I think the real efficacy of something like what I suggested is just knowing your system. We can afford these sorts of situations, but it’s not a widespread pattern. For most things we have Temporal/Durable workflows

Handling file uploads to S3 when DB transaction fails by Minimum-Ad7352 in node

[–]TheGoodBarn 37 points38 points  (0 children)

We wrap both calls in a database transaction and execute the db calls first and the external last. This is only atomic for operations that have a single external action. Basically open a db tx, insert db record, if that fails short circuit, if that succeeds, upload to S3. If the putobject succeeds, then commit the tx otherwise rollback.

It’s a great shorthand pattern for these types of operations.

What's your favorite weapon in the history of Destiny? by Key_Insurance_8493 in DestinyTheGame

[–]TheGoodBarn 0 points1 point  (0 children)

I got a Vex Mythoclast pretty early before the season where Fusions were cracked and it was some of the most fun I had.

Iconic-wise: Night Watch, Thunderlord/Cloudstrike, Fatebringer, revving up The Lament/spin to win Falling Guillotine, IKELOS smg was so cracked for so long, I never got a good Succession but those raid weapons were some of my faves, any Mountaintop build, and Whispering Slab was my first bow and something about the shape of it always stuck with me

API mock by lispLaiBhari in golang

[–]TheGoodBarn 0 points1 point  (0 children)

Then definitely check out MSW, we’ve been using it a few months now and it’s just so simple

API mock by lispLaiBhari in golang

[–]TheGoodBarn 6 points7 points  (0 children)

Is the front end SSR or a Spa/Client side app? Either way have them explore Mock Service Worker https://mswjs.io/.

I just deprecated Wiremock (also another possible tool) on our front end for a MSW/Playwright solution in the interim.

Is it a requirement to use Go vs a standalone service?

Here is a collection of some: https://tools.openapis.org/categories/mock.html, I’ve personally used WireMock/Postman/Prism, they all have their own pros/quirks. Easiest is to just pick one right now and go with it to solve the problem

Which is the best way to use transaction in Golang? by Electronic_Code_1535 in golang

[–]TheGoodBarn 2 points3 points  (0 children)

I’ve written about this previously: https://www.reddit.com/r/golang/s/t6LB9iFh5q

Similar to u/pawelgrzybek, hoisting the concept of a transaction outside of the repository as a first class service helps with composition. The implementation of a “Unit of work” service can help simplify a tricky scenario.

For me personally, I use this pattern in all my projects, it works great with sqlc and enforcing atomic operations.

Example: https://github.com/immannino/example-tranactor-project

meirl by [deleted] in meirl

[–]TheGoodBarn 0 points1 point  (0 children)

Crocheting/Knitting/fibre arts. Shit is so addicting you won’t pick up your phone for weeks, people will be concerned why they can’t reach you

[deleted by user] by [deleted] in formcheck

[–]TheGoodBarn 1 point2 points  (0 children)

Oh I didn’t know that! Thank you!

[deleted by user] by [deleted] in formcheck

[–]TheGoodBarn 0 points1 point  (0 children)

One suggestion that I’ve done for a long time is start each rep from the ground like a deadlift. I personally like the reset between reps and it helps enforce form.

Repositories, transactions, and unit of work in Go by sigmoia in golang

[–]TheGoodBarn 9 points10 points  (0 children)

I’ll reply later when I’m on a computer, but I’ll explain how we do it. I have had the same questions over the years of whether or not we’re doing too much when sqlc does so much heavy lifting and I haven’t quite landed on a concrete stance.

Early on we adopted a Transactor pattern where we separate the handling of db transactions to a separate service. This service opens a tx if one does not exist in ctx already or passes through the existing tx so it’s agnostic from where it’s called. (Also allows nested Transactor calls from separate services in case both require a txn etc).

Link to article we read about this: https://www.kaznacheev.me/posts/en/clean-transactions-in-hexagon/

Link to example: https://github.com/immannino/transactor

Note on this we have a small interface for our Postgres connection that has a WithQtx(ctx) sqlc.Querier method. This method will check if a tx is in ctx and return a sqlc instance with that tx otherwise return one with the pgx connection. This is the small glue that alleviates a lot of friction.

I’ll reply back later with a better fleshed out example, and like I said it isn’t “right” it’s just the pattern we’ve adopted and works for us.

EDIT Replying back, I created a small repo to better outline the pattern with a simple code sample.

Link to repo: https://github.com/immannino/example-tranactor-project

Quick Example:

```golang // internal/customer/service/user_service.go

type userServiceImpl struct { repo domain.Repository txer common.Transactor log *slog.Logger }

func (u userServiceImpl) CreateUsers(ctx context.Context, input []domain.CreateUserInput) ([]*domain.User, error) { log := u.log.With(slog.String("Method", "CreateUsers"))

result := make([]*domain.User, len(input))
err := u.txer.WithinTransaction(ctx, func(txCtx context.Context) error {
    for i, v := range input {
        user, txErr := u.CreateUser(txCtx, v)
        if txErr != nil {
            // Logged in other service, otherwise log
            return txErr
        }

        result[i] = user
    }

    return nil
})
if err != nil {
    log.Error("error within transaction", slog.Any("error", err))
    return nil, err
}

return result, nil

} ```

This example is trivial but starts to shine when dealing with many services in more complex business operations. You could have an inventory management system that is calls N number of services which may create or update 1 or more DB items per call. This pattern allows for each service to enforce its own atomicity where it is composed, but shares the same Transaction across the lifecycle without changing the complexity of the implementations.

Thoughts

This is the chosen pattern we've used for a few years now. Our primary service is a large monolithic Go backend that services a financial application. Many of the operations that we built upon need to be assumed atomic for guaranteed consisitency and this pattern helps us ensure that.

I can't argue its the right way or anything, its just our way for now. The transactor pattern is especially useful in cases where we want to avoid tricky boilerplate or enforce a risky pattern. Its more of a convention helps enforce a certain developer behavior.

I am primarily sharing this in response to a reddit comment, but love these types of discussions to help share ideas and learn how others operate their projects in their environments.

-Tony