Thursday, October 15, 2020

System design: Microservice - 10 Tips for failing badly at Microservices by David Schmitz

Here is the link. 

Microservices are just a bunch hip new framework plus some AngularJS frontend or React, right? So, if you want to make sure that you absolutely and definitely fail at your Microservice project, then watch this talk and learn how. Using real world experience from multiple green field and brown field projects, I can show you: - how to ignore the mandatory organizational impact - how to focus on the code only without any regard towards ops and testing - continuous deployment is for losers. Real projects use their meat cloud for delivery - jumping onto every new and untested framework is a must - Event Sourcing and CQRS are both free lunches. So, you can add complexity without any real need - ...and more If you mind my tips, then surely you will fail at Microservices and your boss will never again try to move away from your beloved vintage monolith. David Schmitz Pricinpal architect at Senacor Technologies with a history of + 13 years of working in various projects using a bunch of different stacks and environments. Current focus is on migrating architectures and organizations, such that our customers can cope with the challenges of the digital age.

10) Tooling - Prefer one well-established tech stack. Too many tools often result in unintended complexity across the board.

9) Data Ownership - Prefer separate databases or schemas for each micro-service to keep clear table ownership. 8) Event Sourcing - Research whether you actually need it and design carefully. 7) Coupling - Beware dependency versions and shared libraries (especially in-house ones). Microservices are often more coupled than we realize. 6) Automation - Use CI/CD and automate your processes. Keep in mind that everything "hand-crafted" complicates your infrastructure. 5) Failure - Design for failure. It's a distributed, networked environment. And, again, avoid making a highly coupled microservice monolith monstrosity that fails simultaneously . 4) FE Responsibilities - Have clear responsibilities. Associate certain frontend pages with certain APIs so that you know what microservice is responsible when something fails. 3) Tooling - Having a few well-defined tools is a virtue; but, remain open to clearly better tools. Let teams use what works best on their project. 2) Design - Model your services around the company's domain and make sure management is aware of the high-level architecture. 1) Communication - Communication between teams is a must. Have someone that understands how everything works together and what different teams are responsible for.

Investing U.S. stocks in a TFSA

 Here is the article. 

Canadian dividends and interest are specifically tax-free in a TFSA, when earned, when withdrawn, whenever. Non-Canadian dividends, including those paid by U.S. blue chip stocks, are subject to withholding tax in a TFSA.

The IRS levies a withholding tax of 15% on dividends paid to Canadian resident investors. Whether you own U.S. stocks directly in your TFSA or you own a Canadian mutual fund or exchange-traded fund (ETF) that owns U.S. stocks, the result is the same.

If you have an RRSP, a TFSA and a non-registered account, you may be better off with your TFSA in U.S. stocks despite the 15% tax withholding. As an example, U.S. stocks are taxed at a 21% higher tax rate in a non-registered account than Canadian stocks for someone earning $75,000 in British Columbia (more tax than the 15% withholding tax in a TFSA). And I’d rather see someone with their fixed income in their RRSP than their TFSA or non-registered account. You’ll pay less tax today and tomorrow because a smaller RRSP means less tax on withdrawals – grow your more tax-efficient TFSA and non-registered assets instead.



Equity research: Why it is so hard to invest on stock market?

 Oct. 15, 2020

Introduction

I downloaded my TFSA account and then I had chance to go over my Sept. 2020 performance. I have to take some time to accept the truth, 10% loss in September. 

TFSA performance 

It is so surprising to learn that it is hard to invest on stock market after I had over $7000 dollars loss in Sept. 2020. I did not invest back on SU.TO stock on lowest price below $15/ share. 

TFSA performance

I have to stay connected to stock market, and also keep myself calm. Do not shy away from the stock market. I need to take some risk to have some gains. 




System design: Four Distributed Systems Architectural Patterns by Tim Berglund

 Here is the link. 


Reference Architectures [2:08] Modern Three-Tier [2:25 Presentation - Business - Data [2:54] (JSP EJB Oracle) (React.js Node.js Cassandra) Strengths [12:43] Rich front-end framework (scale, UX) Hip, scalable middle tier Basically infinitely scalable data tier Weaknesses [14:57] State in the middle tier Overall Rating [15:32] Scalability 4 Hipness 2 Difficulty 3 Flexibility 5 Sharded [16:49] When Sharding Attacks [19:53] Strengths [23:38] Client isolation is easy(data and deployment) Known, simple technologies Weaknesses [24:56] Complexity No comprehensive view of data (ETL) Oversized shards Overall Rating [28:00] Scalability 3 Hipness 1 Difficulty 4 Flexibility 3 Lambda [28:39] http://softwareengineeringdaily.com/2016/08/19/apache-beam-with-frances-perry/ Messaging [34:42] Kafka [35:09] Strengths [38:20] Optimizes subsystems based on operational requirements Good at unbounded data Weaknesses [39:09] Complex to operate and maintain No, seriously Overall Rating Scalability 5 Hipness 1 Difficulty 5 Flexibility 2 Streaming [39:57] Streaming [40:04] Integration is a first-class concern Life is dynamic; databases are static Tables are streams and streams are tables Keep your services close, your computation closer Integration [41:55] Database Abstraction [45:25] Storing Data in Messages [46:26] Retention policy? Don't be so hasty Whole-hearted I/O performance O(1) writes Partitioning, replication Elastic scale First-class events [47:07] Streams API for kafka [48:05] Core Kafka since 0.10 (May, 2016) Filters, aggregations, joins Doesn't require a separate cluster! Keep stream computation near your code Overall Rating Scalability 5 Hipness 5 Difficulty 4 Flexibility 5

System design: Design Microservice Architectures the Right Way

 Here is the link. 

QCon Plus covers the trends, best practices, and solutions leveraged by the world's most innovative software shops. Taking place between November 4-18, the event is thoughtfully designed with shorter, focused technical sessions spread over 3 weeks. You’ll learn from 54 speakers and 4 keynotes across 18 tracks. The event includes highly interactive sessions, Q&As, AMAs, breakouts, and real-time collaborative action.

Michael Bryzek highlights specific key decisions that very directly impact the quality and maintainability of a microservice architecture, covering infrastructure, continuous deployment, communication, event streaming, language choice and more, all to ensure that teams and systems remain productive and scale.


GME stock: 13% gains on Oct. 15, 2020 - 400% return in 3 months

The stock has 400% return starting from August 2020. The price was arond $4.00 dollar/ share in August, 2020. 

I should look into how institution buyers or retail buyers pushing up the price. 

I bet on 30 shares on Oct. 9, 2020, but I sold in panic with loss $30.00 dollars. I should start to look into more about GME stock. 


Arry stock: IPO first day

 Oct. 15, 2020

Introduction

I have to push myself harder to work on equity research. I got up at 8:00 AM and then I did some equity research, I did purchase $1000 dollars stocks: NCLH, SU, AAL. I did not pay attention to Arry stock, my friend in wechat chinese group shared the stock information, one person followed her sharing. 

Arry stock:

It is the first day IPO. My friend later shared her story, she purchased 1000 shares, bought at price $20, and sold at $26. The price went up $36.00 dollars. I did not notice the stock at all through wechat conversations. 




My research

I have to take it seriously, and work on equity research. I should pay attention to IPO stock as well. No one can avoid market risk, but it takes hard work to understand which stock went to IPO today. I should start to read more about Arry stock. 



Book reading: .NET Microservice: Architecture for Containerized .NET applications

 Oct. 15, 2020

Introduction 

I like to rush and read as many pages as possible. I am reading the book, and I like to prepare my Saturday system design mock interview, so I can understand better and talk about better about system design. 

Book reading

There are so many good content for me to understand Microservices. But how do I find the book? I did read the article about Microservice system design, and then I checked the reference [8]. Here is the blog. 


Wednesday, October 14, 2020

Algorithm practice: Learn from my own performance on interviewing.io as an interviewee

Oct. 14, 2020

Introduction

It is unbelievable to find almost all questions asked on Leetcode.com. I quickly wrote a discussion post for each algorithm, and enjoyed the benefit to solve another 5 algorithms at least. 

My mock interviews and leetcode discussion post 

Oct. 13, 2020

  1. Combinations
    C# Depth first search practice

  2. Generate Parentheses
    C# brute force solution to enumerate all possible combinations

  3. Word Search
    C# Word search - DFS algorithm
    C# code review my practice on June 14 2017
    C# my practice in July 2015

  4. Subarray Sum Equals K
    C# I learned from my own mock interview performance

  5. 01 Matrix
    C# Apply breadth first search to find shortest distance

  6. Spiral Matrix
    C# practice on interviewing dot io as an interviewee

  7. Maximal Rectangle
    C# Review my practice on August 1, 2017

Stock investment: Monthly goal - set $500 gains as my goal

 Oct. 14, 2020

Introduction

It is so hard to get rid of market risk. I like to learn better to manage risk. One of ideas is to set goal low, like $500 dollars gain, so the loss may be less than $1000/ month. I like to stay positive, do not time the market. Get back in again. 

My Ameritrade.com IRA account

I only held around $1200 dollars stock. I like to purchase at most less than $6000 dollars stock, and I plan to make some gains around $500 / month. 

I like to hold cash around $13,000 dollars in case there is big market correction or 20% to 30% pullback. 

TFSA account 

I also like to purchase around $10,000 dollars stocks and then try to make profit around $500/ month. I like to learn how to stay consistent, and learn to love equity exposure. Live a day with market go up and down. Learn how to take it easy, and do not let the market interrupt my daily work and my life. 


System design: Linkedin profile - Randy Shoup - Microservice architecture

 Here is the link. 

About

I have worked as a senior technology leader and executive at companies ranging from small startups, to mid-sized places, to eBay and Google. I have found that high-performing organizations combine clear goals, supportive culture, efficient organization, and flexible technology. I believe in small multidisciplinary teams, autonomy and accountability, and goals over solutions. Mostly, I believe in doing something you care about with people you like and respect.

I have a broad range of technology interests, and I like a new challenge. So I suppose I have been more or less a serial expert, moving from databases and analytics platforms, to security software, to ecommerce and search, and more recently to cloud infrastructure. One common thread across the last 30 years has been working on highly scalable, highly available, multi-tenant distributed systems serving hundreds of millions of users.

I enjoy sharing my experiences with others through advising and conference speaking. You can find a range of topics covered at slideshare.net/randyshoup, and on my blog at randyshoup.com.
 

System design: How to learn better as a beginner?

 Oct. 14, 2020

Introduction

It is easy to set up ambitious goal to solve another 100 algorithm on Leetcode.com. I only have two more weeks to prepare for Leetcode algorithm practice. But I do really like to motivate myself to be a good system architect one day. How can I start the journey? I do think that it can be done. Today is the day one. 

Managing Data in Microservices

I learned from the presenter - he talked about his own experience, and I need to write down his name, and then look up through Linkedin.com. 


FSLY stock: Fastly Plummets After Tension Over ByteDance Curbs Sales

 Here is the article. 

One of Chinese friends in wechat investment group invested 200 shares of FSLY at price of $89.00. 

Fastly shares fell as much as 30% in late trading Wednesday after the cloud-platform provider said revenue for the period will be in the range of $70 million to $71 million, compared with its previous guidance of at least $73.5 million. Analysts were estimating sales of at least $74.2 million.

Fastly has been among the biggest pandemic winners in the stock market this year, with its shares gaining more than 500% as a result of increased internet traffic due to stay-at-home measures.

Content delivery networks use a tech distribution platform to push speedy internet content in front of consumers whether they’re buying cases of beer on Shopify, or loading videos on TikTok.


System design: Managing in Microservices

 Here is the link. 

Randy Shoup shares proven patterns that have been successful at Google, eBay, and Stitch Fix. Shoup covers managing data, the need to isolate a microservice's data store behind the service interface, using events as a first-class tool in the architectural toolbox, techniques for service extraction from a monolithic database and much more. This presentation was recorded at QCon New York 2017. The next QCon is in London, March 5-7, 2018. Check out the tracks and speakers: http://bit.ly/2hxsoN1


Starting from 28:00 - 30:38

Talk about stitch fix - how to extract microservice?

Two apps, - three tables

Extract -> client- service

core client

item-service - core item

style-service -> core sku

Styling app / warehouse app

Two apps -> three services -> three databases - dependency, join, and then ...

Extract things to service

Microservice techniques: Shared Data


Manage data - Join,

System design: Microservices vs SOA | Microservices Tutorial for Beginners | Microservices Training | Edureka

 Here is the link. 

Even though there isn’t a formal definition of microservices architectural style, there are some common characteristics that all applications adhering to this architecture should exhibit to make them scalable. These characteristics are smart endpoints & dumb pipes, decentralized governance, infrastructure automation, and failure isolation. Let’s discuss about each characteristic in the following sections.

1. Integration pattern: smart endpoints and dumb pipes

As a microservices application split up its structure into loosely coupled multiple components, natural questions to ask seem to be: In which protocols are pairwise components communication conducted? Given the protocols, in what patterns should the data be routed throughout the application?

a. Communication Protocols

When building communication structures between different processes, there’re many products and approaches that stress putting significant effort into the communication mechanism itself. A good example of this is the Enterprise Service Bus (ESB), where ESP products often include sophisticated facilities for message routing, choreography, transformation, and applying business rules. (ESB is also the fundamental difference between Microservices and Service-oriented Architecture (SOA). Further comparison between the two can be found at [2]).

Microservices, instead, favors an alternative approach: “smart endpoints and dumb pipes”. Microservices applications aim to be as decoupled and as cohesive as possible — they own their own domain logic an act more as filters in the classical Unix sense- receiving a request, applying logic as appropriate and producing a response, which is choreographed using mostly two commonly form of communications: Request-Response and Observer.


ENB stock: value stock, good time to purchase more

Here is the article.  

Fortunately, on this metric, the company seems to be in good shape. Management expects to generate $5.9 to $6.3 per share in distributable free cash flow this year. That’s because demand for natural gas has been relatively robust, despite the pandemic. Meanwhile, this year’s expected dividend is $2.46.

That means Enbridge stock could generate roughly double the amount it needs to provide a dividend. That makes the dividend incredibly reliable. 

Enbridge stock valuation

Unsurprisingly, Enbridge stock is also trading at a beaten-down valuation. Investor anxiety about energy demand has pummelled all oil and gas stocks this year. However, Enbridge isn’t an oil and gas producer, but a transporter. In other words, it owns and operates the pipelines used to distribute gas. 

In fact, Enbridge supplies 25% of crude oil produced in North America, and nearly 20% of the natural gas consumed in the U.S. Volumes dipped this year as North America went into lockdown, but should recover next year as the economy regains momentum. 

That bounce back hasn’t been priced into the Enbridge stock price yet. The stock trades at six times earnings before interest, taxes, depreciation and amortization (EBITDA). That’s far below its historic average of 8.9 times EBITDA. The stock also trades at a forward price-to-earnings ratio of 14.3 and just 34% higher than book value per share. 

It’s the ultimate value stock. In this environment, it’s also an incredible contrarian opportunity, especially for income-seeking investors.  My Fool colleague Andrew Button believes a Trump re-election could be the catalyst that helps unlock value in Enbridge stock. At this point, that seems fairly likely. 

Tuesday, October 13, 2020

Alida ( Vision Critical): Customer - Aurora healthcare

 Here is the link. 


System design: Microservice

 Here is the link. 

I had a mock system design interview, and then my interviewer was so smart and gave me the hint to ask me talk about more about Microservice. It is such great help for me to go back to learn something about Microservice. 

The interviewer dropped me and quitted the interview early, but I quickly figured out what to do next. The world is changing so quickly, I could not focus on so many things. 

Here is the article about Microservice system design. 

Here are some good ideas to look into: 

These characteristics are smart endpoints & dumb pipes, decentralized governance, infrastructure automation, and failure isolation. Let’s discuss about each characteristic in the following sections.

A good example of this is the Enterprise Service Bus (ESB), where ESP products often include sophisticated facilities for message routing, choreography, transformation, and applying business rules. (ESB is also the fundamental difference between Microservices and Service-oriented Architecture (SOA). Further comparison between the two can be found at [2]).

Let me find out those two articles, and I like to spend time for each article over 10 minutes at least. 

Chained or chain of responsibility 

Branch pattern

Saga pattern 





Alida (Vision Critical): Customers

 Here is the link. 


How eviction works in USA

 Here is the link. 


Florida rental condo: An engineer works remotely and plan to move in

 Oct. 13, 2020

Introduction

USA is such a great country. The engineer is so smart and then figure out moving to Florida for cheap rent. Work remotely is such great deal for family and professionals. Specially for those working at Florida before. 

Florida rental condo

I am planning to rent out the condo in Nov. 2020 for a new renter. History is such great thing for me to write about. 

I will try to find some pictures back in 2001. It is almost 20 year since my friend moved in the rental place, who used to be my first renter back in 2000. 

An engineer decided to move from Sillicon Valley back to Florida. It is smart decision and then Florida winter is such great time to enjoy. 

Airline ticket cost is less than $200 dollars. The transportation of car is around $1000 dollars. I do think that I am also taking risk to lower rent and just cover $300  monthly maintenance, and those property tax $2000 dollars. I need to pay $5000 for roof repair this year. I need to have some cushion in order for me to survive. 

I need to save at least $2000 in order for me to survive as a landlord. Even if the home is paid in full. 


Patience: When I time the market, be alert that 80% I am gambling ...

 Oct. 13, 2020

Introduction

It is Tuesday and I spent a few hours to read about stock market. I checked MRO and SU stock price, and wonder if I should time the market and get back in. 

Time the market

I also need to check next two months and see what I should do since holiday season is coming.