@manhng

Welcome to my blog!

ASP.NET Core Microservices

October 4, 2021 12:05

ASP.NET Core Microservices (edit)

  • Building Microservices on .NET Ecosystem
  • Microservices on .NET platforms

Phần 1: Microservices

Building Microservices on .NET Ecosystem

sanjyotagureddy/aspnetrun-microservices: Building Microservices on .Net Ecosystem (github.com)

Microservices on .NET platforms

aspnetrun/run-aspnetcore-microservices: Microservices on .Net platforms which used Asp.Net Web API, Docker, RabbitMQ, MassTransit, Grpc, Ocelot API Gateway, MongoDB, Redis, PostgreSQL, SqlServer, Dapper, Entity Framework Core, CQRS and Clean Architecture implementation. Also includes Cross-Cutting concerns like Implementing Centralized Distributed Logging with Elasticsearch, Kibana and SeriLog, use the HealthChecks with Watchdog, Implement Retry and Circuit Breaker patterns with Polly and so on.. See Microservices Architecture and Step by Step Implementation on .NET Course w/ discount-> (github.com)

microservices_remastered

GitHub .NET Repos to Take Your Tech Skills to the next level

1) Examples and Tutorials of Event Sourcing in .NET

oskardudycz/EventSourcing.NetCore: Examples and Tutorials of Event Sourcing in .NET (github.com)

2) Full Modular Monolith application with Domain-Driven Design approach

kgrzybek/modular-monolith-with-ddd: Full Modular Monolith application with Domain-Driven Design approach. (github.com)

3) Sample .NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture

kgrzybek/sample-dotnet-core-cqrs-api: Sample .NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture. (github.com)

4) Clean Architecture with .NET5, C#9 and React+Redux. Use cases as central organizing structure, completely testable, decoupled from frameworks

ivanpaulovich/clean-architecture-manga: Clean Architecture with .NET5, C#9 and React+Redux. Use cases as central organizing structure, completely testable, decoupled from frameworks (github.com)

5) WhiteApp API solution template which is built on Onion Architecture with all essential feature using .NET 5!

Amitpnk/Onion-architecture-ASP.NET-Core: WhiteApp API solution template which is built on Onion Architecture with all essential feature using .NET 5! (github.com)

WhiteApp or QuickApp API solution template which is built on Onion Architecture with all essential feature using .NET Core

Onion Architecture - Visual Studio Marketplace

WhiteApp Onion architecture with ASP.NET Core API

This is default white application for ASP.NET Core API development

This whiteapp contains following features, uncheck feature need to implement yet.

  • [x] Application is implemented on Onion architecture
  • [x] .Net 5.0
  • [x] Web API
  • [x] Entityframework Core
  • [x] Expection handling
  • [x] Automapper
  • [x] Unit testing via NUnit
  • [x] Integration testing via NUnit
  • [x] Versioning
  • [x] Swagger UI
  • [x] CQRS Pattern

Below features will be implemented in infrastructure layer. You can plug and play based on your project.

  • [x] Loggings - seriLog
  • [x] Email
  • [x] Health checks UI
  • [x] JWT authentication with Microsoft Identity
  • [x] Role based Authorization
  • [x] Fluent validations
  • [x] Database Seeding
  • [x] Enable CORS origin
  • [x] Enable feature flag (Make it true when you configure your email configuration)

image

Use this template

gtechsltn/Onion-Architecture-ASP-NET-Core (github.com)

gtechsltn/SimpleWebApps (github.com)

6) Clean Architecture Template for .NET 6.0 WebApi built with Multitenancy Support

fullstackhero/dotnet-webapi-boilerplate: Clean Architecture Template for .NET 6.0 WebApi built with Multitenancy Support. (github.com)

Features

  •  Built on .NET 6.0
  •  Follows Clean Architecture Principles
  •  Completely Documented at fullstackhero.net
  •  Multi Tenancy Support
  •  Supports MySQL, MSSQL & PostgreSQL!
  •  Uses Entity Framework Core as DB Abstraction
  •  Flexible Repository Pattern
  •  Dapper Integration for Optimal Performance
  •  Serilog Integration
  •  Swagger Support
  •  Mapster
  •  API Versioning
  •  Response Caching - Distributed Caching
  •  Fluent Validations
  •  Audit Logging
  •  Advanced User & Role Based Permission Management
  •  Code Analysis & StyleCop Integration with Rulesets
  •  JSON Based Localization with Caching
  •  Hangfire Support
  •  File Storage Service
  •  Test Projects
  •  & Much More

Phần 2: Responsive Web Design

4 Tips for Using Responsive Web Design Effectively   - The Media Temple Blog

Phần 3: 50 tips for improving your software development game

Expert advice: 50 tips for improving your software development skills (techbeacon.com)

How do you keep improving as a software engineer? Some pieces of advice are valid no matter your experience level, but often the advice will depend on where you are in your career.

If you're a beginner, the best advice is to simply learn your language, frameworks, and tools top to bottom and gain more experience with a variety of different projects.

If you're an experienced software developer, you should constantly try to find new ways to optimize your code for readability, performance, and maintainability, and then practice making well-reasoned decisions about where to focus time and resources in your code—whether it's testing, performance optimization, or other technical debt.

Those are some of the themes you’ll find if you ask veteran software engineers to share their best advice for being a great programmer. There aren’t any well-kept secrets. The advice of many of the most successful developers is readily available to you on blogs and forums.

 

I’ve taken the most illustrative advice and recurring tips from blogs and forums and organized them into five categories that emerged as I compiled them. I've paraphrased and merged various similar tips into single snippets, and I've also left a few pieces of advice as untouched quotes from their authors.

Whether you have five, ten, or twenty years of experience programming—or if you have almost no experience—I think just about every developer will find some good ideas for self-improvement.

Domains, architecture, and design

1. The best programmers can take a complex problem, break it down into smaller pieces, solve each of those pieces, and then put everything back together to solve the initial problem.

2.  Software is just a tool for solving domain problems. Since it’s needed in almost all domains, develop in one that interests you. If you understand a domain well and are passionate about it, you’ll be a much better, more motivated developer. You’ll also be exponentially more valuable and lucrative to companies hiring in your chosen domain.

3.  Don’t let one domain pigeonhole you into one way of coding. An example would be a mobile developer who is mainly good at hooking together existing APIs but can't come up with a sane data representation. Don’t be a one-trick pony.

4.  Plan your code away from the computer. It will help you build a clear mental model before you start. You use the same strategy in writing, because if you don’t have an outline, your content becomes a messy stream of consciousness.

5.  “When you're stuck, write your program on paper. I'm serious. It's magic. This is standard practice in programming competitions. (I think it works because when you don't have to think about syntax you have more excess brain power to solve the actual problem.)” (Source)
Joseph Gentle

6.  “Compelling web apps tend to be the ones that use data in unexpected ways or in ways that solve everyday problems. Learn everything you can about data storage.” (Source)
Maggie Nelson

7.  As an architect, you can’t have blind spots in your understanding of your applications and their execution environments. You need to know how things work in the front end (UI), the back end, the data store, the OS, any virtualization layers, the hardware, the network, and the data center.

Languages, tools, and advancing from beginner to intermediate

8.  Contribute to open-source projects as a bridge from beginner to intermediate. Collaborate with the developers of the project and attend meetups to collaborate with other developers in person.

9.  Don’t let anything get in the way of that initial motivation to learn programming and just build something. Sometimes you block yourself by having too much focus on reading books or resources first. Other times beginners will try to find the perfect first language. Your first language doesn’t matter. What matters is learning to program well. Just start coding.

10.  "Learning programming languages is NOT learning how to program. Focus on programming techniques, problem solving, and analytical skills, not on learning as many languages as you can."
Richard Eng

11.  Learn multiple programming paradigms such as object-oriented programming, functional programming, reflective programming, etc. Believe it or not, your programming in one paradigm will improve after studying an alternative paradigm.

12.  "Wherever possible, always choose the simpler programming language. More complex languages increase the cognitive load on your brain. Simpler languages do not necessarily give up anything in terms of power or expressiveness."
Richard Eng

13.  Beginners learn just enough of their tools to get by. To become an intermediate or expert developer, you need to know your tools cold. Learn all of the features, menus, and context menus. Learn to use them without a mouse by memorizing keyboard shortcuts. Find every “tips and tricks” article available.

14.  Learn your stack on the deepest levels before you decide to reinvent the wheel. Peter Nixey gives a few good examples: “If you are a Ruby developer take time to learn the language's incredible range of methods. If you are a Node developer, take time to understand the architecture, the methods, and the mindset of Node. If you are an Angular developer go right up to the rock-face and understand the logic behind of the incredible architecture the core team is forging there right now. Ask before you invent.” (Source)
Peter Nixey

15.  The same goes for the languages you work in. Learn the most important libraries for your use cases. The more libraries you’re aware of, the less likely you are to try reinventing the wheel.

16.  Whenever you can, use programming languages that will eliminate entire classes of run-time errors. To do that, look for languages with features like strong typing, static typing, managed memory, and/or immutable data.

17.  “Frameworks, libraries, languages, never mind if you can’t understand what you find under the hood on your first attempt. You can always put them aside and return to them later, just see to it that you can take them apart and have a look. All the rules you have to follow when you first learn were invented by someone, you can make them yours to reinvent with some persistence. Steer clear of tools that put barriers in the way of this activity, those make you depend on them in the wrong way.” (Source)
Jan Christian Meyer

18.  “[When reading high-quality code], it might be tempting to look for main() and start from there, but you're likely to spend a lot of time just reading set-up code and command-line parsing. I prefer to scan the filenames to look for some activity that interests me and then dig into those files. It's not crucial to understand the whole project or the ins and outs of the entire design, you'll wear yourself out doing this. Read the code. Look at the comments, see what the authors are doing, and how they went about it.” (Source)
Andrew Binstock

19.  Create some of your own tools. (But of course, if you're going to use it in production, make sure it's not another wheel reinvention.)

20.  Make common programs that have been made before. Not for a production project (see “reinventing the wheel”), but as a learning project. If other developers can make a calculator, text editor, paint, Tetris, or Pong, then so can you. Look at several examples of these apps written by more experienced developers and try to learn their tricks.

21.  Develop an aesthetic appreciation for code. Read the source code of famous open-source tools and frameworks such as Ruby on Rails or Jenkins, and get familiar with norvig.com. Over time, you need to train yourself to know what great code looks like and what bad code “smells” like.

Code readability and maintainability

22.  “Don't ask permission to refactor, test, document etc. It's all part of ‘programming’. Don't ask permission to do your job.” (Source)
Jerome Terry

23.  "Fix what isn’t broken. You should go to your last project and read through the code. Think about what each piece does. There's a loop here, some sorting there, a bit of number crunching, screen updates, HTML generation, database CRUD, that sort of thing. Now replace the hard-coded HTML with a templating system, get the database CRUD out of your business objects and re-write it to use proper parameterized queries instead of string concatenation, replace all the "writelns" and "MessageBoxes" in your error handlers with a logging framework, refactor code that's trying to borrow methods from other classes, use locale-aware string formatting, stop guessing how big an array should be and use a dynamic collection, delete orphaned code." (Source)
Chris Wenham

24.  Most developers have heard the saying, "Always write code as if the person who ends up maintaining it will be a violent psychopath who knows where you live." What that means realistically is that you should write readable code that could be easily comprehended a year later by someone who’s disinterested and in a hurry. If you’ve ever had to dig through indecipherable code, you know why this is so important. Have some empathy for the developers who will read your code.

25.  Name variables so that other developers can understand your code better. This is a skill you need to nurture.

26.  Using inheritance often reduces testability and reusability of your object-oriented code in the long run. Your first choice should be using composition and interfaces.

27.  Don’t use design patterns like a hammer looking for a nail. If you don’t have a clear reason you need it, don’t use it.

28.  Always favor shallow code hierarchies to deep-nested code (whether it’s inside or outside a function). Deep-nested code is harder to maintain, harder to reuse, and more likely to create bugs.

29.  Reusable code is helpful and important, but trying to write overgeneralized, super flexible code is often a waste of time. This kind of code is usually harder to maintain and causes bugs. It’s okay to hardcode some things if your code is doing one task.

30.  Master the art of debugging using "print statements." There are many scenarios where a sophisticated debugger is not available to you, but I've never found a platform nor environment where you couldn't output textual information to a screen or file.
Richard Eng

31.  Having great writing and communication skills directly translates into programming capability. Joel Spolsky can elaborate on why this is:
"The difference between a tolerable programmer and a great programmer is not how many programming languages they know, and it's not whether they prefer Python or Java. It's whether they can communicate their ideas. By persuading other people, they get leverage. By writing clear comments and technical specs, they let other programmers understand their code, which means other programmers can use and work with their code instead of rewriting it. Absent this, their code is worthless."

32.  Just like natural languages, you haven’t mastered programming until you see and think in code. A popular book, Structure and Interpretation of Computer Programs, by Abelson, Sussman, is one of the best resources to help you do this. Don’t worry that its examples are in Scheme; it's an optimal language for learning to think in code.

Technical debt, code coverage, and process

33.  Donald Knuth, is known for his maxims “When in doubt, use brute force” and “Premature optimization is the root of all evil.” When he says “use brute force,” he means that you shouldn’t let yourself get stuck trying to come up with a prematurely optimal algorithm. Just use the simplest, unsophisticated algorithm that will work and iterate from there. Using the simplest formula will also help you better understand how your software should work so that you can start forming a mental model with which to think of better, more efficient algorithms.

34.  Know when to take on technical debt and when to pay it off so it doesn’t compound. When exploring (and discarding) different features and pivoting frequently, borrow heavily on technical debt. When your position is stable and your direction is clearer, optimize your remaining features and clean up bugs to pay off that technical debt before moving on to the next stage.

35.  Within the context of your projects, learn what the right amount of testing is. Too little and your software becomes unreliable and everyone is afraid to deploy to production. Too much and you’ll end up wasting too much time and resources writing and maintaining them, while also making the development process slower.

36.  Estimating time is hard. This is why iterative development methods such as Scrum are so popular. Push yourself and your team to have increasingly shorter release cycles. Surprisingly, shipping code more frequently reduces risk instead of increasing it. It forces you to have better organizational practices and make a better product for the customer with faster feedback.

37.  Commit your code in small, working chunks and write a detailed commit messages that will help developers find and understand bugs that may have been introduced in that commit. Just summarize what you did and why you did it.

38.  Most developers don’t think about security in every unit of code they write. Many think that frameworks will handle that for them. Don’t be like most developers.

39.  You can spend an exponentially greater amount of time hunting down the last 1% of bugs in a project than you would for the first 90%. If you’re not working in a domain that requires your software to work perfectly 99.999% of the time, then you should spend less time debugging the edge cases and features people probably won’t use.

Soft skills and productivity

40. Have large chunks of time set aside for focused coding each day. The quantity of time spent coding is meaningless if it’s full of interruptions such as meetings, emails, and web browsing.

41.  Communicate clearly with your team about what you’re doing each day. Talking about your architectural approaches will help you think about those approaches in new ways. It has nothing to do with proving to people that you’re doing good work. More likely, your team will have some ideas you would have never thought of on your own, and you’ll solve problems a lot faster. Your team should also document solutions and share them on a wiki to save valuable time for everyone.

42.  Don’t be ashamed to admit when you don’t know something. As a developer, you’re often solving new problems, so you can’t be expected to know all the solutions immediately. Trying to hide your lack of knowledge only slows the learning process.

43.  Don’t be afraid to share your unfinished work with others frequently.

44.  "Emotionally detach from your code. Find the code that you're the most proud of and delete it, then rewrite it from scratch in a different way. Use a "design pattern" that confuses you or that you hate (e.g., the Singleton) and figure out how to make it work. If necessary, delete that after you've got it working and try again with a new pattern or language. Not only will you learn that there's More Than One Way To Do It, but you'll learn that your code is transitory. Code, by its nature, is not just inextricably glued to its language, platform, and the APIs it consumes, but written in the form of ephemeral static charges, orientations of magnetic particles, subject to the whims of the market, Moore's Law, and your employer. … Remember that emotional detachment from code is a virtue, but this doesn't mean emotional detachment from your work is, too. In fact, another way to become emotionally detached from code is to put your interest into the outcome instead." (Source)
Chris Wenham

45.  Googling is a crucial developer skill. Learning how to do something you haven’t done before and finding optimal solutions from the collective intelligence of the developer community is half the battle in programming.

46.  "Good programmers know what to write, but great ones know what to rewrite (and reuse)." (Source)
Eric S. Raymond

47.  Teach. Even if you’re a novice at programming, you’re knowledgeable about something. Teaching teaches the teacher. And if you can train other workers, your manager should realize that you’re exponentially more valuable.

48.  Don’t focus on becoming a “10x” programmer. Read these articles by Matt Asay and Scott Hanselman to see why.

49.  “You won’t—you cannot—become a better programmer through sheer force of programming alone. You can only complement and enhance your existing programming skills by branching out. Learn about your users. Learn about the industry. Learn about your business. The more things you are interested in, the better your work will be.” (Source)
Jeff Atwood

50.  Make mistakes, ask questions, get rapid feedback, get uncomfortable, compare it to what you know, keep going. More on that here.

Phần 4: How to easily structure your solution

NMillard/BasicSolutionStructure (github.com)

gtechsltn/BasicSolutionStructure (github.com)

Useful links

ASP.NET Core Microservices with MongoDB

September 1, 2021 18:50

ASP.NET Core Microservices with MongoDB (edit)

  • MongoDB
  • Kafka
  • Microservices
  • ASP.NET Core

MongoDB and Data Streaming: Implementing a MongoDB Kafka Consumer - DZone Big Data

Data Streaming with Apache Kafka & MongoDB - EMEA (slideshare.net)

MongoDB Connector for Apache Kafka 1.5 Available Now | MongoDB

aspnetrun/run-aspnetcore-microservices: Microservices on .Net platforms which used Asp.Net Web API, Docker, RabbitMQ, MassTransit, Grpc, Ocelot API Gateway, MongoDB, Redis, PostgreSQL, SqlServer, Dapper, Entity Framework Core, CQRS and Clean Architecture implementation. Also includes Cross-Cutting concerns like Implementing Centralized Distributed Logging with Elasticsearch, Kibana and SeriLog, use the HealthChecks with Watchdog, Implement Retry and Circuit Breaker patterns with Polly and so on.. See Microservices Architecture and Step by Step Implementation on .NET Course w/ discount-> (github.com)

Whats Including In This Repository

We have implemented below features over the run-aspnetcore-microservices repository.

Catalog microservice which includes;

  • ASP.NET Core Web API application
  • REST API principles, CRUD operations
  • MongoDB database connection and containerization
  • Repository Pattern Implementation
  • Swagger Open API implementation

Basket microservice which includes;

  • ASP.NET Web API application
  • REST API principles, CRUD operations
  • Redis database connection and containerization
  • Consume Discount Grpc Service for inter-service sync communication to calculate product final price
  • Publish BasketCheckout Queue with using MassTransit and RabbitMQ

Discount microservice which includes;

  • ASP.NET Grpc Server application
  • Build a Highly Performant inter-service gRPC Communication with Basket Microservice
  • Exposing Grpc Services with creating Protobuf messages
  • Using Dapper for micro-orm implementation to simplify data access and ensure high performance
  • PostgreSQL database connection and containerization

Microservices Communication

  • Sync inter-service gRPC Communication
  • Async Microservices Communication with RabbitMQ Message-Broker Service
  • Using RabbitMQ Publish/Subscribe Topic Exchange Model
  • Using MassTransit for abstraction over RabbitMQ Message-Broker system
  • Publishing BasketCheckout event queue from Basket microservices and Subscribing this event from Ordering microservices
  • Create RabbitMQ EventBus.Messages library and add references Microservices

Ordering Microservice

  • Implementing DDD, CQRS, and Clean Architecture with using Best Practices
  • Developing CQRS with using MediatR, FluentValidation and AutoMapper packages
  • Consuming RabbitMQ BasketCheckout event queue with using MassTransit-RabbitMQ Configuration
  • SqlServer database connection and containerization
  • Using Entity Framework Core ORM and auto migrate to SqlServer when application startup

API Gateway Ocelot Microservice

  • Implement API Gateways with Ocelot
  • Sample microservices/containers to reroute through the API Gateways
  • Run multiple different API Gateway/BFF container types
  • The Gateway aggregation pattern in Shopping.Aggregator

WebUI ShoppingApp Microservice

  • ASP.NET Core Web Application with Bootstrap 4 and Razor template
  • Call Ocelot APIs with HttpClientFactory and Polly

Microservices Cross-Cutting Implementations

  • Implementing Centralized Distributed Logging with Elastic Stack (ELK); Elasticsearch, Logstash, Kibana and SeriLog for Microservices
  • Use the HealthChecks feature in back-end ASP.NET microservices
  • Using Watchdog in separate service that can watch health and load across services, and report health about the microservices by querying with the HealthChecks

Microservices Resilience Implementations

  • Making Microservices more resilient Use IHttpClientFactory to implement resilient HTTP requests
  • Implement Retry and Circuit Breaker patterns with exponential backoff with IHttpClientFactory and Polly policies

Ancillary Containers

  • Use Portainer for Container lightweight management UI which allows you to easily manage your different Docker environments
  • pgAdmin PostgreSQL Tools feature rich Open Source administration and development platform for PostgreSQL

Docker Compose establishment with all microservices on docker;

  • Containerization of microservices
  • Containerization of databases
  • Override Environment variables

What you'll learn

  • ASPNET Core Web API Development of Microservices
  • REST API Principles, CRUD Operations
  • Mongo DB and Redis NoSQL Database Connection on Docker
  • Entity Framework Core with SQL Server Database Connection on Docker
  • N-Layer implementation with Repository Pattern
  • Swagger Open API implementation
  • Consume Discount Grpc Service for inter-service sync communication to calculate product final price
  • Publish BasketCheckout Queue with using MassTransit and RabbitMQ
  • Build a Highly Performant inter-service gRPC Communication with Basket Microservice
  • Using Dapper for micro-orm implementation to simplify data access and ensure high performance
  • PostgreSQL database connection and containerization
  • Async Microservices Communication with RabbitMQ Message-Broker Service
  • Using RabbitMQ Publish/Subscribe Topic Exchange Model
  • Using MassTransit for abstraction over RabbitMQ Message-Broker system
  • Implementing DDD, CQRS, and Clean Architecture with using Best Practices
  • Developing CQRS with using MediatR, FluentValidation and AutoMapper packages
  • Consuming RabbitMQ BasketCheckout event queue with using MassTransit-RabbitMQ Configuration
  • Using Entity Framework Core ORM and auto migrate to SqlServer when application startup
  • Ocelot API Gateway Development of Microservices
  • Call Ocelot APIs with HttpClientFactory
  • The Gateway aggregation pattern in Shopping Aggregator
  • ASPNET Core Web Application with Bootstrap 4 and Razor template
  • Docker Compose Containerization of All Microservices
  • Use Portainer for Container lightweight management UI which allows you to easily manage your different Docker environments
  • pgAdmin PostgreSQL Tools feature rich Open Source administration and development platform for PostgreSQL

Microservice Architecture

May 5, 2020 14:22

IT Architecture (edit)

Microservice Architecture

https://callistaenterprise.se/

https://callistaenterprise.se/english/

Microservice Architecture

https://callistaenterprise.se/blogg/

https://callistaenterprise.se/erbjudanden/cloud-microservices/

OAuth & OIDC

https://callistaenterprise.se/assets/presentationer/cadec-2020-oauth.pdf

Author: https://www.linkedin.com/in/andreastell/

Microservice Architecture and Design Patterns for Microservices

https://medium.com/@madhukaudantha/microservice-architecture-and-design-patterns-for-microservices-e0e5013fd58a

Microservices

May 4, 2019 11:17

Microservices (edit)

Google Drive

https://drive.google.com/drive/u/0/folders/1uDAm6JhOebJKG7EBsyfdZUumIxZccKSp

Việc chuyển sang microservices sẽ giúp việc phát triển ứng dụng nhanh hơn và dễ quản lý hơn, yêu cầu ít nhân lực hơn để triển khai nhiều tính năng mới hơn. Các thay đổi có thể được thực hiện và triển khai nhanh hơn và dễ dàng hơn. Ứng dụng được thiết kế như một tập các microservices dễ dàng chạy trên nhiều máy chủ với cân bằng tải (load balancing), giúp dễ dàng xử lý các yêu cầu tăng đột biến và nhu cầu tăng theo thời gian, đồng thời giảm thời gian chết (downtime) do các vấn đề về phần cứng hoặc phần mềm.

Microservices là một phần quan trọng trong các tiến bộ đang thay đổi cách chúng ta làm việc ngày nay. Các kỹ thuật Agile software development, chuyển các ứng dụng lên cloud, văn hóa DevOps, tích hợp liên tục và triển khai liên tục (CI / CD), và việc sử dụng containers đều được sử dụng cùng với microservices để tạo nên cuộc cách mạng hóa trong phát triển và phân phối ứng dụng

Nội dung chính trong phần lý thuyết bao gồm:

  1. Giới thiệu về Microservices – giới thiệu rõ ràng và đơn giản về microservices, từ khái niệm đến thực tế cách các microservices được triển khai và duy trì
  2. API Gateway – API Gateway là điểm đầu vào duy nhất cho toàn bộ ứng dụng dựa trên microservices
  3. Inter-process Communication – Một khi bạn tách một ứng dụng nguyên khối thành từng phần riêng biệt – các microservices – khi đó các service cần nói chuyện với nhau. Và có nhiều lựa chọn giao tiếp giữa các process, điển hình như REST.
  4. Service Discovery – Khi các service đang chạy trong một môi trường động, việc tìm kiếm chúng khi cần không phải là vấn đề đơn giản. Cùng xem cách giải quyết vấn đề đó trong bài này nhé.
  5. Event-Driven Data Management – Thay vì chia sẻ một database toàn cục (hoặc hai) trên một ứng dụng nguyên khối, mỗi microservice sẽ tự biểu diễn và lưu trữ dữ liệu riêng của nó. Điều này mang đến sự linh hoạt tuyệt vời, nhưng cũng có thể gây ra sự phức tạp.
  6. Chiến lược triển khai (Deployment Strategy) cho Microservices – Trong thế giới DevOps, cách bạn làm mọi thứ cũng quan trọng như những gì bạn đặt ra để làm ngay từ đầu. Chris mô tả những patterns chính cho việc triển khai microservices để có thể đưa ra lựa chọn sáng suốt cho bạn
  7. Tái cấu trúc Monolith sang Microservices – Trong một thế giới hoàn hảo, chúng ta sẽ luôn có được thời gian và tiền bạc để thay đổi, cập nhật phần mềm với các công nghệ, công cụ và phương pháp mới nhất và tốt nhất. Nhưng trong bài viết này, Chris sẽ trình bày một chiến lược để làm điều này một cách hợp lý cho việc chuyển đổi từ Monolith sang Microservices. Một … mảnh … nhỏ … tại … một … thời điểm.

A Kubernetes-based microservices application on service mesh

https://github.com/vietnam-devs/coolstore-microservices

https://vietnam-devs.github.io/coolstore-microservices/

Microservice Design Patterns

 

Microservices Patterns IO

https://www.oreilly.com/library/view/monolith-to-microservices/9781492047834/

https://www.oreilly.com/programming/free/files/microservices-antipatterns-and-pitfalls.pdf (eBook)

https://www.kislayverma.com/amp/code-review-checklist-for-distributed-systems (Check List)

https://www.nginx.com/resources/library/monolith-to-microservices/

https://microservices.io/patterns/microservices.html

https://microservices.io/refactoring/

https://github.com/microservices-patterns/ftgo-monolith

You’ll learn several tried and tested patterns and techniques that you can use as you migrate your existing architecture.

  • Ideal for organizations looking to transition to microservices, rather than rebuild
  • Helps companies determine whether to migrate, when to migrate, and where to begin
  • Addresses communication, integration, and the migration of legacy systems
  • Discusses multiple migration patterns and where they apply
  • Provides database migration examples, along with synchronization strategies
  • Explores application decomposition, including several architectural refactoring patterns
  • Delves into details of database decomposition, including the impact of breaking referential and transactional integrity, new failure modes, and more

Dev Mentors

https://github.com/devmentors

https://www.youtube.com/watch?v=6YYB8vv3pZg&list=PLqqD43D6Mqz38LoZEuo_hJAp2NxXskcut&index=1

Building microservices on Azure - https://docs.microsoft.com/en-us/azure/architecture/microservices/

Microservices architecture on Azure Kubernetes Service (AKS) - https://docs.microsoft.com/en-us/azure/architecture/reference-architectures/microservices/aks

Microservices with AKS - https://docs.microsoft.com/en-us/azure/architecture/solution-ideas/articles/microservices-with-aks

Blog Series - Building Microservices

https://callistaenterprise.se/blogg/teknik/2015/05/20/blog-series-building-microservices/

https://edwardthienhoang.wordpress.com/microservices-tu-thiet-ke-den-trien-khai-phan-mo-dau/

Pollyhttps://github.com/App-vNext/Polly

Microservices implementation — Netflix stack

https://medium.com/@tharanganilupul/microservices-implementation-netflix-stack-ba4f4a57a79f

Microservices: The SAGA Pattern for distributed transactions

https://medium.com/@ijayakantha/microservices-the-saga-pattern-for-distributed-transactions-c489d0ac0247

What is dapr?

https://dev.to/arschles/what-is-dapr-526a

Distributed .NET Core (DShop) - Episode 1 [Intro, HTTP requests flow, Infrastructure with Docker]

https://www.youtube.com/watch?v=s4fd3PRlOcw

Distributed .NET Core (DShop) - Episode 2 [CQRS - Write side, Discounts service, MongoDB repository]

https://www.youtube.com/watch?v=yqh0dN4oDTs

Distributed .NET Core (DShop) - Episode 3 [Subscribing RabbitMQ messages, API gateway]

https://www.youtube.com/watch?v=L9UUUPedidg

Distributed .NET Core (DShop) - Episode 4 [Asynchronous microservices integration via events]

https://www.youtube.com/watch?v=KiIetmswEos

Distributed .NET Core (DShop) - Episode 5 [CQRS - Read side, Internal HTTP communication]

https://www.youtube.com/watch?v=o0fMHARUwq0

Distributed .NET Core (DShop) - Episode 6 [Service discovery & Load balancing with Consul + Fabio]

https://www.youtube.com/watch?v=UWfn8Iml2Kc

Distributed .NET Core (DShop) - Episode 7 [Handling asynchronous requests, SignalR, Polly]

https://www.youtube.com/watch?v=rKmL2Onh4hg

Distributed .NET Core (DShop) - Episode 8 [Distributed transactions, 2PC, Event Choreography, Saga]

https://www.youtube.com/watch?v=KI223ULIFoA

Distributed .NET Core (DShop) - Episode 9 [Vault secrets, Seq logging, Jaeger distributed tracing]

https://www.youtube.com/watch?v=8bDHf7yiNKM

Distributed .NET Core (DShop) - Episode 10 [Metrics with AppMetrics, InfluxDB, Prometheus, Grafana]

https://www.youtube.com/watch?v=2OiE-h9sNM4

Distributed .NET Core (DShop) - Episode 11 [Travis CI pipelines, custom MyGet feeds]

https://www.youtube.com/watch?v=sS9yB7m_OsQ

Distributed .NET Core (DShop) - Episode 12 [Docker basics, Docker Hub, docker-compose]

https://www.youtube.com/watch?v=drD0vgKecAc

Distributed .NET Core (DShop) - Episode 13 [Integration tests with xUnit, Web API, Mongo, RabbitMQ]

https://www.youtube.com/watch?v=fDe_Neayo9I

Distributed .NET Core (DShop) - Episode 14 [Consumer-driven contract testing with Pact]

https://www.youtube.com/watch?v=qRCY5BTYQk0

Distributed .NET Core (DShop) - Episode 15 [Orchestration with Portainer, Kubernetes and Rancher]

https://www.youtube.com/watch?v=YxvB6-6FSZE

Building a CI/CD pipeline for a containerized Asp.Net Core 3.0 Web API

https://www.youtube.com/watch?v=nsG3xbIoeJo

ElasticSearch on Windows 10 and .NET Core

https://www.youtube.com/watch?v=Z98Nz7O6vzs

Elasticsearch for Dot Net Developers - Dot Net Sheff - October 2018

