Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Sailsjs #14

Open
8 of 14 tasks
Glavin001 opened this issue Jan 4, 2015 · 6 comments
Open
8 of 14 tasks

Switch to Sailsjs #14

Glavin001 opened this issue Jan 4, 2015 · 6 comments
Assignees

Comments

@Glavin001
Copy link
Owner

See http://sailsjs.org/#/

@Glavin001
Copy link
Owner Author

This is what the entire semester's worth of courses (1087) looks like:
image

That iCal was generated in 600-700 milliseconds. Awww yeaa! Mac's Calendar had huge trouble rendering it.

/cc @valencik I remember you asking about potentially viewing all of the courses to try and optimize course schedules (from an administrative / prof perspective). So looks like this is definitely doable and fast. Start brainstorming!

@tjwebb
Copy link

tjwebb commented Mar 30, 2015

Hey @Glavin001 I've seen you around the sails.js forums but I wanted to check in and see how things are going with your sails project. Let me know if we can help.

-- the sails.js team

@Glavin001
Copy link
Owner Author

Hey @tjwebb . I appreciate you checking in. This project (UniCal and UniAPI) is going well, with Sails. No problems so far.

My main concerns with Sails are for my work-related project, building a multi-tenant API server using Sails. It is across between http://loopback.io/ and Sails.js right now. I am currently working on other projects for work however in the next few weeks/month or so I will be going back to building our API server and will be needing a solution.
Neither loopback nor Sails supports Multitenancy, however I was impressed that Loopback has automatic documentation generation for REST endpoints using Swagger 2.0 and also many SDKs for iOS, Android, and Angular (although I use Ember for work). Their documentation also seemed more complete sometimes, although it's been awhile since I had last looked at Sails documentation so hopefully this has changed.

I have had friends and colleagues who used Sails.js and ended up switiching to http://laravel.com/ for work.
They found the documentation sparse and felt like it was too much "magic". While I do appreciate great documentation, I am very comfortable with reading source code of projects this size, and understand when documentation is left behind while features grow quickly. After developing the multitenancy Pull Request for Waterline and Sails I feel I have a good grasp of this "magic", so no worries for me there.

In summary, what I know I will be needing for work's API server:

  • multitenancy
    • both loopback and Sails do not have support for, yet
    • once I have time I will be interested in contributing with another (final) pull request, to whichever project (Sails or loopback) "wins" my vote for the work project
  • MongoDB
    • embedded / sub documents
      • appears both loopback and Sails do not have great support for MongoDB, yet
  • REST endpoint documentation generation to Swagger

Thank you for your support! For my personal projects I know I have enjoyed using Sails and look forward to using it again for my other projects, work or otherwise.

/cc @toddmurphy


Update: I forgot, we will also need websocket support, which Sails.js has currently 👍.

@tjwebb
Copy link

tjwebb commented Mar 30, 2015

Neither loopback nor Sails supports Multitenancy,

If you're talking about creating role-based silos within a single sails.js application, check out sails-permissions. It should get you most of the way there. This is a module I wrote and published; in addition to backing from Balderdash, I have a personal interest in making sure it is functional and secure.

If you require a more bespoke solution here, sails-permissions might nonetheless serve as a good starting point.

however I was impressed that Loopback has automatic documentation generation for REST endpoints using Swagger 2.0

Some folks in the community are working on this, and this is an effort that Balderdash is supporting. Swagger is awesome, and this is definitely something we'll be involved with going forward.

MongoDB
embedded / sub documents
appears both loopback and Sails do not have great support for MongoDB, yet

MongoDB was the first adapter that sails.js supported, so it's probably the most stable of the adapters. I actually just brought on two more folks to help maintain that adapter, so there's much more capacity now to add functionality. Ultimately, prioritizing features is hard; if something is causing an issue in some enterprise-size project that you need action on, that's something we could work with you to grease the wheels on.

@Glavin001
Copy link
Owner Author

If you're talking about creating role-based silos within a single sails.js application, check out sails-permissions. It should get you most of the way there.

My use case is that I could have n number of "tenants" and each have a unique and separated database, and therefore their own connection. I need to be able to dynamically select the respect tenant database connection based off of the request. For instance, a user makes a request and is a member of tenant1 and they have a header, X-Tenant maybe, that selects tenant1 for which they have permissions for. Therefore the response should be with respect to the database for tenant1.

If sails-permissions supports this then that would be great, and we could check this off the list for features required by Sails users and the pull request at balderdashy/waterline#787 was unnecessary. I could not find more information in the documentation, if you could point me in the right direction / link I would appreciate it..

Some folks in the community are working on this, and this is an effort that Balderdash is supporting. Swagger is awesome, and this is definitely something we'll be involved with going forward.

Awesome! I found balderdashy/sails#1094 and https://github.com/tjwebb/swagger-sails . Is that where I should contribute if I have time? This is another must-have for me.

MongoDB was the first adapter that sails.js supported, so it's probably the most stable of the adapters.

My (uneducated) judgement on lack of MongoDB support was because Waterline appears to be very relational in nature and embedded document support is not yet there. See https://github.com/balderdashy/sails-mongo/issues/44 . However MongoDB support in Sails is much better than Loopback, since they say in their documentation:

LoopBack currently does not currently support property mapping for MongoDB; you can customize only collection names.

So that makes me a little concerned with loopback. They also feel biased towards relational databases.

Ultimately, prioritizing features is hard; if something is causing an issue in some enterprise-size project that you need action on, that's something we could work with you to grease the wheels on.

Thank you for the support! I know I will need multitenancy support (todo, see details above), websockets (done with Sails), permissions / ACL (done), MongoDB with embedded documents (todo), Swagger documentation generation (todo), and Sails SDKs for iOS and Ember (todo, iOS is my main concern, I can write my own for Ember as I have done before).

Thanks again!

@tjwebb
Copy link

tjwebb commented Mar 30, 2015

If sails-permissions supports this then that would be great, and we could check this off the list for features

No, sails-permissions allows you to achieve the same kind of "logical" separation within a single database.

My use case is that I could have n number of "tenants" and each have a unique and separated database, and therefore their own connection. I need to be able to dynamically select the respect tenant database connection based off of the request.

We have done similar things internally at balderdash. e.g. hot-loading new datasources on the fly during runtime and routing requests accordingly. We have capabilities internally that we're either not able to release publicly due to NDA-type issues, and/or that just aren't yet in a publicly-consumable state. Just getting clarity on your use case is beneficial here; I now can say confidently that this use case is supported by Balderdash, it's just not open-source in sails.js. These are pretty advanced enterprise-grade features, and usually organizations will want to engage with us directly to ensure support for this kind of functionality. If you'd like I can go into more detail on these efforts off line.

For instance, a user makes a request and is a member of tenant1 and they have a header, X-Tenant maybe, that selects tenant1 for which they have permissions for.

We've solved this slightly differently, but I like this approach as well.

Awesome! I found balderdashy/sails#1094 and https://github.com/tjwebb/swagger-sails

Yea, I actually didn't realize that issue had been closed, so I re-opened it. My repo there is a placeholder for now, I'm working to focus other ongoing community efforts into a single place.

My (uneducated) judgement on lack of MongoDB support was because Waterline appears to be very relational in nature and embedded document support is not yet there.

It's a reasonable conclusion, given that the headline feature of sails 0.10 was association support, but you'll notice that the actual waterline query syntax is borrowed from Mongoose (http://mongoosejs.com/docs/queries.html). I don't expect you to know the whole history of sails :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants