Wednesday, September 18, 2024
HomeGolangMicro service how you can keep transaction - Getting Assist

Micro service how you can keep transaction – Getting Assist


I’m planning to create micro service. I’ve following questions

1 ought to I take advantage of gin body work for micro service or grpc
2 if I construct micro service it will likely be deployed on a number of port
3 how you can keep single database transaction for a number of micro service

Gin is an additional layer (framework) and gRPC is a protocol. AFIAK you need to use no matter protocol utilizing no matter framework (or vanilla Go) you need. The commonest protocols are REST and gRPC

One micro service per port.

A single database transaction (commit – rollback) throughout a number of micro providers? Could also be a problem. IDK.

I acquired first 2 reply.

3 is difficult. I’ve accounting software individually and gross sales and purchases seperately. I’ll create 2 micro service…

Each ought to work inside single transaction

In the event you use a single database, you may create a database perform /saved process that execute each queries in a single step?

Or create a set off that robotically replace the table2 relying on the result of updating table1?

Pondering database – not micro providers?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments