如何在 SailsJS 应用程序中使用 OrientDB [英] How to use OrientDB in a SailsJS App

查看:61
本文介绍了如何在 SailsJS 应用程序中使用 OrientDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 NodeJS 和 SailsJS 的新手,之前使用过 Rails 或 PHP.

I am new to NodeJS and SailsJS, was working with Rails or PHP before.

我想将 SailsJS 与 OrientDB 一起使用.最好的方法是什么?到目前为止,我找到了两个选项,但信息量还不是很大(目前).

I want to use SailsJS together with OrientDB. What would be the best approach? I found two options so far, but the amount of information isn't that great (yet).

  1. 使用 Waterline 和这个 用于orientdb的sails适配器
  2. 更深入一层并使用 nodejs 的二进制适配器

任何帮助、提示、提示将不胜感激.我有点失落,但很高兴能够更多地了解这些出色的工具.

Any help, tips, hints would be greatly appreciated. I am a bit lost but very excited to understand more about these great tools.

谢谢!

推荐答案

您现在可能已经找到了答案,但这里是我的供将来参考.

You probably have figured out the answer by now but for future reference here's mine.

我知道目前有 3 个用于 Waterline/SailsJS 的 OrientDB 适配器:

There are currently 3 OrientDB adapters for Waterline/SailsJS that I know of:

考虑到代码量、提交和花费在每一个上的时间,我会说使用其中一个(并且可能做出贡献)比走另一条路线更好.在 SailsJS 中使用其中之一应该是即插即用,并且它们还应该与蓝图控制器兼容(我说应该,因为我的经验确实是水线而不是 SailsJS).另一方面,可能会有轻微的性能损失,因为所有查询在到达 Oriento 之前都将通过水线和适配器.只有在性能绝对至关重要的情况下,我才会直接使用 Oriento,即便如此,sails-orientdb 和 waterline-orientdb 都公开了一个返回本地 Oriento db.getDB() 方法目的.因此,适配器为您提供 Oriento 以及验证以及自动类创建(通过模型)以及与 SailsJS 的轻松集成,两全其美:)

Given the amount of code, commits and time spent on each I would say is better to use one of these (and probably contribute) than to go down the other route. Using one of these with SailsJS should be plug 'n play and they should also be compatible with blueprints controllers (I say should as my experience really is waterline and not so much SailsJS). On the other hand, there may be a slight performance penalty as all queries will go through waterline and adapter before they reach Oriento. Only if performance is absolutely critical I would go directly to Oriento and even so both sails-orientdb and waterline-orientdb expose a .getDB() method that return a native Oriento db object. So the adapters give you Oriento plus validations plus automatic class creation (through models) plus easy integration with SailsJS, the best of both worlds :)

这是我体验最少的一个.

This is the one I have the least experience with.

  • 最后一次提交:2014 年 11 月 8 日(共 4 次提交);
  • 实现的水线接口:不确定,package.json 中没有提到;
  • 自动测试:没有 travis.yml 或表明它通过了水线适配器测试;
  • "oriento": "~0.3.1": 这是相当老的,不支持 OrientoDB 2.0.

这似乎是最古老的适配器,我也有一些使用经验.

This seems the oldest adapter and one I have some experience with.

  • 最后一次提交:2014 年 12 月 25 日(共 45 次提交);
  • 实现的水线接口:semanticqueryable.没有 associations 接口,这意味着水线核心将处理不会充分利用图形特定命令的连接;
  • 自动化测试:travis.yml 已设置,但如果您访问 travis-ci.org/vjsrinath/sails-orientdb,它会显示 0 通过 1 失败;
  • "oriento": "^0.3.2": 又是一个旧版本的oriento.
  • Last commit: Dec 25, 2014 (out of 45 commits);
  • Waterline interfaces implemented: semantic, queryable. No associations interface which means waterline core will handle the joins which will not make the most out the graph specific commands;
  • Automated tests: travis.yml set up, but if you got to travis-ci.org/vjsrinath/sails-orientdb it says 0 passing 1 failing;
  • "oriento": "^0.3.2": once again an old version of oriento.

这是sails-orientdb的一个分支,最近有很多进展.

This one is a fork of sails-orientdb and seen lots of progress recently.

  • 最后一次提交:2015 年 2 月 26 日(共 421 次提交);
  • 实现的水线接口:semanticqueryableassociationsmigratable.连接由单个 SELECT 查询和获取计划执行;
  • 自动化测试:travis.yml 设置.除了通用的 225 个水线适配器测试之外,它还有额外的 28 个单元测试和 68 个集成测试,它们都通过了 OrientDB v1.7.10 和 v2.0.2;
  • oriento":~1.1.0":目前的最新版本.
  • Last commit: Feb 26, 2015 (out of 421 commits);
  • Waterline interfaces implemented: semantic, queryable, associations and migratable. Joins are performed by a singe SELECT query with fetch plan;
  • Automated tests: travis.yml set up. Besides the generic 225 waterline-adapter-tests it has additional 28 unit tests and 68 integration tests all passing in both OrientDB v1.7.10 and v2.0.2;
  • "oriento": "~1.1.0": latest version as of now.

所以,冒着偏激的风险,我是 waterline-orientdb 的开发者,我相信 waterline-orientdb 是目前最成熟的用于 SailsJS 的 OrientDB 适配器.它具有更丰富的功能、更新和更好的测试.

So, at the risk of sounding partial, I'm the developer of waterline-orientdb, I believe waterline-orientdb is currently the most mature OrientDB adapter for SailsJS. It has a richer feature, it's more up to date and is better tested.

更新: waterline-orientdb 现在更名为 sails-orientdb并由上述 3 个适配器的开发人员维护.

UPDATE: waterline-orientdb is now called sails-orientdb and is maintained by the developers of the mentioned 3 adapters.

这篇关于如何在 SailsJS 应用程序中使用 OrientDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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