没有合适的资源?快使用搜索试试~ 我知道了~
首页实战指南:ASP.NET微服务向ASP.NET Core迁移
《将ASP.NET微服务迁移到ASP.NET Core:实例教程》是一本由Iris Classon撰写的专业书籍,它旨在为实际迁移ASP.NET框架到最新的ASP.NET Core提供一个现实世界的案例分析。作者通过清晰、易于理解的步骤,展示了一个从旧版ASP.NET向ASP.NET Core迁移的完整过程,特别关注于微服务架构。 本书并非全面介绍ASP.NET Core的权威指南,因为市面上已有众多优秀的资源涵盖这一主题,但它弥补了在决定是否迁移时所需的关键信息空白。书中详细探讨了迁移选项、如何进行评估与准备,包括分析现有的系统结构、性能需求和潜在问题。接着,作者指导读者如何执行迁移操作,确保平稳过渡,并在迁移后维护这些Web服务的稳定性和效率。 书中的内容不仅包括理论指导,还包含丰富的实践案例,提供了在迁移过程中可能遇到的问题及其解决方案,使读者能够更好地理解和处理迁移过程中的挑战。此外,作者还精心挑选了一整套实用的资源和工具列表,帮助读者在迁移过程中节省时间并提高效率。 对于那些正在考虑或已经在进行ASP.NET微服务迁移的开发人员来说,《将ASP.NET微服务迁移到ASP.NET Core:实例教程》是一本不可或缺的参考书。它旨在解答大部分关于迁移的技术疑问,让开发者能够专注于构建卓越的软件,无论是基于ASP.NET Core还是其他技术栈。版权信息表明,所有内容受法律保护,未经许可不得复制或以任何形式进行商业或非商业用途。书中提到的商标、标志和图像均尊重知识产权,仅在编辑性使用中为商标所有者带来益处。
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/11643805/bg10.jpg)
xx
Core andMore
As I see it, there were two major driving forces that led to what we today
know as .NET Core. Firstly, there was an increasing need for cross- platform
compatibility to stay relevant, and secondly, we had gotten to a place where
we had too many subsets of the .NET Framework, which was causing all
sorts of problems as the subsets were created and maintained by different
teams. 2014 was the year many exciting announcements were made by
Microsoft. ASP.NET vNext was announced in April, and .NET Core in
November the same year. .NET Core was a fork and open source rewrite of
.NET, and likewise ASP.NET vNext was a complete rewrite of ASP.NET.It
was later known as ASP.NET 5 (and by some as project K), until Microsoft
realized the name was confusing and renamed it to ASP.NET Core.
In 2016, the .NET Standard was introduced to us, as a way to bring
everything together. .NET Standard is a specification; it defines a set of
available .NET APIs. You can think of it as interfaces and the frameworks
that support the (or version of) .NET Standard as implementations. If you
ever had the pleasure of working with Portable Class Libraries (PCL) and
the framework union model they used, you’ll be pleased to hear that .NET
Standard will replace PCLs.
To sum up, ASP.NET Core is the next step in the web development
evolution, an evolution that goes back more than 30 years. During that time a
lot has happened; tools and frameworks have been developed and matured.
The goal has always been to make it easier for us as developers to create
performant, flexible, yet sturdy services that allow freedom in terms of how
we communicate over the network and serve our content. ASP.NET Core puts
together some of the last missing pieces in terms of combining the power of
other frameworks while giving us the flexibility to choose the operating system
best suited for our service and optimal performance all while encouraging
best practices. You might not decide to migrate after reading this book or
doing the suggested analysis, but the information will be valuable nonetheless
as ASP.NET Core is the future of web development with the Microsoft stack.
InTroduCTIonInTroduCTIon
![](https://csdnimg.cn/release/download_crawler_static/11643805/bg11.jpg)
1
© Iris Classon 2019
I. Classon, Migrating ASP.NET Microservices to ASP.NET Core,
https://doi.org/10.1007/978-1-4842-4327-5_1
CHAPTER 1
The SaaS System
inQuestion
I never pictured myself working at a startup. For as long as I’ve been
working as a developer, it has mostly been consulting gigs, and to me a
startup meant unreasonable working hours, low pay, a bunch of hipsters
arguing over what toys and games to stock in the conference room, plus
little to no stability. But, never say never, especially in the tech world.
One evening, I joined a friend of mine for a late-night coding session
with his business partner Johan (also a developer). They were battling
performance problems and bugs into the wee hours of the morning.
One evening turned into several weekends in a row, complete with the pick
and mix candy (a Swedish specialty), more caffeine than anyone should
consume, and raucous music pouring out from the speakers.
We coded tirelessly in that office overlooking the city center, and I ended
up offering to help profile the services they were experiencing problems
with. The services were ASP.NET services with significant performance
and memory use problems. At that time, the answer to the problem was
to create a local, on-prem solution for each customer. Each customer had
a local installation, not a big deal, as there were only two customers. But,
understanding that their client list was growing, I think we all recognized
the value of taking the system to the cloud to make a multitenant solution.
The partners chose Azure, an excellent choice I thought, as I had a decent
amount of experience with Azure and had been impressed. Then the
![](https://csdnimg.cn/release/download_crawler_static/11643805/bg12.jpg)
2
elephant entered the room, how do we make the shift from on-prem to
multitenant? Doesn’t this mean a lot of rewriting and reworking of code?
What about all the features and bug fixes we had promised our current and
prospective clients? I could see this was daunting to all involved, but I also
recognized it as a great opportunity. In no time, I found myself working
full days with complete access and rights to all their Azure accounts and
servers. Long story short, I signed a contract and was now officially part of
a startup.
You might be wondering why I’m telling you all this. The backstory
ends at the point when we started migrating, a great starting point to share
with you my experience, advice, shortcuts, and hard-earned lessons. So,
let’s get started.
We will begin our journey by learning what the system does, its parts,
and how it all comes together. Throughout this book, I will use a ton of
example code. I want to keep everything as authentic as possible, and
therefore the services and code you will see will be actual working code
from our system (with minor modifications to protect the innocent) and
yes, the good, the bad, and the ugly. My goal is to provide you with a
realistic scenario to work from, and something transferable and relevant to
what you are working on.
Installation Requirements
Although you can run ASP.NET Core on Linux and use, for example, Visual
Studio Code as your editor, I’ve chosen to use Visual Studio Community
Edition (free) on Windows to leverage some additional tools and
extensions that will simplify the migration. These tools only simplify the
migration, and the vital steps of the migration are not dependent upon the
tools, and alternative ways will be covered in this book.
Chapter 1 the SaaS SyStem inQueStion
![](https://csdnimg.cn/release/download_crawler_static/11643805/bg13.jpg)
3
Requirements for a migration using the steps described in the book:
• Windows 10
• Visual Studio Community Edition 2017 (free)
• .NET Core SDK (latest or the version you are targeting)
Additional requirements for running the examples in the book:
• IIS 7 or later
• Git and Git Bash
• SQL Server Express 2016
Multitenant Software asaService (SaaS)
The system itself is, as I mentioned, a multitenant solution. It’s a SaaS
system (Software as a Service), which means it has a cloud computing
service model where the system is centrally hosted. The clients, whom we
refer to as tenants, do not have to manage or control the infrastructure.
That is unless they choose, or rather insist on, an on-premise installation
(we have some government institutions that for legal reasons cannot use
the cloud solution). The tenants are merely consumers of the applications,
and while it feels like they have each their own dedicated cloud installation
of our system, they are using the same applications and services. We get
the benefit of not having to manage x-number of infrastructure setups
and discuss hardware and software requirements and licenses, support
becomes more manageable, and we can roll out patches and updates
as we please. There is also a significant financial gain to this, which is
another important factor. But, the challenges are plenty. Data security
is an obvious challenge, and so is uptime. We have SLAs (Service Level
Agreements) toward our tenants, but we also have SLAs with our cloud
vendor and the services we use there. One of our biggest challenges, and
Chapter 1 the SaaS SyStem inQueStion
![](https://csdnimg.cn/release/download_crawler_static/11643805/bg14.jpg)
4
a very common one for SaaS solutions, is load, latency, and performance.
Load is uncertain and very difficult to predict. And the performance issues
we were seeing in the on-premise implementations significantly increased
when we adopted the cloud model. Why? We work with data, a lot of it.
What theSystem Does
Konstrukt is a planning platform designed to handle different types of
planning scenarios for all kind of organizations.
Any quantitative planning and data consolidation, simple or complex,
can be managed in a secure and user-friendly way, replacing the misuse
of Excel in many organizations. The system is flexible and covers a wide
range of planning scenarios such as strategic planning, rolling forecasting,
data-driven budgeting, workforce capacity planning, compensation and
equity planning, and so on. It probably doesn’t come as a surprise that the
system has a great deal of complexity, and a reoccurring challenge we have
is performance. I’ll get back to this in the next chapter where we discuss
the pros and cons of doing a migration.
Architecture
Konstrukt consists of nine ASP.NET Web API services and one stateless
and decoupled client written in JavaScript, HTML, and CSS (Figure1-1).
Each tenant has their own database, and we currently only use SQL Server
for our databases. The majority of the services share the same databases
on the same server cluster, some separated by schemas, and we also have
NoSQL databases (MongoDB) used by some services. Deceptively this
makes it look like we have a true microservice architecture, but we don’t.
We have a mix of microservices and what I often refer to as a distributed
monolith. A distributed monolith is a system deployed as several
small services that resemble microservices that are fairly well scoped
Chapter 1 the SaaS SyStem inQueStion
剩余162页未读,继续阅读
![application/octet-stream](https://img-home.csdnimg.cn/images/20210720083646.png)
![epub](https://img-home.csdnimg.cn/images/20210720083646.png)
![epub](https://img-home.csdnimg.cn/images/20210720083646.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/default.jpg!1)
jonny_zhang
- 粉丝: 2
- 资源: 29
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- Vue实现iOS原生Picker组件:详细解析与实现思路
- Arduino蓝牙小车:参数调试与功能控制
- 百度Java面试精华:200页精选资源涵盖核心知识点
- Swift使用CoreData填坑指南:CoreData在Swift 3.0的变化
- 微距离无线充电器创新设计及其实验探索
- MTK Android平台开发全攻略:44步详解流程
- RecyclerView全面解析:替代ListView的新选择
- Android开发:自动适配中英文键盘解决方案
- Android调用WebService接口教程
- Android开发:BitmapUtil图片处理全解析与实例
- Android多线程断点续传实现详解
- PCA算法在人脸识别会议签到系统中的应用
- EventBus 3.0:Android事件总线详解与实战应用
- Android FileUtil:全面解析文件操作实用技巧与实例
- RecyclerView添加头部和尾部实战教程
- Android实现微博滑动固定顶部栏实战与优化
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)