[英]node.js golang composite architecture for web application
I am currently architecting a web app that will use node.js for basic routing. 我目前正在设计一个将使用node.js进行基本路由的Web应用程序。 Some parts of the app are more processor intensive and I wanted to use golang for those parts. 该应用程序的某些部分需要更多的处理器,我想在这些部分使用golang。 However, I'm not sure the best way to install and communicate between the two languages. 但是,我不确定这两种语言之间进行安装和通信的最佳方法。 I'm using Amazon Elastic Beanstalk for initial tests, so any specifics can be targeted for that platform. 我正在使用Amazon Elastic Beanstalk进行初始测试,因此可以针对该平台指定任何具体信息。
In essence it boils down to the following 2 questions: 从本质上讲,它可以归结为以下两个问题:
1) How do you install both node.js and a golang docker image on Amazon EC2? 1)如何在Amazon EC2上同时安装node.js和golang docker映像? Amazon has guides for one or the other, but not both. 亚马逊有一个或另一个指南,但没有两个。
2) What is the best way to offload processor intensive tasks from node.js to a golang codebase (I could imaging RPC, or just running golang on some localhost port, but I'm new to this type of thing)? 2)将处理器密集型任务从node.js卸载到golang代码库的最佳方法是什么(我可以对RPC进行映像,或者仅在某些localhost端口上运行golang,但是我对这种事情不熟悉)? The golang tasks might be things like serious number crunching or complex graph searches. golang任务可能是诸如严重的数字运算或复杂的图形搜索之类的事情。
Thanks for any guidance. 感谢您的指导。
There are many options for communicating between Go and Node.js. Go和Node.js之间有很多通信选项。 Here are a few: 这里有一些:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.