Understanding Vector Normalization

Vectors are fundamental entities used to represent quantities that have both direction and magnitude. Whether you’re working in machine learning, physics, or computer graphics, vectors have a crucial role. However, the raw magnitude of a vector is not always useful in certain computations. This is where vector normalization comes into play. Vector normalization is a process that scales a vector so that it has a unit length of 1 but retains its direction. This operation is particularly useful in various applications, including machine learning, physics simulations, and computer graphics. ...

August 25, 2024 · 4 min

What is a Lamport Clock?

When data is stored across multiple servers in a distributed system, it is crucial to determine the order in which operations occurred to maintain consistency and ensure the system behaves correctly. But why can’t we rely on the system timestamps? Non-monotonicity of System Clocks: System clocks are not guaranteed to be strictly increasing over time (monotonic). For instance, when servers synchronize their time using the Network Time Protocol (NTP), the clock may be adjusted backward if it was ahead of the actual time. This backward adjustment can create confusion in determining the true order of events, as a later operation might appear to have occurred before an earlier one. Crystal Oscillator Drift: System timestamps are generated based on the server’s internal clock, which relies on a crystal oscillator. Over time, this oscillator can drift, causing the server’s clock to become slightly inaccurate. To correct this drift, NTP is used, but this correction process can cause time to “jump” backward or forward, further complicating event ordering. Incomparable Clocks Across Servers: Even if each server had a perfectly accurate clock, the timestamps from different servers cannot be directly compared. Each server’s clock might be slightly ahead or behind others, leading to inconsistent time comparisons across the system. Lamport Clocks to the Rescue To address these challenges, Lamport Clocks are used. Lamport Clocks provide a way to assign a logical timestamp to events in a distributed system, ensuring a consistent order of events. ...

August 25, 2024 · 4 min

Update payload for multiple points in Qdrant

Qdrant vector DB supports updating multiple points using batch_update_points(). Batch update points can take in multiple different operations as parameters and run them as a single API operation. batch_update_points() supports 4 kinds of update operations. UpsertOperation DeleteOperation UpdateVectorsOperation DeleteVectorsOperation SetPayloadOperation OverwritePayload DeletePayloadOperation ClearPayloadOperation batch_update_points() supports mixing up different kinds of operations in one request. For example you could perform an UpsertOperation for point ids [1, 2, 3] along with a delete operation on point id [4, 5, 6]. ...

August 23, 2024 · 2 min