web后端開發學習路線
My previous article described how you can get into frontend development. It also discussed how the front end can be a place filled with landmines – step in the wrong place and you'll be overwhelmed by the many frameworks of the JavaScript ecosystem.
我以前的文章描述了如何進行前端開發 。 它還討論了前端如何成為一個充滿地雷的地方-進入錯誤的地方,JavaScript生態系統的許多框架會讓您不知所措。
In this blog article, let's see how you can get into back end development. Along the way, I'll answer some of the most common questions people ask me about it.
在這篇博客文章中,讓我們看看如何進行后端開發。 在此過程中,我將回答人們問我的一些最常見問題。
什么是后端開發? (What is Backend Development?)
Front end development involves what a user sees on the screen when they open a specific URL owned by you. Even in a completely static environment (with only HTML/CSS), when someone opens a website, some server on the planet needs to respond to you with those HTML and CSS files.
前端開發涉及用戶打開您擁有的特定URL時在屏幕上看到的內容。 即使在完全靜態的環境(只有HTML / CSS)中,當有人打開網站時,地球上的某些服務器也需要使用這些HTML和CSS文件來響應您。
That server is just a computer, just like the one you use yourself to browse the internet. But it has been tuned for performance, and doesn't have unnecessary components like a mouse or keyboard attached. And it sits with tons of other computers probably in a data warehouse.
該服務器只是一臺計算機,就像您自己用來瀏覽互聯網的計算機一樣。 但是它已經過性能調整,并且沒有多余的組件,如鼠標或鍵盤。 它與數以千計的其他計算機一起放置在數據倉庫中。
Programming those computers in some special way is called back end development.
以某種特殊方式對這些計算機進行編程稱為后端開發 。
You may think that backend development is called what it is because it runs behind the user's back. A visitor to your website never really "accesses" the back end completely. They just communicate with your server, either directly through ports for very limited access (like transferring HTML/CSS files) or not even that – buried deep under CDNs or firewalls (like Cloudflare).
您可能會認為后端開發就是所謂的,因為它在用戶背后運行。 您網站的訪問者永遠不會真正完全“訪問”后端。 它們只是直接通過端口與您的服務器進行通信,以進行非常有限的訪問(例如傳輸HTML / CSS文件),甚至不進行通信–將它們深深地埋在CDN或防火墻(如Cloudflare)下。
Now that we have a raw understanding of what back end development means, let's get into some real questions.
現在,我們對后端開發的含義有了一個初步的了解,讓我們進入一些實際的問題。
后端需要前端編程知識嗎? (Is front end programming knowledge required for the back end?)
TLDR; No.
TLDR; 沒有。
Back end development, as mentioned above, involves the programming of a computer sitting probably on the other side of the planet responsible for responding to what your users say from their own computers.
如上所述,后端開發涉及對計算機的編程,該計算機可能位于地球的另一側,負責響應用戶從其自己的計算機發出的信息。
If you're a full-time backend developer, you do not really need to care about what goes on inside those HTML, CSS and JavaScript files you send to the user's browser. Instead, you've to focus more on the performance of the server, the server code, and throughput.
如果您是一名全職后端開發人員,那么您實際上不必關心發送到用戶瀏覽器HTML,CSS和JavaScript文件中的內容。 相反,您必須更多地關注服務器的性能,服務器代碼和吞吐量。
后端開發有哪些內容? (What goes into back end development?)
Well, going by the books, you may say that a person who codes an application that can respond to HTTP requests is a back end developer.
好吧,按照這些書,您可能會說,編寫可以響應HTTP請求的應用程序的人是后端開發人員。
But in reality, sometimes back end developers are able to do much more than just writing server scripts. They have the knowledge to set up reverse proxy servers (NGiNX/HAProxy), enable compression and other ways to speed up the site, and set up a production docker environment.
但是實際上,有時后端開發人員不僅可以編寫服務器腳本,還能做更多的事情。 他們具有設置反向代理服務器(NGiNX / HAProxy),啟用壓縮和其他方式以加快站點速度以及建立生產docker環境的知識。
To qualify as a back end developer, I'd say the bare minimum skills you need are:
要成為合格的后端開發人員,我想說的是,您需要的最低技能是:
- Good knowledge about a programming language in which you can write HTTP servers. Examples: C#, Java, Node, PHP, Python, etc. (there are many!) 對可以用來編寫HTTP服務器的編程語言的豐富知識。 示例:C#,Java,Node,PHP,Python等(有很多!)
- Manage to host using cPanel (traditional) or using bash terminal (cloud hosting/traditional) 使用cPanel(傳統)或bash終端(云托管/傳統)管理托管
- Working with Version Control Systems (VCS) like git for managing and deploying builds 使用git等版本控制系統(VCS)來管理和部署構建
Just like every game comes with minimum and recommended specifications, for back end developers, my recommend specifications would be (inclusive of the minimum skills):
就像每款游戲都有最低要求和推薦規格一樣,對于后端開發人員,我的推薦規格將是(包括最低要求):
- NGiNX for static file assets and server management NGiNX用于靜態文件資產和服務器管理
- Database Management skills (SQL/NoSQL) 數據庫管理技能(SQL / NoSQL)
- Security of backend (Writing safe and robust code, running applications in docker containers with limited privileges, protection against DoS attacks) 后端的安全性(編寫安全可靠的代碼,以有限的特權在Docker容器中運行應用程序,防范DoS攻擊)
- Autoscaling/Load balancing 自動縮放/負載平衡
Alright, too much talking about what goes into back end development. But how do you become one?
好吧,過多地討論了后端開發的內容。 但是你如何成為一個?
從最低要求開始 (Start with minimum requirements)
Like I said, for the back end, just like games, we have a set of minimum requirements and recommended requirements. The minimum requirements consists of 3 things:
就像我說的那樣,對于后端,就像游戲一樣,我們有一組最低要求和建議要求。 最低要求包括三件事:
學習后端編程語言 (Learn a backend programming language)
When people learn by themselves, they usually do not have a team or anyone who can do front end development. They're all on their own. So you'll often have to create webpages and servers all by yourself, at least in the beginning.
人們自己學習時,通常沒有團隊或任何可以進行前端開發的人。 他們全靠自己。 因此,至少在開始時,您通常必須自己全部創建網頁和服務器。
Although there are a lot of choices for back end programming languages, and I cannot think of any popular system language which doesn't support HTTP servers out of the box. The advantage of choosing Node is that your front end JavaScript skills are transferrable to the back end.
盡管后端編程語言有很多選擇,但我想不出任何不支持HTTP服務器的流行系統語言。 選擇Node的好處是您的前端JavaScript技能可以轉移到后端。
Nonetheless, you can choose from a variety of languages like Java, C++, C#, Python, PHP, etc.
但是,您可以從多種語言中進行選擇,例如Java,C ++,C#,Python,PHP等。
How do you pick one, you might ask. The answer is the same as it was in the front end development article: you have gotta try everything initially and see which one clicks the best with you.
您可能會問,如何挑選一個。 答案與前端開發文章中的答案相同:您必須首先嘗試一切,然后看看哪個點擊最適合您。
Node is easy as you might have already done JS programming for the front end. But if you're a Python or Java developer, you might find those easy to pick up. It depends on your profession and taste completely.
Node很容易,因為您可能已經為前端完成了JS編程。 但是,如果您是Python或Java開發人員,則可能會發現它們很容易上手。 這完全取決于您的職業和品味。
了解有關管理托管的信息 (Learn about managing hosting)
Gone are the days when you'll have to manually purchase servers and set them up in your home, connect to your ISP, do all that stuff yourself. This is the era of cloud computing. Now, when hosting your website, you have mainly 2 options:
您將不得不手動購買服務器并在家里設置它們,連接到ISP,自行完成所有這些工作的日子已經一去不復返了。 這是云計算的時代。 現在,在托管網站時,主要有兩種選擇:
- Going for managed hosting servers like HostGator or GoDaddy. 用于托管主機服務器,例如HostGator或GoDaddy。
- Going for cloud hosting providers like GCP, AWS, or DigitalOcean. 尋找GCP,AWS或DigitalOcean等云托管提供商。
What is the difference between the two? In both cases, the servers are owned and operated by the respective companies. But the major difference is that managed hosting is more GUI friendly, has a rich set of tools for seeing the filesystem, monitoring usage, managing your official domain emails, uploading/downloading files from your server, and so on. It's basically a setup for people with less technical skills.
兩者有什么區別? 在這兩種情況下,服務器均由各自的公司擁有和運營。 但是主要的區別是托管托管更易于使用GUI,具有豐富的工具集,可用于查看文件系統,監視使用情況,管理官方域電子郵件,從服務器上載/下載文件,等等。 基本上,它是為技術技能較弱的人準備的。
For that reason, I do not recommend managed sites like HostGator or GoDaddy for seasoned developers. Still, it might be a good platform to make mistakes and learn on, primarily because you usually have prepaid plans for them. You'll also have a nice UI for managing things, which doesn't allow you to accidentally shoot up your bills.
因此,我不建議經驗豐富的開發人員使用托管網站如HostGator或GoDaddy。 盡管如此,它仍然可能是犯錯和學習的好平臺,主要是因為您通常會為他們預先準備好計劃。 您還將擁有一個不錯的用戶界面來管理事情,這不允許您意外地付賬。
But when you start picking up speed, I recommend that you switch to a cloud provider. This takes away all the nice tools from cPanel that you used to manage files and folders on servers. But at the same time, it will challenge you to level up your skills a lot.
但是,當您開始加快速度時,建議您切換到云提供商。 這消除了cPanel中用于管理服務器上文件和文件夾的所有漂亮工具。 但是與此同時,它將挑戰您大量提高您的技能。
Today, a lot of cloud providers offer a decent free trial, too, so that you can actually try out their platform before going full in. I host my website for developers - codedamn - on DigitalOcean and find it to be at a sweet balance of site complexity and features.
如今,許多云提供商也提供了不錯的免費試用版,因此您可以在全面試用之前實際試用他們的平臺。我在DigitalOcean上為開發人員托管了我的網站-Codedamn,并發現它與網站的復雜性和功能。
You can use this link to signup on DigitalOcean and get free $100 credits. DigitalOcean instances are as cheap as $5 a month, so you have a runway of about 20 months on that instance, great deal, huh?
您可以使用此鏈接在DigitalOcean 上注冊并免費獲得$ 100的信用 。 DigitalOcean實例的價格低至每月5美元,因此您在該實例上的運行時間約為20個月,是嗎?
Anyway, you can choose any cloud provider. Then it's important to learn to manage the server using just the command line by ssh'ing into it.
無論如何,您可以選擇任何云提供商。 然后,重要的是學會通過僅使用命令行來管理服務器。
了解版本控制系統 (Learn about Version Control Systems)
There are other solutions apart from Git for VCS. But Git is the most used and simplest to understand.
除了適用于VCS的Git之外,還有其他解決方案。 但是Git是最常用和最容易理解的。
As an individual, you might not appreciate it right away. But you'll understand why it is so important the moment you start working either in a team on multiple features simultaneously in your project.
作為個人,您可能不會立即欣賞它。 但是當您開始在一個團隊中同時在項目中同時處理多個功能時,您就會理解為什么如此重要。
Git allows you to manage your workflow using commits and branches. Commits are like checkpoints in your codebase - the ones you can always revert to if you screw up.
Git允許您使用提交和分支來管理工作流。 提交就像代碼庫中的檢查點一樣-如果您搞砸了,可以隨時恢復到這些檢查點 。
Branches are like alternate realities of your project, where something completely different could happen. These alternate realities can be created from any point in time and can be merged back again at any time.
分支就像項目的替代現實 ,其中可能會發生完全不同的事情。 這些替代現實可以在任何時間點創建,并且可以隨時重新合并。
If those realities can be merged together with compatibility, then it's fine. But if there's a conflict (like if you're alive in one reality and dead in other), then you have to manually make a choice. Other changes can be merged automatically.
如果可以將這些現實與兼容性合并在一起,那就很好。 但是,如果存在沖突(例如,您在一個現實中還活著而在另一個現實中死了),那么您必須手動做出選擇。 其他更改可以自動合并。
Git is super interesting, and once you get hang of it, you'll want to use it in every project. You get to keep a history of your work in an efficient manner (it compresses and stores only the difference between commits).
Git非常有趣,一旦您掌握了它,就可以在每個項目中使用它。 您可以高效地保留工作歷史記錄(它僅壓縮和存儲提交之間的差異)。
It also allows you to create online git repositories on sites like GitHub, which acts as a central source of truth for your website. Sites like GitHub can be configured with special webhooks that can actually update your website whenever you add a new checkpoint (a new commit) without you ever needing to manually go to the server and update it yourself.
它還允許您在GitHub之類的網站上創建在線git存儲庫,這是網站真相的主要來源。 可以像GitHub這樣的網站配置特殊的Webhook,這些Webhook實際上可以在您添加新的檢查點(新的提交)時更新您的網站,而無需手動轉到服務器并自行更新。
尋求推薦技能 (Go for recommended skills)
I'm a big believer in learning by doing. And the best way to do something comes out of necessity or interest. Once you consider yourself good enough with the minimum requirements, it's time to acquire the recommended skills. This includes all the tools like Docker and NGiNX mentioned above.
我堅信邊做邊學。 而做某事的最好方法是出于必要或興趣。 一旦您認為自己的最低要求足夠好,就可以開始學習推薦的技能。 其中包括上述所有工具,例如Docker和NGiNX。
DevOps is also something which fits in super nicely with back end developers. You could try and explore TravisCI or CircleCI for automated build deployments. Continuous Integration and Deployment (CI/CD) is a topic that could take another whole blog post, so I'll not get into that. In fact, once it is set up correctly, it'll save you a ridiculous amount of developer time!
DevOps也非常適合后端開發人員。 您可以嘗試探索TravisCI或CircleCI進行自動構建部署。 持續集成和部署(CI / CD)是一個主題,可能需要撰寫另一篇完整的博客文章,因此我不再贅述。 實際上,一旦正確設置,它將為您節省大量的開發時間!
Then comes databases, which I placed in recommended skills. But you're gonna need databases for pretty much any application which involves some sort of data persistence generated by the user.
然后是數據庫,我把這些數據庫放在推薦的技能上。 但是,幾乎所有涉及用戶生成的數據持久性的應用程序都將需要數據庫。
Databases are usually easy to begin working with, but harder to maintain and tweak properly. The best way to start working on a back end tech stack is to have everything together on a single server - the code of your application, the reverse proxy servers, the database, etc. Then as you become more proficient in each thing, you can decouple it from the existing business logic.
數據庫通常很容易上手,但是很難維護和正確調整。 開始在后端技術堆棧上工作的最佳方法是將所有內容整合到單個服務器上-您的應用程序代碼,反向代理服務器,數據庫等。然后,當您精通每件事時,您可以將其與現有業務邏輯分離。
By doing this, you're enabling an architecture that can be highly scaled. A database-operation intensive application could have an optimized solution for databases. And a heavy traffic bound site should have a good CDN mechanism to offload static assets, and so on.
通過這樣做,您可以實現高度可擴展的體系結構。 數據庫操作密集型應用程序可能具有針對數據庫的優化解決方案。 流量受限的站點應該具有良好的CDN機制來卸載靜態資產,依此類推。
結論 (Conclusion)
There's so much to learn, but it's all achievable if you don't give up. Let me know what you think about this post through my twitter and Instagram handles. It'll mean a lot to me if we connect over there!
有很多東西要學,但是如果您不放棄,這一切都是可以實現的。 讓我知道您對我的Twitter和Instagram句柄的看法。 如果我們在那里連接對我來說意義重大!
Also, if you're interested, checkout codedamn - a developer-focused platform for learning technologies like backend development! I even posted a YT video on spinning up your own simple website server in 2 minutes! Check that out and let me know what you think!
另外,如果您有興趣,請簽出codedamn-一個面向開發人員的平臺,用于學習后端開發等技術! 我什至在2分鐘內發布了一個YT視頻,介紹了如何旋轉您自己的簡單網站服務器 ! 檢查一下,讓我知道您的想法!
Peace!
和平!
翻譯自: https://www.freecodecamp.org/news/learn-backend-development/
web后端開發學習路線