Skip to content

zh

給予與接受 - 書籍評論

在這篇博客文章中,我將對亞當·格蘭特(Adam Grant)的書籍《給予與接受》進行評論。我認為學習和成長是人類的基本需求。分享這本書的見解對我來說是一種主動學習的方式,希望對你也有所幫助。

首先,誰是亞當·格蘭特?他是沃頓商學院的一位年輕教授,以其深刻的研究和書籍而聞名。在他三十五歲之前,他已經寫了五本暢銷書。

在《給予與接受》一書中,格蘭特挑戰了一些常見的假設,如"贏者全拿"和"好人最後才完成"。這些表述反映了人們害怕過於慷慨會讓別人占你便宜的觀念。這種恐懼常被電視劇和電影加以強化,這些媒體建議成功的人必須無情。例如,電影《華爾街之狼》將金融業描繪為貪婪是善舉,成功需要成為一個怪獸般的領導者。

然而,書中指出,這種觀點並不真實。格蘭特列出了成功的四個支柱:強烈的動力、能力、機會(或者說運氣),以及你與他人的互動方式。他將人們分為三種類型:接受者、匹配者和給予者。

接受者只關注他們能得到什麼。匹配者只在他們期望得到回報時才給予幫助,這種“交換條件”的心態在政治中很常見。而給予者則將他人的利益置於自己之上,不期待回報地幫助別人。

在現實生活中,人們常常展現出這些風格的混合,適應不同的情況。那麼哪種風格最成功,特別是對於銷售員來說?令人驚訝的是,書中揭示了前10%的銷售員都是給予者。為什麼呢?一個原因可能是互惠原則:人們更願意幫助那些幫助過他們的人。

數據也顯示,給予者要么是頂尖的表現者,要么是底層的表現者。區別在於是否設定了邊界。沒有設定邊界的給予者會發現自己被耗盡,沒有時間進行個人成長。設定邊界的人會更有效,並發現幫助他人往往有助於他們自己的發展。

我並不優先於財富、權力、快樂、競爭,而是偏好並優先於幫助、責任、社會公正和同情等價值觀。這可能似乎與直覺相反,但採取更利他的態度可以在關係中實現互利。研究表明,那些經常將時間和知識給予同事的人往往能得到更高的加薪和晉升。

總的來說,成功的關鍵原則是:1)出現,2)努力工作,3)善良,4)成為一個給予者。努力讓人們笑,娛樂他們,並致力於創造一個更好的世界對於在緊密的工作環境中建立良好的聲譽至關重要。這不是零和遊戲;目標是互相幫助。如果在你讀完這篇博客文章後,我還有任何可以進一步幫助你的方式,請隨時與我聯繫。

品牌策略建議

在這個提議中,我對Thought Machine提供戰略建議,這是一家金融科技產品公司。Thought Machine開發了一款正在改變銀行業並使銀行能夠向客戶提供創新服務的核心銀行產品。

Thought Machine的增長令人印象深刻,最近在由業界領先的風險投資公司和全球銀行(包括Nyca Partners、Molten Ventures、摩根大通和渣打銀行)主導的C輪融資中籌得2億美元。這使我們的總融資額達到3.5億美元,估值超過10億英鎊。我們為一個多元化的銀行客戶群提供服務,範圍從Tier 1到挑戰者銀行,例如Atom Bank、Curve、Lloyds Banking Group、Monese、SEB、渣打銀行、TransferGo、Arvest、ING和摩根大通。

我們的產品,Vault,作為一個在雲原生平台(包括亞馬遜網路服務,谷歌雲平台和微軟Azure)上運行的分類帳,而無需依賴舊技術。Vault的靈活性由智能合約驅動,可以配置任何類型的零售銀行產品,包括當前的帳戶,儲蓄,貸款,信用卡和抵押貸款。

我們使用Clock Mode框架來評估品牌與消費者在三個階段之間的每一個交互:購買前,購買和購買後。購買前的階段包括像社交媒體,金融科技事件,合作夥伴和回應提案(Request for Proposals)的元素。購買階段涉及使能,API,自助服務和產品服務。購買後階段包括支援服務,認證程序,培訓內容和新聞通訊。

我們進行了品牌審計,以確定人們對我們品牌的直接,強烈的聯想。積極的聯想包括"現代","聰明","技術","可信","精簡","創新","可擴展","可配置的","高效能","安全","可靠"和"品質"。消極的聯想可能包括複雜性,不是"一站式銀行",整合期間的摩擦和有限的本地市場存在。

基於品牌審計,我們創建了一個期望的品牌形象。 Thought Machine品牌的核心精神是有遠見,簡單且強烈,是現代銀行的基礎。我們的擴展品牌形象涵蓋了一系列特點,從技術導向,有點書呆子的人到象徵雲技術和產品優先的策略。

以下是我對Thought Machine的戰略建議:

  1. 差異化:專注於從傳統供應商中脫穎而出,建立一個優質的雲平台。強調智能合約的獨特功能,提供無與倫比的可配置性。加強我們身份的這一方面可以提高認知度並加快增長。

  2. 相關性:提供銀行不會或不能內部建立的雲平台。許多銀行被複雜,孤立的舊系統所困擾。我們應努力提供產品,使其在銀行業中的地位不可或缺。

  3. 可持續性:通過提供更換過時的主機服務器為更現代的,基於雲的解決方案,以保持競爭優勢。與銀行和整合夥伴建立長期關係,以確保在規模和速度上的成功。

如果您對此提議有任何問題,請隨時與我聯繫:Victor Leung on LinkedIn

在AWS工作區設置Ubuntu桌面

自2009年大學時期以來,我就一直是Ubuntu桌面版的粉絲。用它來替代Windows桌面非常令人興奮,儘管這條旅程充滿了挑戰,如與網攝、聲音和鍵盤相關的硬件兼容性問題。

我愛Ubuntu的原因是其社區支持。我總是可以在Google上找到對我問題的答案。然而,當我剛開始時,我會盲目地將命令複製並粘貼到終端,有時在不知道如何恢復變更的情況下破壞環境。結果,我不得不多次重新安裝Ubuntu桌面。

現在,我已經將Ubuntu桌面遷移到一個AWS EC2實例上。它與Google Chrome的遠程桌面設置配合得很好,而且我喜歡根據自己的需求選擇CPU、內存和存儲硬件的靈活性。雖然聲音可以正常工作,但我對瀏覽器滾動體驗感到失望,特別是在串流YouTube視頻時,這種體驗感覺上有延遲。

今天早上,我看到一則宣布Ubuntu桌面可在AWS Workspace上使用的消息,我立即決定試試看。我以前用過AWS Workspace——一種完全管理的虛擬桌面基礎設施(VDI),並發現使用遠端桌面協議(RDP)的Windows實例的用戶體驗更好。由於RDP是由微軟開發的專有協議,我寧願不使用它。與此同時,Linux桌面使用PCoIP,有時可能會感到延遲和反應不靈敏。此外,帶有MATE桌面的Amazon Linux2映像並不符合我的喜好。

今天,我終於有了我喜歡的選擇:在AWS Workspace上使用Ubuntu桌面,並使用WorkSpaces串流協議(WSP)進行設置。我就在這個設置下寫這篇部落格文章。

分步指南

步驟0:在開始之前,您需要設置一個目錄。您可能不確定選擇AWS管理的Microsoft AD還是簡易AD。在我情況下,我只需要一種價格低廉的Active Directory兼容服務,所以我選擇了簡易AD,如下圖所示:

步驟1:一旦設置好目錄,你就可以選擇它來創建一個AWS管理的工作區。這個過程需要一些時間,你也需要進行註冊。

步驟2 & 3:接下來,創建一個用戶並識別他們。

步驟4:選擇Ubuntu Desktop捆綁包。UI缺少搜索和過濾功能,所以你可能需要導航到最後一頁來找到Ubuntu選項。你可以從各種硬件配置中選擇。我選擇了性能選項,因為它目前有免費層次的推廣。

步驟5:選擇“一直開著”或“自動停止”。我選擇有一小時超時的"自動停止",以節省成本。

步驟6:現在跳過可選的加密。

最後,等待狀態從“等待”變為“就緒”。然後,您可以使用註冊碼開始連接。您可以下載AWS客戶端並在您的筆記本電腦上安裝它,但我特別喜歡AWS Workspace上的Ubuntu桌面的一個功能,那就是可以通過Web來訪問它。要啟用此功能,請遵循以下所述的一個步驟:

前往WorkSpaces控制台 https://console.aws.amazon.com/workspaces/,在導航窗格中選擇“Directories”。選擇你的目錄,然後選擇“Actions”,接著選擇“Update Details”。展開“Access Control Options”並定位到"Other Platforms"。選擇"Web Access"然後選擇"Update and Exit"。

現在您可以在https://clients.amazonworkspaces.com/webclient的任何瀏覽器上訪問Ubuntu桌面。輸入你的註冊碼以繼續。

輸入您的用戶名和密碼。 (如果您忘記了目錄密碼,您可以通過AWS控制台重置它。)

你辦到了!您已經成功地登入至一個完全功能的Ubuntu桌面網頁瀏覽器。

這種設置非常便利,允許我從任何地方訪問我的工作區。到目前為止,性能一直很出色,而且我對用戶體驗感到滿意。如果您對此設置有任何疑問,請隨時提問,我將很樂意與社區分享更多信息。

在AWS上設置三層架構

今天,我將演示如何使用虛擬私人雲(VPC)服務在亞馬遜網路服務(AWS)上設置三層架構。以下是說明設置的架構圖,主要分為三層。

第一層是演示層,用戶可以通過網關直接訪問公共子網。第二層是邏輯層,主要處理商業邏輯。此層位於私人子網中,以限制訪問並坐落於負載平衡器後面。負載平衡器能夠靈活且水平擴展以處理不同時間的變化的流量需求。第三層是數據層,其中包含一個位於私人子網的MySQL數據庫。只允許通過第二層訪問。為了提高可用性,我在兩個可用性區域中部署了架構,並將數據庫備份到另一個區域。這確保了如果一個可用性區域失敗,應用服務將保持運行。

首先,我將創建一個名為victorleungtwdemo的VPC網絡。按照架構圖,我將選擇172.17.0.0/16的CIDR區塊。此/16子網將給我提供65,535個IP地址,為未來的擴展提供了空間。

接著,我將創建六個子網。第一個子網命名為pub-subnet-1。我將它與我剛剛創建的VPC關聯,並選擇適當的可用區域(Zone A)。我也將指定這個子網的IP地址範圍。為了確保可擴展性,我將將其設置為/24子網。

繼續此過程,我將創建其餘的五個子網。如下圖所示,我現在在不同的可用區域有六個子網。

接著,我將創建一個新的網路閘道,命名為victorleungtw-igw

創建完成後,我將把它連接到我的victorleungtwdemoVPC。

現在,讓我們看看路由表。創建VPC時,系統會自動生成一個默認路由表。我創建的所有子網默認都會連接到這個表。

然後,我將創建一個名為pub-route的新路由表,該表將管理數據路由到公共網絡。此外,我將將原始路由表重命名為priv-route。對於數據庫子網,我將創建另一個名為nat-route的路由表。

此時,我有三個路由表。每個表都有一個默認路由。

對於pub-route表,我將向victorleungtw-igw添加一個路由0.0.0.0/0。這允許所有在關聯子網中的機器訪問公共互聯網。

接著,我將把我的公共子網,pub-subnet-1pub-subnet-2,與pub-route表關聯。

然後,我將添加nat-route,並將其關聯到priv-subnet-1priv-subnet-2

最後,不需要擔心剩下的私有路由表;所有子網默認都會連接到priv-route

現在,讓我們繼續創建一個網路地址轉換(NAT)閘道。我將選擇priv-subnet-2作為其子網並為其創建一個彈性IP(EIP)。

我將NAT閘道加入NAT路由表並設置路由為0.0.0.0/0

至此,我已經完成了約70%的網絡架構。接下來,我將配置所有相關的安全組設置。

為了安全起見,我將為我的堡壘主機、負載平衡器、Web服務器和數據庫創建單獨的安全組。

現在,該啟動相關的EC2實例了。

在創建RDS服務器之前,我也將創建一個RDS子網組。

設置好RDS服務器後,帶有適當的VPC和安全組,我們可以返回到我們的EC2實例。

接著,我將為Web服務器設置一個目標組並將它們添加到其中。

最後,我將創建一個應用負載平衡器。

設置好一切以後,我們現在可以測試系統。從堡壘主機,我可以SSH到兩台Web伺服器,啟動一個Nginx服務器,並驗證從應用層訪問數據庫的訪問。

這就結束了在AWS上設置三層架構的指南。如果你有任何問題,請隨時聯繫我.

關於我的職業生涯的故事

我開始我的職業生涯時在布里斯班擔任助理市場經理,但一年後我冒了很大的風險,回到香港,用我一年的積蓄創辦自己的初創公司。我看到一個機會,就是建立一個讓用戶能夠找到附近餐廳的網站。

我在大學時候學習Pascal和Java,因此能夠進行編程。然而,我對HTML、CSS和Javascript的知識有限,所以我必須學習這些技能,以便為我的初創公司建立網站。我學到了許多技術技能,比如使用Meteror.js並連接到mongo數據庫。這很困難,因為我每天都在寫程式碼,而且我自己一個人寫。我寫了一份商業提案,提交給政府申請資金。然而,經過一個月的工作,只有5個餐館老板登記到我們的網站,總收入僅幾百元。我們失敗了,因為我們無法吸引更多的客戶,而且我們的資金也很快就用完了。

如果我可以重新來過,我會學習關於精益創業的程序。我一開始並不知道什麼是MVP(最重要的產品)。我建立了許多很酷的功能,如即時地圖和附近餐館的地理定位。然而最終沒有人使用這些功能,因為它們並不是重要的特性。大部分的網站流量都是來自Google搜索,所以我應該在當時更專注於SEO而不是地理位置搜索。我會用敏捷的Scrum方法進行迭代,並獲得客戶的反饋,根據反饋來優先執行功能。

我學到了許多技術技能和商業知識。我能夠獨力使用JavaScript進行全棧開發,並且在我自己的業務失敗後,我能夠找到另一份軟體工程師的工作。

後來,因為我的初創公司失敗,我找到了一份全職工作,成為了澳洲企業諮詢公司Industrie IT的軟體工程師。我的第一個客戶是Riot Games,擁有《英雄聯盟》的遊戲公司,該公司由騰訊擁有。這個項目是重新設計遊戲商店,用來購買角色皮膚。我是唯一負責實作的前端開發者。我一直致力於寫一個功能,並在購買按鈕上添加CSS動畫。

我低估了這個功能的複雜性,我承諾在一週內完成這個功能。然而,這裡有一些風險,因為動畫設計和資產都是由設計師提供的。我們工作的時區不同,我在香港,設計師在拉丁美洲。我們的工作時間幾乎沒有重疊,設計師的進度也因為產品所有者無法決定哪種動畫更好而被推遲了。

在展示會結束的前一天,我終於收到了動畫檔案,但這個文件是用photoshop提供的,我沒有許可證可以開啟。這種動畫的格式與舊的瀏覽器不兼容,比如Safari 4的內置瀏覽器。它不支援最新的CSS語法,並且它不能正確地顯示

Introducing Amazon Web Services (AWS)

Hello everyone, my name is Victor Leung and I am an AWS community builder. In this article, I would like to introduce Amazon Web Service (AWS). You may be wondering, what is AWS? It is the world's most comprehensive and well-adopted cloud platform. Customers trust AWS to power their infrastructure and applications. Organisations of every type and size are using AWS to lower costs, become more agile and innovate faster.

AWS provides on-demand delivery of technology services via the internet with pay-as-you-go pricing. You can use these services to run any type of application without upfront costs or ongoing commitments. You only pay for what you use.

Moreover, AWS gives you more services and more features within those services than any other cloud provider. This makes it faster, easier and more cost-effective to move your existing application to the cloud and to build anything you can imagine.

