[Notes] 6 Lessons we learned when debugging a scaling problem on GitLab.com

https://about.gitlab.com/2019/08/27/tyranny-of-the-clock/

The first step is to look for critical filters to dramatically reduce the area to troubleshoot. Such as type of logs, which server, etc.

Wireshark statistics tools could be super helpful.

If usage pattern aligns with some timing cadence, think scheduled jobs.

If the incoming rate exceeds the limit (measured every millisecond) the new connections are simply delayed. The TCP client (SSH in this case) simply sees a delay before the TCP connection is established, which is delightfully graceful, in my opinion. 

Why? Rate limiting should be used for defensive needs, where it prevents from handling the unexpected requests. But in this case, those requests are expected and expect to be processed.

When you choose specific non-default settings, leave a comment or link to documentation/issues as to why, future people will thank you.

That applies to all things non-default, such as “magic numbers,” workarounds, tricks, possible valid values, etc.

[Notes] In praise of slow thinking in the internet age

https://qz.com/1179304/in-praise-of-slow-thinking-and-socratic-ignorance/

It is good not to settle into a set of opinions. It is a mistake to put forth effort and obtain some understanding and then stop at that.

Avoid forming opinions if it is not a domain that you have put in a lot of effort. If before making your opinion public, all you have done is Google online and read a handful of articles, then it is just a piece of “opinion.” It worths almost nothing to the world or others. Whatever happening in Hongkong now, and whatever fire Trump is playing, I found myself know very little.

Obama, who was a voracious reader as a young man, committed to reading a book—not news—for an hour a day during his eight-year presidency, he told the New York Times.

See from now on, if I can stop reading news, except the news from the domain that I am working. Instead, read books and non-news articles.

[Notes] How to Read Less News But Be More Informed, According to a Futurist

https://qz.com/1222019/stop-reading-the-latest-news-if-you-want-to-be-better-informed/

He’s not trying to catch up but to check and see which of the many headlines turned out to be relevant a few weeks or a month later. 

Watson advises that we randomly pick up books and magazines, and strike up conversations with strangers.

Watson especially recommends perusing weekend editions of quality newspapers.

…relevant information makes its way to us, and that much of what we fuss over daily is just stuff that will soon be forgotten.

A great read. My actions just now:
Removed 80% RSS feeds.
Disabled Retweets for all followings.
Unsubscribed/marked as spam except must have emails.
Turned off notifications for most of the apps.
Check personal email three times a day. (morning, noon, and evening)

[Notes] Unique Leadership Concepts You Need to Know (from training notes by Maddy)

When an individual tends to jump into parent mode (critical or over nurturing) they create an opportunity for an individual to act like a child (dependent, whiney or rebellious) or vice versa. But adult (rational) behavior creates adult behavior.
For Example: A manager might say “I asked you to be done with that by Wednesday and now it’s Thursday. I’m really frustrated now” (parent) and a direct report might respond with “I’m sorry but it wasn’t my fault” (child).

Great insight. I have been leading/managing teams by following my gut feeling. But verifying the “correctness” of my approaches by the results is not a reliable approach. Theories like the above provide reasoning of why I should be saying/doing some things while not saying/doing some other things.

[Notes] Why Amazon DynamoDB isn’t for everyone

https://read.acloud.guru/why-amazon-dynamodb-isnt-for-everyone-and-how-to-decide-when-it-s-for-you-aefc52ea9476

So when you combine inexperienced devs, the lack of a clear plan for how to model a dataset in DynamoDB, and a managed database service that makes it really easy to ingest a lot of unstructured data — you can end up with a solution that spirals out of control even at a small scale.

Quick and dirty prototypes done with try and error models would be the best use case for DynamoDB. At the same time, building a real product directly on top of a working prototype is a dangerous approach and set up for failure.

A relational database will do most anything you need at small scale. It might take a little longer to set up initially than DynamoDB, but the well-established conventions of a SQL implementation can protect you from a lot of wasted time down the road.

The initial time it took can take you way further than you would expect if you head down the RD SQL way.

So if your application is using too many RCUs on a single key, you either need to over-provision all the other partitions (expensive), generate a ton of “Throughput Exceeded” errors (not ideal), or figure out how to decrease access to that key.

One takeaway here is that DynamoDB isn’t necessarily suited to datasets that have a mix of hot and cold records.

End of the date, if it is a good use case for DynamoDB, it should also be a good use case for Azure Table, which in my opinion, even much simpler and much more scalable. And Azure Table is truly performance-provision-free.

Business value trumps architectural idealism every time.

That kind of decision making can tell a mature architect from a mediocre one, especially for the line of business software development.

This is why Lynn Langit has more or less abandoned NoSQL as a solution for small and medium-size businesses.

It depends on the balance. Breaking schema changes in SQL is a huge pain. Plus if CI/CD, no-downtime deployment is a must-have, involving changes to the index, for a relatively large database, SQL will take a bigger hit. But anyway, to do all the above, even NoSQL won’t be trivial.

[Notes] 万维钢解读:《成功公式》

所以说“赢了起跑线”这句话的关键词是*赢*。你光是起步早、比如说让孩子很小就去上这个班那个班,是不行的 —— 你得让他*赢*才行。只有战胜对手脱颖而出,才能给他带来真正的自信,才能向社会证明他的“可被奖励性”。

