前言
以前都是自己做一些玩具项目,技术选型肯定没有考虑那么多,学习阶段往往是要学什么技术,因此用什么技术,在专门为了准备面试的时候可能会去细心雕模一下这个项目,但是没有实际的工程背景,可能大多数也是平地建高楼。在实际的工程阶段,我也好奇项目的负责人是从什么维度进行技术选型的,正好之前在吃饭时候跟我leader聊到了这个话题,因此写篇博客记录一下。
技术列表
首先说一下我们这个项目的技术选型吧。因为我们主要做的是一个业务中台的系统(B/S架构),简单理解就是一个网站,因此选用的技术就是我们日常会学习到的一些技术。
前端:
- 微前端框架qiankun:介绍 - qiankun (umijs.org)
- 公司自研框架:基于vue的封装,类似于umi?
- 公司内部组件库
- 公司内部打包工具:基于webpack的封装
后端:
- 语言:python
- 框架:flask
- ORM:peewee
- 流程引擎:airflow
- 数据库:mysql
- 消息队列:kafaka
- RPC:grpc
其他:
CI/CD:这个忘记了没有深究怎么实现的,流程就是docker打一个镜像然后去内部发布平台发布
外部接口:企微、openai、其他外部系统接口
还有就是其他的nginx网关,基本都用这个,就不再赘述了
选型思想
前端
-
为什么使用微前端框架
当时因为刚进公司不久,真的对这个微前端框架和公司自研的那个非常不熟悉,配置都不知道在哪配,就问了句为什么不使用vue呢?直接纯vue多好,还要用这个微前端框架,我leader给出我的答复是我们因为要兼容老平台,新老平台迁移的时候要把老平台作为一个服务,点击tab栏可以切换,说实话没太懂,兼容的话设置一个超链接跳转过去也可以啊。我的思考点是如果设置一个超链接跳转就意味着分开部署,肯定没有作为某个服务好部署并且在逻辑上也说的通
-
组件库、打包工具的选择
又问了下为啥用公司这个组件库,我还以为是规范统一要求的,结果我leader说了句我当时就知道公司有这个就用了(剧本不是这个!!),其实我们也可以用外部的比如element-plus、ant design、arco design这种,哈哈,小知识get,居然可以用友商开源的组件库。打包工具这个没仔细问,但是我是真的webpack一生黑,每次ci一下都得好久,看博客说因为webpack稳定,但是让我选我肯定选vite。
后端
-
语言和框架
为啥用python语言这个也让我很纠结,因为公司主力是Java,再加上我主要方向还是Java对这个也有一定的好感度。后来leader给出的解释是因为我们这个不会涉及到复杂的业务逻辑,使用python可以增加开发效率,Java的话开发效率有点慢(我觉着用mp写CRUD也挺快的啊),框架就没问,但是一共就两个,第一个Django、第二个Flask,选用flask应该是更轻量的原因吧。
-
ORM框架和MySQL
这个peewee是全自动ORM框架,类似于mp,这个当时聊到说我leader去看了github的issues区看到peewee的作者坚持不给这个框架加上自动校验参数类型这个功能,因为作者是老古董坚持认为需要类型就不要写python哈哈,啥时候我能对技术有这么高的执念,真的很喜欢这种geek范。
还有一次聊天时候因为我看到提交历史我leader怎么之前周六周日天天commit,我就问了句都不休息的吗哈哈,然后聊到因为我们这个项目新开的时候当时有时间限制,如果在指定日期之前没有搭建出新项目框架就只能去维护老平台的Go的代码了(确实维护老平台跟开一个新项目开发体验不是一个量级的~),然后我leader周六周日在家commit,时间紧任务重这个ORM框架就没有太深入调研,准备开新项目时候把这个换掉。
MySQL就不用说了,使用率接近100%,其实公司也有一些自研的数据库,这里为了脱敏就不过多阐述了
-
airflow、kafka和gRPC
airflow就是一个流程编排引擎嘛,最近写一个需求的时候才用到,但是中台系统应该都会用到这种技术,以前在组件库天天看到有这个流程,当时还好奇这玩意儿的应用场景,今天我就看到了,选择的原因就是apache 顶级项目知名度高有保障。(我猜的)
kafka是处理平台大数据量的消息队列,跟这个场景完美契合了只能说。
grpc是远程调一些外部系统的接口的,那些外部系统是用Go写的,当然有些其他RPC也能调,但是我一个没用过Go的都知道这个RPC,知名度应该是稳稳的
还有其他的比如clickhouse自己不太了解这里我就不班门弄斧了
总结
当然一次聊天肯定不能囊括所有项目,技术选型要考虑的因素也不止上面说的,还有成本、可维护性、合规性等等等等
最后发现其实之前在B站学习的技术是完完全全可以应用在实际的工程项目中的,但是你涉猎的内容需要足够的广泛,比如虽然我主要是Java,但是我前端Vue和React都写,Python平时也写一些爬虫,常见的中间件也是有了解的。在公司里面往往是先有这个场景,然后应用技术去解决这个问题,其实越写到后面越可以发现,语言,框架,技术都是可以变的,唯一不变的是业务思想。
就比如我们在考试的时候,你需要纠结是苹果计算器还是安卓计算器好用吗(手动doge),我们要做的最关键问题是想出如何解决这道问题的步骤,然后使用一个趁手的计算器去实现它。
文章评论
Hi my loved one I wish to say that this post is amazing nice written and include approximately all vital infos Id like to peer more posts like this
Good day! Do you know if they make any plugins to assist with Search
Engine Optimization? I'm trying to get my website to rank for some targeted keywords but I'm not seeing very good success.
If you know of any please share. Kudos! I saw similar blog here: <a href="https://www.ecobij.nl/contact/">Eco wool</a>
One of many coolest options of the RX-eight is the "freestyle door system," which has eliminated the center pillar (a common theme at this auto present).
<A HREF='https://aishagmgj757362.timeblog.net/64858950/unveiling-the-truth-behind-defender-of-sugar-no-longer-quite-as-sweet'>sugar defender official website</A>
For years, I have actually battled uncertain blood sugar swings that left me really feeling drained pipes and inactive.
Yet considering that incorporating Sugar Defender into my regular, I have
actually observed a significant enhancement in my
general power and security. The dreadful mid-day distant memory,
and I value that this natural remedy attains these outcomes with no undesirable
or unfavorable responses. honestly been a transformative exploration for me.
<a href=https://mollyfmnh223676.look4blog.com/68102658/unveiling-the-truth-behind-defender-of-sugar-the-sweetness-may-be-fading>sugar defender ingredients</a> Incorporating Sugar Defender into my day-to-day regimen has actually been a game-changer for my total well-being.
As a person who already focuses on healthy eating, this supplement has
actually supplied an included increase of security. in my energy degrees, and my desire
for undesirable treats so easy can have such a profound influence on my daily life.
<A HREF='https://aadamadxp450137.blogsumer.com/28698012/unveiling-the-truth-behind-sugar-defender-no-longer-quite-as-sweet'>sugar defender official website</A>
<a href="https://bronterehe918097.blogofchange.com/profile">sugar defender official website</a> Discovering Sugar Defender has
been a game-changer for me, as I have actually always
been vigilant about managing my blood sugar levels.
With this supplement, I feel encouraged to organize my health and wellness, and my latest clinical examinations have actually shown a substantial turn-around.
Having a trustworthy ally in my corner provides me with a sense of
security and confidence, and I'm deeply grateful for the extensive distinction Sugar Defender has made in my wellness.
<a href=https://nicolassdem612346.livebloggs.com/35277238/unveiling-the-truth-behind-defender-of-sugar-the-sweetness-may-be-fading>sugar defender official website</a>
For many years, I have actually battled unforeseeable blood sugar swings that left me feeling drained and
lethargic. Yet since incorporating Sugar Defender right into my regular, I've discovered a substantial
renovation in my general energy and stability.
The dreadful mid-day thing of the past, and I value that this natural solution accomplishes these outcomes with no undesirable
or unfavorable reactions. honestly been a transformative
exploration for me. <a href="https://matteodnqh593672.blogars.com/profile">sugar defender ingredients</a>
<A HREF='https://loribxta495814.bmswiki.com/user'>sugar defender</A> Uncovering Sugar Defender has actually been a game-changer
for me, as I have actually always been vigilant concerning handling
my blood sugar level degrees. I currently really feel equipped
and certain in my ability to maintain healthy degrees, and my latest health checks have
actually mirrored this progress. Having a reliable supplement to complement my a big source of comfort, and
I'm really glad for the significant difference Sugar Protector has made in my total wellness.
<A HREF=https://darrenwphb794218.frewwebs.com/29635809/unveiling-the-truth-behind-defender-of-sugar-the-sweetness-may-be-fading>sugar Defender Reviews</A>
<A HREF='https://zakariafexm521883.slypage.com/29511059/unveiling-the-truth-behind-sugar-defender-no-longer-quite-as-sweet'>sugar defender official website</A> As a person that's always been cautious
about my blood sugar level, finding Sugar Protector has
actually been a relief. I feel so much a lot more in control, and my current exams have shown favorable enhancements.
Recognizing I have a trustworthy supplement to support my regular gives me assurance.
I'm so grateful for Sugar Protector's influence on my wellness!
<a href="https://vinnyztuy995773.blogaritma.com/28683847/unveiling-the-truth-behind-sugar-defender-the-sweetness-may-be-fading">sugar defender</a>
<A HREF="https://sugardefender-en-us.com">sugar defender reviews</A> For several years, I have actually battled unforeseeable blood
glucose swings that left me feeling drained pipes and inactive.
But since including Sugar my energy levels are now steady and constant,
and I no more strike a wall in the afternoons.
I value that it's a mild, all-natural method that doesn't come with any unpleasant adverse effects.
It's truly changed my day-to-day live. <a href=https://sugardefender-en-us.com>sugar defender official website</a>
Right here is the right site for everyone who wishes to find out about this topic. You understand so much its almost tough to argue with you (not that I really will need to…HaHa). You definitely put a fresh spin on a topic which has been written about for ages. Excellent stuff, just great.
This web site certainly has all of the info I needed about this subject and didn’t know who to ask.