https://www.youtube.com/watch?v=N83oReGA6vc

Introduction to Microservices, Docker, and Kubernetes

https://www.youtube.com/watch?v=1xo-0gCVhTU

Building Event-Driven Microservices with Event Sourcing and CQRS - Lidan Hifi

https://www.youtube.com/watch?v=XWTrcBqXi6s

When Microservices Meet Event Sourcing

https://www.youtube.com/watch?v=cISNDnwlSgw

Greg Young — A Decade of DDD, CQRS, Event Sourcing

https://www.youtube.com/watch?v=LDW0QWie21s

https://callistaenterprise.se/blogg/teknik/2015/04/10/building-microservices-with-spring-cloud-and-netflix-oss-part-1/

https://callistaenterprise.se/blogg/teknik/2015/04/15/building-microservices-with-spring-cloud-and-netflix-oss-part-2/

https://callistaenterprise.se/blogg/teknik/2015/04/27/building-microservices-part-3-secure-APIs-with-OAuth/

ASP.NET Core Full Stack

https://fullstackmark.com/post/21/user-authentication-and-identity-with-angular-aspnet-core-and-identityserver

https://ndccopenhagen.com/workshop/identity-access-control-for-modern-applications-and-apis-using-asp-net-core-2/

Data Transfer Objects (DTOs)

https://docs.microsoft.com/en-us/aspnet/web-api/overview/data/using-web-api-with-entity-framework/part-5

ASP.NET MVC 5

https://nhatkyhoctap.blogspot.com/2012/08/aspnet-mvc-co-ban-ve-validation.html

https://nhatkyhoctap.blogspot.com/2013/03/su-dung-dependency-injection-trong.html

https://nhatkyhoctap.blogspot.com/2013/10/aspnet-mvc-authentication-va-authorize.html

ASP.NET Core Identity

https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity?view=aspnetcore-2.2&tabs=visual-studio

Microservices security with OAuth2

https://piotrminkowski.wordpress.com/2017/12/01/part-2-microservices-security-with-oauth2/

