AWS DynamoDB-Data-Mapper NodeJS - node.js

I am planning to use AWS Dynamo-Data-Mapper for ORM mapping while creating lambda functions in NodeJS with DynamoDB storage. This library is still under developer preview. Does anyone has experience in using this library and is there a risk of using this library since it is still under developer preview? Is there any other better NodeJS library to use for ORM with Dynamo DB.

Personally I code in Java, and the Java DynamoDBMapper is the best DynamoDB SDK by a distance. It provides object modelling, optimistic locking and more. The only other supported high level SDK at the moment is the .Net Object Persistence Model, which is frankly not even close to being as good as DynamoDBMapper.
If you are using Lambda I personally wouldn't use Java, the functions take too long to run.
The AWS supported Javascript SDK does not provide object modelling.
I've seen a few projects that try and fill the gap for a Javascript DynamoDB object mapping SDK, such as dynamoose and dynogels. Personally I wouldn't use these as you simply end up losing functionality offered by DynamoDB. But I'm sure they are good in some circumstances, like prototyping applications rapidly.
I must admit I've not used the new AWS dynamodb-data-mapper (Javascript Object SDK). However its being developed by AWS and its pretty clear they are serious about it.
Clearly using the SDK depends on your project and appetite to risk. I get a huge amount of value using DynamoDBMapper (the equivalent Java SDK). My code is massively more clean and simple than it would be in a low level SDK.

Related

ORM for cloud spanner for nodejs

Is there an implementation of ORM for cloud spanner in nodejs?
I can see that we can use the good old knex.js for mostly read operations, but that also seems more like a workaround.
If you are willing to go for unofficial and (probably) unsupported implementations, then there is this repository that adds support for Spanner to TypeORM: https://github.com/Rocketmakers/typeorm/tree/master/src/driver/spanner
It might be worth a try, and as it is open source, you have the possibility of adding features yourself. I have not tried it out myself, so I don't know how much it actually supports.
Unfortunately, I don't believe there is support for any ORMs in NodeJS at the moment. There is only ORM support for Hibernate, Spring Data and Django (beta).

DynamoDB wrapper for Node.js

What is the best npm library for dynamodb? There are quite a few on npm.
Right now my production application is running with a mongodb and mongoose.
Now things are becoming simple in Dynamodb using schema based AWS dynamodb data mapper library in Node.js
For more details, have a look on following aws package.
Data Mapper with annotation
Data Mapper package for Javascript
Advantages of using Amazon Data mapper library
Library take cares of Data marshaling
Schemas will be mapped to Javascript class entities
Similar to ORM
Developed by Amazon
There's a couple of good ones:
vogels and
dynamite
I'm using Vogels in my app at the moment, I like that it gives an extra layer of protection over your database via a Joi Schema, though it's not maintained as actively as you might like.
Dynamite is promise based and built by Medium, so it's worth a look as well.

Which NodeJS frameworks are suitable to build a complete backend for a Nativescript app (JS-based)?

I am now building a native mobile application in Nativescript, leveraging my JS knowledge.
So, I though to switch to some other Nodejs framework.
My app's backend requirements will be:
pure JS
complete backend logic (i.e. controller)
connect to a MongoDB database
RESTful
non-frontend-dependent
non-DOM-dependent
easy-yet-complete to use: should be a framework which gives strong foundations to make a solid and efficient backend for a (relatively) inexperienced backend developer (except for Java basics and experience with pure PHP)
I was considering using my existing knowledge of Meteor but I can't implement any existing experiment of using ddp and websockets in it.
Some of the possibilities I was considering to give a try to:
Loopback
Total.js
Hapi.js
Sail.js
I am fine with any JS-based framework, whether it's NodeJS based or not
I am also open to a REST API solution which exposes Meteor backend, as long as is doesn't require ddp to be usable (it's not very clear to me what are the limits of non using DDP when using Meteor)
Any concrete advice, which would eventually avoid me trying all of them, before discovering they don't work with Nativescript or don't satisfy my requirements?
SailsJs is a wrapper around express.js with many add-ons and shortcuts that eases your life and shortens the code required to write, and it's very much suitable to write RESTful apps.
HAPI and Total, I didn't use them myself, but there are very good reviews about them, but when it comes to Sails, it's the highest in popularity, hence, better tested and used, which leads to a more mature framework over the time.
Loopback is good, but it requires payment at some point of usage, and still Sails is more popular.
Meteor.js is great, but it's not the right tool for that job, and it might take you more effort to make it as an easy to use RESTful framework, not to mention the un-needed memory and processing overhead, which has it's uses, but not in RESTful case. I tried to use it to write RESTful apps but didn't feel the ease and the low memory footprint as I experienced with express and Sails.
Update
Sails has clear and easy to use MVC style, with a command line to generate apis, configure-and-fine-tune-later APIs style, which is very much needed in prototyping and PoC applications, as well as short time to market.
Update 2
Sails ORM supports both SQL and NoSQL DBs, with dozen of supported drivers out there

What is the best way to expose Cassandra REST API to web?

I would like to work with Cassandra from javascript web app using REST API.
REST should support basic commands working with DB - create table, select/add/update/remove items. Will be perfect to have something similar to odata protocol.
P.S. I'm looking for some library or component. Java is a most preferred.
Staash solution looks perfect for the task - https://github.com/Netflix/staash
You can use DataStax drivers. I used it via Scala but you can use Java, a Session object is a long-lived object and it should not be used in a request/response short-lived fashion but it's up to you.
ref. rules when using datastax drivers
There is no "best" language for REST APIs, it depends on what you're comfortable using. Virtually all languages will be able to do this reasonable well, depending on your skill level.
The obvious choice is probably java, because cassandra's written in java, the java driver from Datastax is well supported, and because it's probably pretty easy to find some spring REST frameworks to do what you want. Second beyond that would be python - again, good driver support and REST frameworks with things like django or flask+potion. Ruby driver isn't bad, lots of ruby REST APIs out there, too.

Schemaless Driver Options?

So i'm a bit conflicted. I want a quality driver/library to access that is also Schemaless, but it seems the only active MongoDB library for Nodejs is Mongoose.
Now, Mongoose is great and all, but again.. it's a Schema based library, and i don't want to use one with Mongo for this project.
So, the options i have found that fit my criteria (not Mongoose) are as follows..
Mongodb Native
Probably the most widely used option, and the foundation for other libraries, but not the most friendly. The deeply nested callbacks can quickly become ugly, im my opinion.
MongoSkin
This is a decent option, and it appears to allow a lot of access to normal Mongo constructs, but at the same time it is poorly documented and not all that active.
Mongolian
My personal preference.. but it lacks access to much of Mongo's constructs, and the project seems nearly dead.. It's basically had no activity in a year.
Mongojs
Likely the most recently active between the three wrappers, but it lacks GridFS support (that i see).
Are there any other options i am missing?
edit: Adding other libs to the list..
I'd recommend you look at either:
Directly using the native node.js library mongodb-native (upon which all these are based).
mongojs, which minimally wraps the native library to emulate the official mongodb API as much as possible.

Resources