Loopback or Restify? [closed] - api

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Starting a new API, what gives the best security and speed? Loopback or Restify?
It seems that restify have more than 60,000 downloads last week, on the other hand Loopback is backed up by IBM and have plenty of plugins and security implemented by default.
Benchmark wise there is none to compare but I'm having issue installing Loopback on Nodejs 8 or 9 :
Command: sudo yarn global add loopback-cli
loopback-datasource-juggler#2.56.0: The engine "node" is incompatible
with this module. Expected version ">= 4 <= 6".
What platform should I start my API with? I could wait for Loopback to support node 8 or 9.
I hope I can get an answer even though it might be subjective. I really need some insight on this.
Edit: Added the command used to install loopback. Also thanks for providing insights even if this is not really a pure SO question.

Restify
Restify is a relatively old player in the Node.js API field, very stable and being actively developed. It is purpose-built to enable you to build correct REST web services and intentionally borrows heavily from Express.
The main advantages are :
Automatic DTrace support for all your handlers (if you’re running on a platform that supports DTrace).
Doesn’t have unnecessary functionality like templating and rendering.
Built in throttling.
Built in SPDY support.
The main disadvantage with Restify as they are with Express requireslots of manual work.
Loopback
Restify is a great starting point, but in the long run it might not be the right choice if you plan on investing heavily into APIs.LoopBack is a fully featured Node.js backend framework to connect your applications to data via APIs. It adopts the convention over configuration mantra popularized by Ruby on Rails.
The main advantages are :
Very quick RESTful API development.
Convention over configuration.
Built-in models ready to use.
RPC support.
Fully configurable when needed.
Extensive documentation.
Full-time team working on the project.
Online support support.
The main disadvantage is that learning curve can be pretty steep because there are so many moving parts.
You can now decide yourself according to your needs. I hope it helps

Related

How to open server Port for public so that i can access my locally hosted NODEJS server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
MAKING THINGS SIMPLE EDITS
I am developing an app, have a nodejs API that read data through MSSQL server, now that API is Running on Localhost:3131/ It means it will run locally only.
I do have a Windows Server that stays online always, I can use pm2 on that server with the API files to make things Live, But if i run it how can i make my SERVER IP Public so I can access it through everywhere.
HOW DO I MAKE MY SERVER IP ONLINE BUT SECURE!
There are many ways to achieve what you desire. If you were to do it on your own network/pc then one traditional method called 'port forwarding' can be used for projects under development, but this still means that your IP will be exposed to the web.
Virtual Private Servers and Dedicated servers are used more commonly used these days to host powerful applications. You would need to run a web server first where your web files can be hosted and then you can link your node.js server and sql database.
There are several hosting providers out there which are built for nodejs applications. You can go for 'unmanaged' and 'managed' hosting providers.
Managed providers provide a simplified "Node Appliance" solution. Node and NPM will already be set up for you, and deploys are typically done via git push or similar method. You will have less control of your server, but everything will be set up for you.
There are some managed hosting providers which nodejs recommend themselves. You can view them here:
https://github.com/nodejs/node-v0.x-archive/wiki/Node-Hosting
Some popular ones include:
Heroku
Amazon Web Services
AppFog
Microsoft Azure
RedHat OpenShift
In your case, you are using SQL and Node, so Heroku actually offers free nodejs hosting and provides a free addon for MySQL databases too. Only downside is that the duration (hours) for which you can run apps are limited.
It might be worth doing this on a Virtual Private Server for lower costs. Alternatively, have a look at NodeChef who specialise in Node.js and MySQL.
Hopefully, this gives you enough information to understand what steps to take next.

Ruby on Rails webhost recommendation [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Can someone recommend a web host that will allow me to use the latest versions both of Ruby and Rails? I tried Dreamhost but they're running Ruby 1.8.7 which would mean I'd have to rewrite my entire app. But the most I can afford is around $10/month.
Heroku is your friend.
Free for a single dyno.
Lots of addons with free tiers.
No mucking about in server admin duties.
Deploy via git.
Specify your Ruby interpreter and version via Gemfile
Asset compilation on-push
It's just too easy.
Check out webfaction. Not free, but very cheap, awesome support. Shared hosting, but you get ssh access and close to full control. You can install your own software if needed. It is great if you want more control or want to do more than just a rails site. And it is easier to manage yourself, e.g. when compared to a linode for instance (where you have complete control, but have to setup everything yourself).
$10 is a pretty big budget in my opinion, you could perhaps look into getting a VPS? One of my friends (text book village (.) com) got a vps from computinghost.com , they compiled everything for him but the $10 control panel gives you Zpanel as your control panel.. So, if you can manage through command line or can do everything through your application's interface.. I would recommend it.
They also give shared hosting services, maybe contacting their support would help
For Rails, it's better to have your own environment than a shared hosting like Dreamhost.
Heroku, will be the first recommendation, the current stack is Cedar Stack which supports Ruby 1.9.3. Free if you are using only one Dyno (approx. 512MB RAM), 10K records in DB.
We also use DigitalOcean - http://digitalocean.com for some of our hosting. Plans start from $5 for 512 MB RAM. You can run a decent sized rails app on this.
You can also look at AWS, which provides one year free tier, basically hosting, storage etc - http://aws.amazon.com/free/ It's a good option if you think you need to scale in by end of the year.

ZooKeeper alternatives? (cluster coordination service) [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
ZooKeeper is a highly available coordination service for data centers. It originated in the Hadoop project. One can implement locking, fail over, leader election, group membership and other coordination issues on top of it.
Are there any alternatives to ZooKeeper? (free software of course)
I've looked extensively at Zookeeper/Curator, Eureka, etcd, and consul. Zookeeper/Curator and Eureka are in many ways the most polished and easiest to integrate if you are in the Java world. Etcd is pretty cool and very flexible, but It is really just a HA key store so you would have to write a lot of code to turn it into an opinionated service discovery system.
Consul is (to me) the best of both worlds. It is an opinionated service discovery system written on top of serf, using raft for cluster consensus and gossip for communication. It exposes the discovery / registration endpoints with a well documented REST api, and also allows you to discover services with DNS SRV records, and register services with configuration (i.e. so you can register a database or application you can't integrate a client with, or if you just want to keep your service discovery decoupled from your app)
I've written a blog post about consul where you can learn more and walk through my "try it out" demo
I've also discussed service discovery with etcd & docker if you want to see more about what that custom code might look like.
One last thing! etcd & consul are written in go, so maintaining them is much easier then java solutions like zookeeper. All you need is the consul / etcd binary. no dependencies, no linked libraries, no jvm.
There's a very promising alternative to ZooKeeper called etcd (github.com/coreos/etcd), written by CoreOS team. Unlike Doozerd, etcd is being actively developed.
Just discovered Accord (C) and OpenReplica/ConCoord (Python) which may be interesting solutions
[EDIT] The Hashicorp crew, of Vagrant and Packer fame, are cooking "a decentralized solution for service discovery and orchestration" called Serf.
[EDIT2] Hashicorp strikes again ! They just released Consul, built on top of Serf. The pitch: "a solution for service discovery and configuration, completely distributed, highly available, scalable to thousands of nodes and services across multiple datacenters".
Yes, there is also Doozerd (https://github.com/ha/doozerd). Take a good look at it, it's a nice, single binary distributed coordination service developed by Heroku. With bindings/libraries for java/python/ruby/node. Very easy to get started with and play around.
Take a look at Serf. There is a comparison vs Zookeeper here.
OpenReplica from my research group is a highly available FOSS coordination service for data centers. It can be used for implementing locking, fail over, leader election, group membership and other coordination services. It differs from ZooKeeper in two critical ways:
It uses an object-oriented API. This makes it much easier to write coordination services. Synchronization code for OpenReplica looks exactly like its textbook counterpart; there is no need to master a file and upcall-based API like in ZooKeeper and Chubby.
It enables dynamic membership updates to the replica set. There is no need for static configuration files. The system is integrated into DNS (authoritative, slave for OpenReplica, or Amazon Route 53).
We actively support the system, do not hesitate to let us know if you have further questions.
There's a project called Noah on github that looks interesting, it says that it's "loosely based on Apache ZooKeeper" https://github.com/lusis/Noah with REST support being a key feature (ZK has this as a contrib/option rather than built in).
There are different tools that optimize for different engineering trade-offs.
ZooKeeper Scales marginally for reads; writes with many observers can be slow. It is proven and has a sizable community.
Accord Seems interesting for write-intensive uses, however typical use-cases already have domain-specific solutions (i.e., logging, telemetry).
The others are somewhat interesting but generally unproven. Don't get this wrong if intended for production usage.
I'd found this comparison of Zookeeper, etcd and Doozer:
http://devo.ps/blog/zookeeper-vs-doozer-vs-etcd/
Serf (serfdom.io) is also a nice solution as it is simple! But you must consider, SERF is just a cluster-manager which enables you to send custom events to all cluster nodes. Thats nice, but you have to write your own shell scripts (aka events).
See this example: "https://www.digitalocean.com/community/articles/how-to-set-up-a-serf-cluster-on-several-ubuntu-vps"
The advantage is, you're getting a very simple cluster-manager and you're able to combine this with your favorite configuration, deployment or continuous integration tool.
It seems Corosync is also like ZooKeeper.
I know this post is quite old, but someone who is looking at all possible alternatives I would also like to suggest JGroups library which is mature enough to be used in production environment. I have used it successfully in one of my projects mainly for distributed coordination and to share messages between cluster. It also support AWS support in addition to its flexible architecture where you can customize its stack to get what you need. I suggest you to have a look at it

What web server to use for Lua web development [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
What web server (and why) should I use for Lua web development?
There are a few Lua-based webservers around:
Xavante seems to be the most popular.
Haserl is nice and small.
Nanoki is not strictly a webserver, but a nice small pure Lua wiki engine worth studying. As for the Lua wikies, there is also Sputnik, which is fully featured and very flexible, but is a bit on the slow side.
There is mod_lua (ex mod_wombat) if you prefer Apache. Looks like it would make it into the next Apache distribution as a core module.
Note that it is not so hard to write a FastCGI Lua module.
There is also Luv Lua MVC web-framework project (GitHub page). It is not mature yet, but may contain some interesting insights.
Update. Some more frameworks to check out:
Luvit: http://luvit.io/ (too node-like for my taste)
ngx_lua module for nginx: http://wiki.nginx.org/HttpLuaModule
TIR for mongrel2: http://tir.mongrel2.org/
Ophal: http://ophal.org (web platform)
lev: https://github.com/connectFree/lev
Turbo: https://github.com/kernelsauce/turbo
We've been working on the ngx_lua module for nginx, which supports 100% non-blocking network traffic to mysql, PostgreSQL, memcached, other http services, and more, hence outstanding concurrency level and over-all performance :)
http://github.com/chaoslawful/lua-nginx-module
and we're using it in production :)
The best web server I can think for lua web development is mongrel2. Take a look on TIR framework, which, IMHO, is the best lua use for web development these days.
For development, it can be handy to run a small test server. A good candidate in particular for Lua web development is the Xavante server which is part of the Kepler project. Aside from some of the supporting Kepler modules , Xavante itself is written in pure Lua.
For production, the new mod_lua (which had been known as mod_wombat before the Apache team accepted it into the core set of modules) running on Apache would seem to be a well-respected choice.
there is as well the LuCI project [1]. which is the LuaConfigurationInterface, the web based mangement frontend for OpenWRT (embedded Linux).
The LuCI guys wrote also a very small webserver, called lucittpd.
LuCI is an MVC as well.
And in production state ;)
[1] http://luci.subsignal.org
Recently, Lua support was added to the http://github.com/valenok/mongoose web server, check out pre-build windows binary at http://code.google.com/p/mongoose/downloads/list

Anything better than P6Spy? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this question
I am planning to use P6Spy to intercept database statements within our architecture. However, I noticed on the P6Spy website that the last release of the software was back in 2003. Is there anything out there that is better or should I just stick with P6Spy?
Some other tools and libraries that are similiar to P6Spy.
Craftsman Spy appears to overlap quite a bit with the feature set in log4jdbc. This library hasn't been updated in 2 years and depends on Jakarta Commons Logging.
JAMon (Java Application Monitor) is a comprehensive application monitor and monitoring API which includes JDBC/SQL monitoring as part of it's very large feature set.
JdbcProxy The driver can also emulate another JDBC driver to test the application without a database.
LogDriver appears to be similiar to log4jdbc and the author has written a nice article on JDBC logging in general and his motivation and experience of writing LogDriver.
yet another JDBC logger
log4jdbc-remix an experimental fork of log4jdbc with some interesting features.
jdbcdslog Another new jdbc wrapper with a lot of crossover with log4jdbc features.
SqlRecorder A library that is a wrapper around a JDBC driver to record all executed queries to different locations like a file,console or any other remote server via plugins.
log4jdbc-log4j2 Another fork of log4jdbc that includes the log4jdbc-remix fork and other features of it's own.
Source: https://code.google.com/archive/p/log4jdbc/
P6Spy has been under active development ago for a while now. The 2.0 version has also just been released. It now supports use without any configuration file for some use cases. It has also been updated to the JDBC 4.0 API and is fully compatible is Java 6 & 7.
The project is also being developed on GitHub now. Updated documentation is available as well.
I started using log4jdbc when p6spy wouldn't work on a precompile project that did its own driver discovery. log4jdbc has you change the DB connection url which we found simpler to setup. It also doesn't require a separate configuration file (spy.properties) and it is actively worked on. I'm not going to touch p6spy again.
We still use P6Spy with our Weblogic 8.1.5 with EJB2.0 and it works charms. I'm about to try and integrate it with Weblogic 10.3 and EJB3.0