You can rely on AWS's globally deployed infrastructure to scale your application to meet growing demand. There are so many regions in the world, how to choose? You can start with the region closest to you and your customer. A region is a physical location in the world that consists of multiple Availability Zones. Each availability zones consist of one or more discrete data centres, each with redundant power, networking, and connectivity, housed in separate facilities. In the future, if your company expands to other regions, you can take advantage of AWS facilities as well. The AWS Cloud spans 84 Availability Zones within 26 geographic regions around the world, with announced plans for 24 more Availability Zones and 8 more AWS Regions.

As for the computing power on the cloud platform, there are several types to choose from. You can use the EC2 virtual server service to deploy your server on the platform. And there are so many types of EC2, how to choose? In fact, it is decided according to your needs, the four aspects are the CPU, memory, storage and network performance. According to the type, age, capability and size, there are certain naming conventions, such as M5d.xlarge.

Generally speaking, for the instance selection process, you can start with the best-guess instance. Then determine the constrained resources. For example, C5 instances are optimised for compute-intensive workloads. It is suited for high-performance web servers. It has cost-effective high performance at a low price per compute the ratio. Besides, for M5 instances, they are general purpose instances. It has a balance of compute, memory, and network resources. It is a good choice for many applications.

Once you started an EC2 instance, you may change the instance type as well. You can resize for over-utilized (the instance type is too small) or under-utilized (the instance type is too large) cases. This only works for EBS-backed instances. The steps are 1. Stop instance 2. Instance Settings -> Change Type 3. Start Instance. You cannot change the instance type of a Spot Instance and you cannot change the instance type if hibernation is enabled.

There are a couple of available CloudWatch metrics for your EC2 instances:

  • CPUUtilization: the percentage of allocated EC2 compute units
  • DiskReadOps: completed read operations from all instance store volumes
  • DiskWriteOps: completed write operations to all instance store volumes
  • DiskReadBytes: bytes read from all instance store volumes
  • DiskWriteBytes: bytes written to all instance store volumes
  • MetadataNoToken: number of times the instance metadata service was successfully accessed using a method
  • NetworkIn: number of bytes received by the instance
  • NetworkOut: number of bytes sent out by the instance
  • NetworkPacketsIn: number of packets received by the instance
  • NetworkPacketsOut: number of packets sent out by the instance

Besides, you can install the CloudWatch agent to collect memory metrics and log files.

When purchasing EC2, there are many options. You can start with an on-demand instance first, billed by the second, with no long-term contract. After you try it out in the future, you can choose a more cost-effective reserved instance and pay for a long-term lease of one to three years, which will save you money in the long run.

After choosing the purchase method, you can put the EC2 virtual machine into the auto-scaling group. When the demand increases, the number of EC2s can be increased at the same time, thereby increasing the computing power. When the peak period is over, such as when there is no traffic in the early morning, the number of EC2s can be automatically reduced. This automatic scaling function can be scaled independently according to different indicators, and this function is free to use.

For EC2 Load Balancing, by default, the round robin routing algorithm is used to route requests at the target group level. It is a good choice when the requests and targets are similar, or if you need to distribute requests equally among targets. You can specify the least outstanding requests routing algorithm, with consideration for capacity or utilization, to prevent over-utilization or under-utilization of targets in target groups when requests had varied processing times or targets were frequently added or removed. If you enable sticky sessions, the routing algorithm of the target group is overridden after the initial target selection.

Elastic Load Balancer (ELB) can be used to automatically assigned to one or more availability zones, and at the same time, it can check the health status of the backend servers, and increase or decrease resources horizontally according to traffic requirements. There are also several different options for load balancers. For Application Loan Balancer (ALB), which is configured according to the OSI layer 7, which is HTTP. Other load balancer can also be distributed through the fourth layer of the network OSI, using the protocols of TCP and UDP, as well as the distributor of the gateway.

Suppose your business is unlucky to encounter a large-scale accident, such as a natural disaster, an earthquake, damage to a data centre, a technical impediment, or a human error, such as an employee running a command rm -rf deletes all the data, so what should you do? Actually, there are different methods, and there are also different restoration times and origins.

As for the different methods, different costs would be charged. The higher the cost, the faster the recovery. If your business can tolerate a few hours of service interruption, a normal backup and restore scenario is fine. But if it doesn't work, and it takes a few minutes to restore service, then it's a matter of replicating an identical environment in a different region, and in a standby state.

Let me give you an example, such as deploying a website to an environment in Singapore, and deploying a backup environment in Hong Kong at the same time. Through the Route53 domain name system, the domain name is pointed to the Singapore region. When a problem occurs in the Singapore area and the entire area cannot be used, the domain name can be transferred to the Hong Kong area immediately, and normal services can be resumed. The process can be changed manually or automatically, or even distributed proportionally or on a user-by-user basis.

However, operating in two regions is relatively expensive. For generally small-scale problems, such as component failures, network issues, or sudden increases in traffic, deploying to two or more Availability Zones is fine. When a zone is unavailable, it is immediately moved to another available zone, and data can be independently replicated.

Regarding to database, you can choose RDS, which is compatible with MySQL database and can be resized. RDS is a hosted service that handles patching, backup and restore functions for you. In the future, you can also consider using Aurora. The throughput can reach about three times, but the price is also more expensive, depending on whether you want to achieve the performance of a business database.

RDS allows multi-AZ deployments, which provides enterprise-grade high availability, fault tolerance across multiple data centres with automatic failover, and synchronous replication and enabled with one click. When failing over, Amazon RDS simply flips the canonical name record (CNAME) for your DB instance to point at the standby, which is in turn promoted to become the new primary.

The RDS read replicas provide read scaling and disaster recovery. It relieve pressure on your master node with additional read capacity. It bring data close to your application in different regions You can promote a read replica to a master for faster recovery in the event of disaster.

If you need strict read-after-write consistency (what you read is what you just wrote) then you should read from the main DB Instance. Otherwise, you should spread out the load and read from one of the read replicas. The read replicas track all of the changes made to the source DB Instance. This is an asynchronous operation. Read Replicas can sometimes be out of date with respect to the source. This phenomenon is called replication lag. Replica Lag metric in Amazon CloudWatch to allow you to see how far it has fallen behind the source DB Instance.

Amazon RDS encrypted DB instances use the industry standard AES-256 encryption algorithm to encrypt your data on the server that hosts your Amazon RDS DB instances. To protect data in transit, all AWS service endpoints support TLS to create a secure HTTPS connection to make API requests. Manage secrets, API keys, and credentials with AWS Key Management Service (AWS KMS). As the team expands, with AWS Identity and Access Management (IAM), you can specify who or what can access services and resources in AWS, centrally manage fine-grained permissions, and analyze access to refine permissions across AWS. Multi-factor authentication (MFA) in AWS is a simple best practice that adds an extra layer of protection on top of your user name and password. Firewalls (web application, network) and DDoS protection. Thread detection, manage secret alerts, and configure security controls for individual AWS services using AWS Security, Identity & Compliance.

Amazon CloudFront is a content delivery network (CDN) service built for high performance, security, and developer convenience. It speeds up the distribution of your web content to your users, through a worldwide network of data centres called edge locations. The user request is routed to the edge location that provides the lowest latency (time delay), so that content is delivered with the best possible performance. For example, the first client sends a request in the United States, and then needs to cross half the world to Singapore to get the content, but for the second request, it is good to get the previous cache file in the data centre near the United States, which greatly reduces the distance and feedback time.

For dynamic content acceleration, you can use standard cache control headers you set on your files to identify static and dynamic content. Dynamic content is not cacheable, it proxied by CDN to the origin and back. Faster response time = Reduced DNS Time (Route 53) + Reduced Connection Time (Keep-Alive Connections & SSL Termination)+ Reduced First Byte Time (Keep-Alive Connections)+ Reduced Content Download Time (TCP/IP Optimization). It can further optimise using Latency-based Routing (LBR), run multiple stacks of the application in different Amazon EC2 regions around the world, create LBR records for each location and tag the location with geo information. Route 53 will route end users to the endpoint that provides the lowest latency.

AWS CodePipeline is a fully managed continuous delivery service that helps you automate your release pipelines for fast and reliable applications. It can use to prevent issues by running tests and performing ng quality check. Amazon CloudWatch is a monitoring and observability service. It provides you with data and actionable insights to monitor your applications, respond to system-wide performance changes, and optimize resource utilization. Upon detection of abnormal patterns or healthh check returns error, you can trigger an alarm or actions, which could further trigger AWS Lambda, it is serverless, event-driven compute service that lets you mitigate the issue, such as restart the server or revert to the previous stable version. You can then recover from failed service instances.

For storage of objects, there are 6 choices of Amazon Simple Storage Services (Amazon S3) storage classes: S3 standard, S3 standard-IA, S3 One Zone-IA, S3 intelligent-tiering, S3 Glacier, S3 Glacier Deep Archive. The Amazon S3 Glacier storage classes are purpose-built for data archiving, providing you with the highest performance, most retrieval flexibility, and the lowest cost archive storage in the cloud.

For S3 Data Consistency, the New Objects (PUTS) has Read After Write Consistency. When you upload a new S3 object you are able to read it immediately after writing. Overwrite (PUTS) or Delete Objects got Eventual Consistency. When you overwrite or delete an object, it takes time for S3 to replicate versions to AZs. If you read it immediately, S3 may return you an old copy. You need to generally wait a few seconds before reading.

Another storage option is EBS. What is Amazon Elastic Block Storage (EBS)? Block storage volumes as a service attached to Amazon EC2 instances. It is flexible storage and performance for dynamic workloads such as stateful containers. It can be created, attached, and manage volumes through API, SDK, or AWS console. It has point-in-time snapshots and tools to automate backup and retention via policies.

gp3, General Purpose SSD are great for boot volumes, low-latency applications, and bursty databases.

  • IOPS: 3,000 - 16,000 IOPS
  • Throughput: 128 - 1,000 MiB/s
  • Latency: Single-digit ms
  • Capacity: 1 GiB to 16 TiB
  • I/O Size: Up to 256 KiB (logical merge)

io2, Block Express are ideal for critical applications and databases with sustained IOPS. It’s next-generation architecture provides 4x throughput and 4x IOPS.

  • Up to 4,000 MiB/s
  • Up to 256,000 IOPS
  • 1,000:1 IOPS to GB
  • 4x volume size up to 64 TB per volume
  • < 1-millisecond latency

st1, Throughput optimized are ideal for large-block, high-throughput sequential workloads.

  • Baseline: 40 MiB/s per TiB, up to 500 MiB/s
  • Burst: 250 MiB/s per TiB, up to 500 MiB/s
  • Capacity: 125 GiB to 16 TiB
  • I/O Size: Up to 1 MiB (logical merge)

sc1, Cold HDD are ideal for sequential throughput workloads, such as logging and backup.

  • Baseline: 12 MiB/s per TiB, up to 192 MiB/s
  • Burst: 80 MiB/s per TiB, up to 250 MiB/s
  • Capacity: 125 GiB to 16 TiB
  • I/O Size: Up to 1 MiB (logical merge)

For EBS availability, EBS volume data is replicated across multiple servers in an Availability Zone to prevent the loss of data from the failure of any single component. Protect against failures with 99.999% availability, including replication within Availablity Zone (AZs), and 99.999% durability with io2 Block Express volumes. EBS Snapshots are stored in S3, which stores data across three availability zones within a single region.

Besides, there is Amazon Elastic File System (Amazon EFS). It is serverless shared storage - no provisioning, scale capacity, connections and IOPS. It is elastic - pay only for the capacity used. Performance build-in scales with capacity. It has high durability and availability - designed for 11 9s of durability and 99.99% availability SLA.

AWS CloudFormation is a service that helps you model and set up your AWS resources so that you can spend less time managing those resources and more time focusing on your applications that run in AWS. Infrastructure as code (IaC). Consistent across accounts and regions. Dev/test environments on demand. An Amazon Machine Image (AMI) is a supported and maintained image provided by AWS that provides the information required to launch an instance.

Finally, to sum up, there are many AWS services to archive well architecture with operational excellence, security, performance efficiency, reliability and cost optimisation. There is so much to learn and let’s keep learning. Thank you very much for taking the time to read this article. Let me know if you got any questions, happy to connect

了解 Kubernetes

我一直在學習 Kubernetes,也被稱為 K8s,這是一個用於自動化部署,擴展和管理容器化應用程序的開源系統。以下是理解的重要概念摘要:

控制平面 - 這個組件對集群做出全局決策,包括以下元素:

  1. ETCD:一個強一致性,分佈式鍵值存儲,提供了一種由分佈式系統或機器群組訪問數據的可靠方法。
  2. API 服務器:通過 REST,UI 或 CLI(kubectl)促進用戶互動。
  3. 調度器:處理資源管理,將工作節點分配給工作節點,同時遵守資源限制和約束。

數據平面 - 管理資源,網絡和存儲,以便可以運行容器工作負載。

命名空間 - 在 Kubernetes 物件範圍訪問和劃分集群提供邏輯分離。每個資源範疇都是命名空間或集群範圍的。

節點 - 這可以是虛擬機或實體機。多台機器或 VM 構成集群的主體計算資源。節點由控制平面管理,並託管 Pod 物件。他們的網絡由服務物件配置。默認組件包括:

  1. Kubelet:控制平面代理。
  2. 容器運行時:負責調度 Pod 容器。
  3. Kube Proxy:在集群內擔任網絡代理。

Pod - Kubernetes 中最基本的可部署物件,類似於服務或微服務。他們運行一個或多個具有共享存儲和網絡資源的容器。一個 Pod 中的容器類型包括:

  1. init-container:主要容器運行之前運行,通常用於執行設置任務。
  2. 主容器:托管在容器中運行的應用程序進程。
  3. sidecar:與主容器一起運行,與之鬆散耦合。

Pod 很少直接創建,通常通過控制器資源,如部署,DaemonSets,工作或 StatefulSets 創建。

ReplicaSet - 在任何給定的時間維持一組穩定的副本 Pod 運行。它通常不會單獨部署,而是由部署物件管理。

ConfigMap - 用於存儲非機密鍵值配置。Pod 可以將其用作文件掛載或者環境變量,由 Pod 中的容器訪問。

基於角色的訪問控制 (RBAC) 資源

  1. 服務賬戶:為 Pod 中運行的所有進程提供身份證明。
  2. 集群角色/角色:包含代表一組權限的規則。這些必須通過 ClusterRoleBinding 或 RoleBinding 與服務賬戶關聯以生效。
  3. ClusterRoleBinding / RoleBinding:授予在 ClusterRole / Role 中定義的權限給指定的 ServiceAccount。

部署 - 作為 Pod 和與他們相關的任何物件(如 ReplicaSets 和 ConfigMaps)的控制器。它不斷地調解在清單中聲明的狀態,並管理捲出到 ReplicaSets。可以配置為執行 Canary 部署,這帶有垃圾回收功能。

HorizontalPodAutoscaler - 根據內存和 CPU 使用情況等指標自動調整工作負載資源,如部署或 StatefulSets。它還可以使用像 Prometheus 這樣的自定義或外部指標進行縮放。

StorageClass - 描述具有存儲類型,提供商和回收政策等屬性的抽象存儲類。由 PersistentVolume 使用。

持久性存儲磁卷索賠 - 對特定資源和權限級別的存儲的用戶請求。

PersistentVolume - 代表一塊可以附加到 Pod 的存儲,並有一個獨立於 Pod 的生命週期。

服務 - 作為在一組 Pod 上運行的應用程序的網絡暴露的抽像。它提供負載均衡並使得一個集群內的 Pod 可以訪問其他 Pod。

StatefulSet - 用於管理含有狀態的應用程式的控制器。它為其每個 Pod 保持粘性身份,與部署資源不同,並將每個 Pod 與一個獨特的持久存儲實例相關聯。刪除或縮小 StatefulSet 不會刪除關聯的磁卷。

工作 - 適用於運行結束在成功完成的任務的應用程序。它部署一個或多個 Pod,並重試,直到指定數量的 Pod 已經終止,表示任務的結束。

CronJob - 類似於 Kubernetes 工作,但是按照設置的計劃運行。

Ingress - 通過服務將集群的外部流量引導到 Pod。它需要一個 Ingress 控制器(比如 ingress-nginx)來實現 Ingress 規則,並可以包括像外部負載均衡,SSL 終止和在集群內的基於名稱的虛擬託管等功能。

CustomResourceDefinition - 通過定義自定義資源屬性和模式來擴展 Kubernetes 資源類型。

CustomResource - 自定義資源的實例。CustomResources 可以被自定義控制器或運營商訂閱,並且必須有一個相關的 CustomResourceDefinition。

這些是我在學習 Kubernetes 的筆記。如果你正在準備 CKAD,CKA,或 CKS 考試,隨時與我提出任何問題。開心學習!

理解服務網格和 Istio

作為一名軟體開發人員,我有時會覺得基礎設施網路相當混淆。在這篇文章中,我將更深入地理解服務網格和 Istio。服務網格是一個專門負責處理服務與服務通信的基礎設施層。它確保請求通過組成現代雲原生應用程序的複雜服務拓撲的可靠傳遞。

實踐中,服務網格通常以輕量級網路代理的陣列形式實現,並與應用程序代碼一起部署,而無需應用程序知道它們。與其名稱相反,服務網格並非實際上的服務網格,而是抽象出網路層的代理網格。服務網格主要執行三個功能:流量控制,安全性和可觀察性。

控制平面將配置數據的流動從中央單位管理到組成網格的代理。而資料平面則管理由 sidecar 代理輔助的網格中微服務的應用數據流動。

一個常用的服務網格就是 Istio。Istio 是由 Google、IBM 和 Lyft(Envoy 代理)合作開發的開源項目,提供一個為在 Kubernetes 上管理服務間通信的透明基礎設施層。它攔截網路流量並將其代理到掛載為 main 容器的側車的智能 Layer 7 代理。 Istio 應用高級路由和策略規則,增強安全性和彈性,並在對等體間通信時使用互相認證的 TLS。

Istio 在服務網格的核心功能上提供了即時優勢:流量控制,安全性和可觀察性。然而,它確實引入了一些複雜性,例如運營開銷和鏈路級別的輕微延遲。它還需要平台適應性並消耗額外的資源,如內存和 CPU。

Istio 的控制平面,稱為 istiod,執行多種功能:服務發現,代理配置,證書管理等等。在 Istio 的舊版本中,這些功能被劃分為獨立的部署,但現已統一在 istiod 中。

Istio 的資料平面由與 Istio 控制平面通信的 Envoy 代理實例組成。一旦配置和同步,這些代理就能管理所有進出網格的網路流量,並應用高級 Layer 7 的路由和策略規則。其配置是通過控制平面的基於規則的 API 實現的,然後再編譯成 Envoy 專用的設定。

為使應用程序開發人員完全不知道 Istio 的存在,Istio 通過操縱 IP 表操縱全網格中所有 pod 的流量的傳輸到 Envoy。流量劫持通過 init 容器 (istio-init) 或 Istio 的 Container Networking Interface (CNI) 插件來實現。

Istio 的流量控制功能可以劃分為三類:請求路由、韌性和偵錯。它提供了一個基於規則的 API,允許用戶配置網格內的流量管理。應用于主機服務的流量策略基於各種匹配條件,例如負載均衡策略、連接池設置以及異常檢測。

Istio 還提供了一種 Security API,以在各種細粒度級別配置策略。它支援三種模式的 TLS 通訊:DISABLE,PERMISSIVE和 STRICT。通過查看 Istio 請求指標,可以瞭解是否通過 mTLS 代理進行請求。

總結,這篇文章是對服務網格和 Istio 的簡短深入瞭解。還有更多需要探索的。感謝您閱讀此篇文章,讓我們繼續學習!

我的職業生涯故事

我對科技的興趣始於大學時期,當時我選修了Java編程的選修課。我愛上了這門課程,並知道我想把它變成我的職業生涯。在獲得化學學士學位後,我在旅遊業擔任行銷經理。在那裡,我遇到許多具有商業頭腦但技術技能不足的行銷人員,尤其是在SEO和網站建設方面。這激勵我轉行,成為一家澳洲顧問公司的軟體工程師,在這裡我獲得了高級前端開發技能。在工作以外,我進行了兼職的電腦科學學位,這證明是非常有價值的。

在Accenture擔任軟體顧問角色時,一個重大的挑戰是遵守緊湊的時間線。我管理了一個針對航空公司的大型客戶移動應用程式。鑑於眾多的功能需求,我採用了敏捷的方法來持續提供價值。偶爾,我必須與產品所有者協商以克服專案的阻礙。最終,我們成功地推出了移動應用程式,滿足了業務要求並贏得了客戶的滿意度。這次經驗教會了我,僅靠科技並不能解決所有的商業問題。因此,我報名參加了兼職MBA課程,以更好地了解商業與科技的交叉點。

在EY為銀行業界提供咨詢服務時,我們遇到了一個挑戰,那就是雲平台的選擇。我們最初使用Amazon Web Services(AWS)開發了一個銀行錢包產品,認為它符合所有的要求。然而,在即將上線前,我們意識到香港的AWS數據中心有所延遲。由於監管要求,我們必須遷移到Microsoft Azure。我提供並執行了新的技術架構,以確保符合規定。

