How to incorporate Golang in to your website?

huangapple go评论77阅读模式
英文:

How to incorporate Golang in to your website?

问题

我有一个使用Django和SQL数据库的网站。我想在我的网站中使用Golang,但我不知道如何整合。我希望通过使用Golang来提高网站的性能,因为我有一些“部分”(例如登录和关注,这是一个音乐网站)非常耗费CPU,并且需要更好的优化方式。请帮助我。

英文:

I have a website that uses django and an sql database. I want to use Golang with my website i don't know any way to incorporate. I want it to accelerate my performance in the website because i have some of my "parts" (ex. Like Login and Follow its a music site) that are very cpu intensive and need to be optimized a better way. Please Help me.

答案1

得分: 6

Go是一种编程语言,可以用来编写Web应用程序的服务器。

这需要完全用Go编写等效的代码来替换Django。你可能需要一个基于Go的Web框架,比如Revel。如果要进行类比,Go就像Python,Revel就像Django。

这对你的架构来说是一个很大的改变。如果性能是你现有网站唯一的问题,你可以通过使用Python和Django来改进瓶颈。Django和Python提供了一个强大的平台,可以将你的应用程序扩展到实际上大量的用户。

你也可以通过引入Go来改变你的基础架构的一小部分。可以考虑使用微服务架构来思考这些问题。

英文:

Go is a Programming Language and can be used to write the server for your web application.

This requires completely replacing django with equivalent code written in Go. You will most possibly need a web framework written on top of Go. For ex. Revel. If you want an analogy, Go is like Python. Revel is like Django.

This is a big change in your architecture. If performance is the only issue of your working website, you might want to improve the bottlenecks by just using python and django. Django and Python provide a powerful platform that can scale your application to a practically large number of users.

There is also ways that you can change only small parts of your infrastructure by incorporating Go. Look for micro-services architecture in order to think on those lines.

huangapple
  • 本文由 发表于 2017年4月27日 06:55:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/43645860.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定