TLDR;
Protobuffers is an encoding mechanism for message sending between servers & services. It is highly popular at many companies mainly because of its great performance in terms of
(1) encoding & decoding speed &
(2) its ability to save bandwidth by being able encode into binary.
This blog will describe the mechanisms of how objects gets encoded to be sent over the wire. Follow along with the examples on your own!
Let’s look the simplest…
8 years ago while in high school, a wise man gave a speech at our founders’ day celebration. His name was Bilahari Kaushikan and he was then the Permanent Secretary of Foreign Affairs. Re-reading his speech from all those years ago brings out many lessons in humility and introspection. I sincerely beseech you to spend the time to contemplate on this magnificent piece of writing.
Eighty-five years ago an American writer by the name of Thornton Wilder published a short novel entitled The Bridge of San Luis Rey. …
In this world, we have two kinds of repositories:
A few months ago I was given a seemingly simple ticket. A downstream team wanted a simple API with the following logic
╔══════════════════╦═════════════════════════╦════════════════╗
║ Key ║ Value ║ Type ║
╠══════════════════╬═════════════════════════╬════════════════╣
║ user_id{USER_ID} ║ {convo_id1, convo_id2…} ║ Sorted Set (Z) ║
╚══════════════════╩═════════════════════════╩════════════════╝
To answer the query, we can write the following LUA script to retrieve the necessary Data, by inputting the proper key slice into the script
GET_UNREAD_CONV_COUNT_LUA = `
local t = {}
for i, key in ipairs(KEYS) do
table.insert(t, redis.call('ZCARD', key))
end
return t
`
Hint: Under some circumstances, it will give a wrong answer but under other…
Golang genetics is being planned for Go2. Here’s a sneak preview!
A generic method is a function which objects of various types may be input as its argument. Below is an example of a Java generic method:
public static < E > void printArray( E[] inputArray ) {
// Display array elements
for(E element : inputArray) {
System.out.printf("%s ", element);
}
}
Above, the method accepts arrays of any type, be it int, string, bool etc etc…
Core Server Software Engineer @ Shopee