以前焦点都是『起跑线』,争论人生是长跑不是短跑。其实注意力应该是这个『赢』字。

我以前听说过一个说法:要看一件事能不能办成,在你调兵遣将把这个团队建立起来的那一刻,就已经决定了70%。

暗暗迎合了VC只看团队的说法,什么产品,什么技术都是其次。

有句话叫“艄公多了打翻船”,说公司用人不能只招“牛人”。

要想既有传统又有创新,团队成员必须既有强联系又有弱联系。你得有老人,有新人,还得有外人。

这说法跟现在的市场行为不符,现在的公司就只想招『牛人』和『新人』。当然,哪里真的有这么多牛人,只要招多了,自然而然不知不觉能与不能都好,反正就做到了『不只招牛人』。

接受了这个定律,每个人都应该大度一点。如果你是新手,别在乎眼前的得失,你想要的不是一两个功劳,而是自己的系统!

现在很多人爱说“拥抱不确定性” —— 请注意,说我不怕 r 值的不确定性,对各种想法持开放态度,这可不叫“拥抱”不确定性。你得主动出击,毫不懈怠地一个项目一个项目做下去,没有新 r 值就难受,这才叫拥抱。

两个字『深耕』。

[Notes] Calculating Derived State in JavaScript Using Selectors

https://nick.scialli.me/calculating-derived-state-in-javascript-using-selectors/

We can use selectors to solve this issue. Selectors are functions that take state as a property and return the derived state value. Let’s see if we can create a selector to replace our allowedIn property.

Our decision is not just based on our state object anymore, but is based on the result of another selector as well. This is where we start using higher order functions to compose selectors from other selectors. 

Many selector libraries (e.g., Reselect for Redux) include additional functionality to memoize selector results.

Great examples that explain why we need Selectors and how to use them for calculating derived State (like a computed property.)

[Notes] How Hasura saved us $50,000

https://medium.com/cresta-engineering/how-hasura-saved-us-50-000-7cfe8e7909e9

front-end stack of React, TypeScript, and Apollo.

React gets more tractions. TypeScript is still not out-of-the-box supported. At the same time, more and more start-ups using TypeScript with React together. May it worth the effort to add that extra layer? So that the project is more maintainable?

Hasura markets their product as a “GraphQL-out-of-the-box.” It’s a standalone server that sits between your database & client. This differentiates Hasura from other offerings (like Prisma), and puts it closer in spirit to projects like PostGraphile.

More like a self-hosted managed BaaS.

But this isn’t how Hasura works. Instead, every GraphQL operation you send to the server is transpiled to raw SQL.

Sounds pretty straightforward on paper. That is no “magic.” But just looking at the generated SQL, may be useful for performance tuning troubleshooting, but not sure how much that will help to migrate to other vendors when decided Hasura is not the best option.

simply state the data requirements of your UI, and let a library handle everything else.

Very nice to have!

Besides remote schemas (a feature also available in a few GraphQL solutions), Hasura offers a clever feature: create any view or stored procedure, and Hasura can automatically generate GraphQL operations. Subjectively, complex data transforms are far easier to write and maintain in SQL than they are in JavaScript or TypeScript. Being able to go from creating the view to querying it in the client in mere seconds feels feels almost like cheating.

Not quite sure what kind of “data transforms” the author refers to but doing anything in SP never felt to be enjoyable. SQL is not a language to implement business logic. Creating views may still seem fine to me.

Now, that same button is simply a matter of updating the client, clicking a few things in the Hasura UI, then testing & deploying. We’ve cut the amount of server code we have to maintain by 2/3rds, allowing us to spend that time building more cool stuff for our users.

For CRUD liked operations, that seems very handy. Not sure about other buttons with more complex logic behind.

WWDC 2019

SwiftUI

终于可以彻底离开ObjectiveC。看演示的例子应该简化的不少,尤其是不用考虑一些靠近OS底层的通用功能,例如dark mode、自适应字体大小等。一年多没有写iOS了,看来又得花几天看看SwiftUI的教程和练练手,要不再过一年,想写写一些hobby的app都捡不起来了。糊口技术更新快是码农的现实。

Single code base: iPhone/iPad/Mac,以及新的iPadOS

iPad作为大屏幕iPhone的日子到头了,开始尝试覆盖一些MacBook的使用场景,慢慢变成一台触屏MacBook。我预言,三五年之后,MacBook将淡出,基本日常生活工作都可以在iPad上顺利进行(当然,在工作上,外接物理键盘估计免不了)。Mac Pro还是会有市场的,需要强大算力的工作,还是离不开desktop。

强大的新Pro和Monitor

这也是上面想法的一个不错的印证。

AR和Minecraft

还是半吊子,这样玩Minecraft手不累吗?AR的话,还是继续耐心等待几个版本之后的Hololens和Oculus。

Sign In with Apple

姗姗来迟。对于普通用户,又多了一个button。普通用户才不知道你后面在隐私方面做了多少改进,就是yet another button。对于大部分码农,这只支持苹果系统,在部署决策上一定属于二等公民。

 

iTunes分成三个app之类的,我不太关心,反正我从来就不喜欢iTunes,也不用iTunes。

觉得这次苹果中规中矩。之前还在纳闷苹果的软件部门都在干嘛,因为不见大飞跃,反而bug不断。原来团队里牛人的精力都集中在iPadOS之类的大方向迁移,那还算靠谱。