在Erlang(和Riak)开发应用程序时的良好做法? [英] Good practices when developing an application in Erlang (and Riak)?

查看:148
本文介绍了在Erlang(和Riak)开发应用程序时的良好做法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在熟悉Erlang / OTP和Riak(Core,KV,Pipe等),以便依次开发一个开源的分布式应用程序。我们的项目将有一堆依赖:像erlang_js,protobuffs等工具,还有我们需要运行的服务,如Riak KV。

We are in the process of getting familiar with Erlang/OTP and Riak (Core, KV, Pipe, and so on) in view of developing an open-source distributed application in turn. Our project is going to have a bunch of dependencies : tools like erlang_js, protobuffs, etc., but also services that we need to have running, such as Riak KV.

在Python / Ruby / Node.js中,如果模块放置在相对于项目的标准子目录中,可以引用它们,然后将其打包在版本中。您可以在项目目录中启动shell,使用模块,进行测试等等,只要遵循良好做法,都可轻松实现。

In Python/Ruby/Node.js, if modules are placed in a standard subdirectory relative to your project's, you can reference them, and later package them in releases. You can fire up a shell in the project's directory, play with your modules, do tests and so on, all just easily if good practices are followed.

什么是最好的在Erlang / OTP中组织开发环境的做法,所有依赖项都可以访问(并且可以更新到最新版本),shell访问运行的节点,测试,发布等等。

What are the best practices for organizing a development environment in Erlang/OTP, with all dependencies reachable (and easily updatable to newest version), shell access to running nodes, testing, making releases, and so forth?

推荐答案

查看钢筋: https://github.com/basho/rebar 用于打包,模板和管理Erlang的版本/ OTP应用程序。你会发现有关于如何使用它的整个教程。

查看 本教程中的OTP 首先,在您可以 切换到这一个 ,它显示了您在Erlang中的发布以及它们的处理方式。在开发项目时,使用此 整本书作为参考 ,因为作者仍​​在逐渐添加您可能需要的更高级的内容。


您可能还想继续阅读关于 Erlang应用程序 ,然后查看以下快速链接:



Erlang Packaging,Process One
芝加哥老板伙伴的OTP包装视频
Erlang依赖管理
Richard Jones关于包含依赖关系的Erlang项目的建议和示例
Maven工具及其如何用于包装Erlang项目

Check out rebar: https://github.com/basho/rebar used for packaging, templating and managing releases of Erlang/OTP applications. You will find there an entire tutorial on how to use it.

Check out this tutorial on OTP first, before you can switch to this one which shows you releases and how they are handled in Erlang. Use this entire book as reference as you develop your project and because the author is still progressively adding more advanced stuff that you may need.

You may also want to keep reading about Erlang Applications and then do check out these quick links below:

Erlang Packaging, Process One
OTP Packaging Video by Chicago Boss Guys
Erlang Dependency Management
Richard Jones Advice and examples on Packaging Erlang Projects with Dependencies
Maven Tool and how it is used in packaging Erlang Projects

最重要的是,取 rebar 非常认真!管理具有依赖关系的Erlang应用程序非常重要。您可以继续在Stackoverflow上发布您的问题,以获取任何帮助。

在我忘记之前,请从 Riak社区

Most importantly, take rebar very seriously ! It is very important in managing Erlang applications which have dependencies. You can keep Posting your questions here on stackoverflow for any assistance as you progress.

Before i forget, do check out alot of stuff from the Riak Community

编辑


此外,重要的是查看 创建目标系统 以及如何使用 Reltool 来处理发布。与erlang的好处在于,它有几个选择,如何做一些事情,只要它很容易维护你的应用程序。使用目标系统,您将学习如何嵌入Erlang VM,如何在 Solaris VxWorks 上运行Erlang应用程序,并使用 erlsrv

通常,我们确保在操作系统启动服务器时,我们的应用程序从它开始。到目前为止,与嵌入Erlang / OTP VM相比,Solaris的定制比任何其他操作系统都要多。您可以随时使用嵌入式Erlang VM与 Escript 其中通过escript创建一个允许连接到嵌入式VM的erlang节点(因此他们必须共享相同的cookie),并且嵌入式VM必须允许临时创建的节点通过执行

EDIT

Also, its important to check out the system documentation on creating target systems and also how to use Reltool to handle releases. The good thing with erlang is that it has several options of how to do something, as long as its easy to maintain your application in that way. With target systems, you will learn how to embed the Erlang VM, how to run Erlang applications on Solaris, VxWorks,and creating Erlang applications as Services on Windows NT using erlsrv.

Normally, we make sure that as an operating system is booting a Server, our application starts with it. Solaris is so far has more customizations than any other OS as regards embedding Erlang/OTP VM. You can always communicate with (an) embedded Erlang VM(s) using Escript where by the escript creates a an erlang node which is allowed to connect to the embedded VM (so they have to share same cookie) and the embedded VM must have allowed the temporarily created Node to connect by executing

net_kernel:allow(List_of_nodes)

,您确保调用此方法,使您的嵌入式VM仅允许从已知严格指定数量的节点进行连接。

, you make sure to call this method to make your embedded VM allow connections only from an known strictly specified number of Nodes.

这篇关于在Erlang(和Riak)开发应用程序时的良好做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