在Dynatrace,我是售後團隊的一員,專注於軟體監視產品。一個令人難忘的專案涉及到想要將我們的產品整合到他們的雲平台的新客戶華為。在深圳駐點工作時,我面對了要求苛刻的工作文化和每週六天的9 am至9 pm的工作時間。儘管如此,這個專案還是成功地推出了,這部分要歸功於我對客戶問題的主動回應。

作為HSBC的技術領導,我監督了一個針對馬來西亞商戶的在線支付解決方案的開發。我注意到團隊的人分裂,有的人專注於後端,有的人專注於前端,卻沒有人關注整體的用戶體驗。加劇此問題的是辦公室政治,這阻礙了我們的進程。要克服這些挑戰,我與客戶接觸,了解他們的需求,並查詢Splunk日誌以獲取錯誤數據。我對結果負責,有效地分配了任務,從而使交易成功率從40%提升到70%。

現在,作為Thought Machine的客戶工程經理,我最近協助一位需要向台灣最大的銀行之一發表演說的業務預售同事。只有一星期的準備時間,我的同事不擅長講國語,我翻譯並演示了投影片。這是一個具有挑戰性的任務,但演講被很好地接受了。

在我現在的角色中,我還主持新的團隊成員、客戶和越南合作夥伴的培訓課程。雖然英語是我們的第二語言,但我確保說話清晰,並使用各種短語來表達我的觀點。

在工作之外,我對持續學習有著熱忱。我在各種雲平台上都取得了認證,並且擁有Scrum項目管理的認證。我也喜歡通過Toastmasters clubs來提高我的溝通能力和公共演講技巧。

總的來說,我熱衷於探索新技術,並在商業與科技的交叉點找到解決方案。我喜歡與客戶、合作夥伴和團隊合作,根據客戶需求創建強大的架構和演示。歡迎隨時與我聯繫:https://www.linkedin.com/in/victorleungtw

關於數位轉型

在過去的5年裡,我在多個數位轉型項目中擔任領導角色。

2017年,我在埃森哲擔任高級顧問,幫助國泰航空將其手機應用程序從傳統平台轉換為新的本地移動技術。我領導了迭代過程,並積極與遠程團隊成員溝通優先事項。我獲得了在Node.js和Java Spring Boot服務器上編碼的實戰經驗,同時解決客戶在組織結構和技術交叉點上的商業挑戰。

2018年,我在安永擔任顧問,領導滙豐銀行的Payme業務移動應用項目。電子商務的興起和支付寶對新產品的積極擴展對傳統銀行構成威脅。如果這些銀行未能適應新興的二維碼支付趨勢,可能會變得過時。我的角色是幫助銀行成功地進行這項轉變。我展示了技術架構和敏捷交付方法論,在Android上使用Kotlin進行編碼的實戰經驗,並就由於合規原因從AWS遷移到Azure的問題提供建議。

2019年,我作為技術負責人領導了滙豐銀行的商家在線支付項目。大流行病加速了向電子商務銷售的轉變,現有的傳統平台無法跟上,導致許多交易失敗。我負責建立一個使用更穩健技術堆棧的新網站,以取代舊平台。我帶領團隊從啟動到上市提供解決方案,使用TypeScript on Adobe Experience Manager (AEM)的Angular,並在工程師,設計師和利益相關者團隊之間建立了良好的關係。

2021年,我參與了在新加坡新獲許可的數位銀行的工作。與受傳統系統限制的傳統銀行不同,這家數位銀行有利用雲原生技術的競爭優勢。傳統銀行可能擁有更多的客戶,財務資源和市場數據,但新銀行有進行創新的機敏性,使得運營更高效,成本更低。

2022年,我目前參與越南數字銀行項目。作為客戶服務團隊的關鍵技術成員,我幫助在平台上建立金融產品。我的任務包括在銀行存款和貸款產品上工作,並實現Python智能合約代碼。我分析並將業務要求轉化為技術規範,確保及時和成功的交付,同時與客戶,合作夥伴和其他團隊合作。

在過去5年的數位轉型項目中,最重要的一部分是改變思維模式並引入新的工作方式。我在軟體開發,應用架構設計,和企業用戶雲解決方案部署方面有十年的經驗。擁有計算機科學和金融商學碩士(MBA)學位的我,具有獨特的技術和商業智識結合。我擁有Amazon Web Services (AWS),Google Cloud Platform (GCP),Microsoft Azure,Kubernetes和Scrum的認證,並有從頭開始建立銀行產品的經驗。

我的職業目標是領導數位轉型,這需要創新戰略來應對複雜的挑戰。在沒有足夠信息的情況下啟動大規模項目可能會導致組織各級的抵制。我希望通過更小的成功項目早期贏得支持者,並展示明確的財務影響來克服這些常見障礙。

我的優勢在於我學習並快速應用知識的能力。在多變的商業環境中,迅速適應並以低成本測試假設至關重要。我的測試和學習的心態是持續改進的源泉,使我能夠提供有價值的反饋,幫助團隊成功。

然而,我的弱點可能是我過於關注技術。數字轉型不僅僅關於技術變革;它是關於更有效地滿足客戶需求。作為一個工程經理,我明白單憑技術無法改變一個行業,除非有一種商業模式將其與新興市場連接起來。

創新需要多種多樣的技能。包括商業和技術人員的團隊,與領域專家共同工作,可以確保項目解決組織的優先問題,而不是孤立的部門問題。當我作為軟體開發人員將最終用戶納入應用程序的設計中時,成功採用的可能性大大增加。