-
Hi @ffhan, Just a small question, it's probably a dumb question but I was wondering why do you have trackers when placing orders, are they part of the flow of an order like to keep track of the other orders or it's just a golang thing Please let me know when you get a chance thank you very much |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @ceddybi , It's not a dumb question - trackers are designed for two purposes: 1) smaller memory footprint and 2) hot path optimization.
Another example for 2) would be using nanoseconds since the Epoch for comparing two timestamps - we don't really care about timezones etc. since we're assuming that times are always local (possibly produced on the machine or the router), so their only difference is the number of nanoseconds. If we could use seconds for comparisons, we would. But we would still use a timestamp type in an order to be as precise as we can in storage. |
Beta Was this translation helpful? Give feedback.
Hi @ceddybi ,
It's not a dumb question - trackers are designed for two purposes: 1) smaller memory footprint and 2) hot path optimization.
orders can hold a lot of data about customers, precise quantities, prices etc. which are heavy to move around when handling huge amounts of traffic - trackers handle only a small subset of relevant information, while still being able to locate the full order (e.g. by ID). In short they are a way of copying, using and allocating less memory when we can get away with it.
your hot path is probably going to be a bottleneck for a lot of things, but you still have to be precise when matching orders. Trackers use data types which are less precise but enab…