Microservices security with Oauth2 (https://piotrminkowski.wordpress.com/2017/02/22/microservices-security-with-oauth2/)

Advanced Microservices Security with OAuth2 (https://piotrminkowski.wordpress.com/2017/03/30/advanced-microservices-security-with-oauth2/)

ASP.NET Membership > Asp.net Simple Membership> ASP.NET Identity

https://coding4food.net/2017/08/30/aspnet-identity-1-introduction/

OAuth và OpenID

https://www.codehub.vn/OpenID-va-OAuth-Khac-Nhau-Nhu-The-Nao

Đăng nhập & Phân quyền

ASP.NET

Free. Cross-platform. Open source. A framework for building web apps and services with .NET and C#.

ASP.NET Identity

The ASP.NET membership system was introduced with ASP.NET 2.0 back in 2005, and since then there have been many changes in the ways web applications typically handle authentication and authorization. ASP.NET Identity is a fresh look at what the membership system should be when you are building modern applications for the web, phone, or tablet.

ASP.NET Membership was designed to solve site membership requirements that were common in 2005, which involved Forms Authentication, and a SQL Server database for user names, passwords, and profile data. Today there is a much broader array of data storage options for web applications, and most developers want to enable their sites to use social identity providers for authentication and authorization functionality. The limitations of ASP.NET Membership's design make this transition difficult:

  • The database schema was designed for SQL Server and you can't change it. You can add profile information, but the additional data is packed into a different table, which makes it difficult to access by any means except through the Profile Provider API.
  • The provider system enables you to change the backing data store, but the system is designed around assumptions appropriate for a relational database. You can write a provider to store membership information in a non-relational storage mechanism, such as Azure Storage Tables, but then you have to work around the relational design by writing much code and a lot of System.NotImplementedExceptionexceptions for methods that don't apply to NoSQL databases.
  • Since the log-in/log-out functionality is based on Forms Authentication, the membership system can't use OWIN. OWIN includes middleware components for authentication, including support for log-ins using external identity providers (like Microsoft Accounts, Facebook, Google, Twitter), and log-ins using organizational accounts from on-premises Active Directory or Azure Active Directory. OWIN also includes support for OAuth 2.0, JWT and CORS.

https://docs.microsoft.com/en-us/aspnet/identity/overview/

ASP.NET Core

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.

ASP.NET Core Identity

ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data.

Basically, you have two scenarios:

  • Either you're using ASP.NET Core, in which case you'll have to use Microsoft.AspNetCore.Identity.
  • Or you're using an ASP.NET version before ASP.NET Core, and you'll have to use Microsoft.AspNet.Identity.Core.

https://weblogs.asp.net/jeff/no-you-don-t-need-to-use-asp-net-identity

https://docs.microsoft.com/en-us/aspnet/core/security/authentication/cookie?view=aspnetcore-2.2

https://andrewlock.net/introduction-to-authentication-with-asp-net-core/

.NET Developer và một số yêu cầu tuyển dụng

Cơ bản về lập trình OOP

Đây là điều bắt buộc các bạn phải biết trong khi đi phỏng vấn, các bạn không nắm vững cái này thì sẽ có khả năng cao là bị loại vì đây là những kiến thức hết sức căn bản. Để nắm chắc OOP tức là lập trình hướng đối tượng, các bạn cần nắm chắc khái niệm và các tính chất của nó (có 4 tính chất). Mỗi tính chất cac bạn phải hiểu và lấy ví dụ được đồng thời các bạn cũng phải nêu ra được tác dụng của nó.

Ngôn ngữ lập trình C#

Về ngôn ngữ lập trình C#, các bạn không cần thiết phải cái gì cũng biết nhưng một số điểm các bạn nên biết về Interface và Abstract class hay hiểu biết về các collection trong C#.NET. Ngoài ra các bạn cũng cần hiểu về đa luồng, extension methods, delegate, xử lý bất đồng bộ, overriding method, và tổng quan các thư viện hay dùng nhất.

ASP.NET MVC và WebAPI

Về ASP.NET MVC các bạn cần nắm rõ mô hình MVC là gì? Trong ASP.NET MVC có các thành phần gì? Cách truyền dữ liệu từ Controller về View có những cách nào? ViewBag, ViewData, TempData và  Session? Sự khác nhau giữa chúng như thế nào? Khi nào thì dùng cái nào?

Ngoài ra có cơ chế Routing, ASP.NET Identity, Antiforeign, WebAPI, kiến thức về REST và Restful API…

Entity Framework và ADO.NET

Câu hỏi hay hỏi nhất trong khi phỏng vấn .NET Developer là bạn đã làm việc với Entity Framework chưa? Có những cách làm việc nào? Vậy là các bạn phải trả lời được có 3 cách là DB First, Code First và Model First. Vậy là các bạn phải nêu được ưu nhược điểm của cả 3. Thường là DB First và Code First sẽ được hỏi nhiều nhất.

Một trong những câu hỏi hay được hỏi nhất về Entity Framework sẽ là phần Migration nếu bạn trả lời hay dùng Code First. Còn lại DB First thì các bạn cũng sẽ được hỏi những nội dung còn lại ngoài phần migration đó là phải hiểu về Linq to Entity tức là khi nào dữ liệu của bạn được load ra, dùng Iqueryable ra sao? Cách tối ưu hóa câu lệnh LinQ khi truy vấn database rồi cách phân trang bản ghi với LINQ.

Ngoài ra các bạn cần nắm được cách debug từ LINQ bản chất là gen ra câu lệnh SQL để execute trong SQL Server nên các bạn cần nắm được cách thức để debug, tracing và tối ưu hóa nó.

Đôi khi các dự án có làm ADO.NET có thể là call các store procedure trong SQL Server vì giờ không ai viết câu lệnh raw SQL trong code cả

Kỹ năng Unit Test

Đây là kỹ năng viết các đoạn code để kiểm thử ở mức đơn vị đối với các function code ra, trong .NET các bạn thường sử dụng MSUnit có sẵn của Visual Studio hoặc Nunit để viết các đoạn mã kiểm thử. Kỹ năng này không bắt buộc nhưng là điểm cộng của các bạn.

SQL Server

Về SQL Server ngoài việc viết lệnh CRUD thì các bạn còn phải tìm hiểu về Store Procedure, Triggers, Funtions, View đồng thời quan  trọng hơn là cách viết lệnh tối ưu, đánh index để tăng tốc độ cho câu lệnh.

Kỹ năng quản lý source code

Các bạn cần có kỹ năng quản lý source code khi làm việc với các SCM như Git hay SVN, TFS…để giúp làm việc nhanh và hiệu quả hơn.

Một số Design Pattern

Các bạn làm dev có thể không phải sử dụng nhiều vì các SA họ đã áp dụng đối với core của công ty nhưng các bạn nên biết để hiểu và tốt cho việc phát triển sự nghiệp của mình. Hơn nữa lên senior thì phải biết Design Pattern chứ nhỉ.

Principles

Các bạn cũng phải biết một số principle tiêu biểu là SOLID.

Kiến thức Frontend (Javascript, Jquery, Html, CSS, Angular ...)

Các bạn biết các kiến thức này mặc dù không phải là .NET nhưng nếu một công ty họ tuyển Fullstack developer thì những điều này giúp bạn tăng giá trị trong mắt nhà tuyển dụng.

Cách viết code sạch và tối ưu hóa code

Cách viết code sạch và tối ưu này mình rất coi trọng vì nếu các bạn làm junior hay senior thì việc các bạn viết Code nói lên chất lượng thực sự của các bạn. Kỹ năng này bao gồm việc đặt tên biến, tên hàm, class, cách viết code sao cho dễ đọc dễ maintenance …Giúp việc sử dụng lại code dễ dàng hơn nhất là khi các bạn làm một sản phẩm lâu dài thì nó lại càng hữu ích. Đây là một kỹ năng rất cần thiết và rất được các bậc tiền bối coi trọng.

Tóm lại

Là một .NET developer không chỉ biết code tốt, mà cần các kỹ năng liên quan nữa như thế mới thực sự có value. Hơn nữa code  tốt không bằng thái độ tốt, nhiều khi kỹ năng của bạn chưa được như người ta mong muốn nhưng thái độ của bạn khi phỏng vấn cũng làm người ta thấy mình có tiềm năng phát triển và có thể đáp ứng được công việc. Kể cả khi mình giỏi thật thì thái độ cũng phải khiêm tốn và cầu thị vì không ai giỏi tất cả. Cuối cùng là tư duy về sản phẩm, một developer giỏi không phải chỉ giỏi kỹ thuật mà phải hiểu khách hàng cần gì cũng đừng giới hạn mình theo những gì mình nói trong bài viết này mà phải mở rộng hơn nữa? Làm khách hàng hài lòng và làm sao để lợi cho khách hàng, lợi cho người thuê mình tức là lợi cho chính mình.

ban-can-chuan-bi-nhung-gi-truoc-khi-di-phong-van-vi-tri-net-developer-01

Categories

Recent posts