I have been following this tutorial and it has given me great insight into linking up a mongodb and getting back google authentication. However, I want to use dynamodb, and I found this to hook up a localhost dynamodb to test out my theories, but I am not sure how to swap out mongoose - because I don't want it linking to a mongodb, or can I use mongoose for the schema and tell it to write to a dynamodb? Not sure. Thanks for any guidance in advance. I'm new to aws if you can't tell.
Mongoose is a library for connecting to MongoDB. I believe your question title should be "DynamoDB instead of MongoDB".
You can't use Mongoose to connect to DynamoDB. There are many differences between MongoDB and DynamoDB. If you want to use DynamoDB with your NodeJS application you should look into using the AWS SDK for NodeJS.
Please be aware that there are major differences between MongoDB and DynamoDB. It's not going to be trivial to take a MongoDB tutorial and modify that to work with DynamoDB. I highly recommend you read up on DynamoDB and understand its restrictions and limitations before committing to using it.
Related
I have a Flask microservice that needs to save a form post to both AWS DynamoDB (thru boto3) and to Elastic Search DB (running on EC2). I first considered writing a Python AsyncIO server to implement a broker/Observer pattern but it looked like re-inventing what Rabbitmq/Redis PubSub already does. However, I couldn't find straight forward documentation (both doc sites) and therefore, I am looking for an example of this common pattern. Any pointers would be helpful and I will appreciate your help.
Thanks,
Looks like you are using AWS already, so why not use SNS. You can create a form_post_topic with two subscribers (DynamoDB and ElasticSearch) and you send messages to that topic.
I 'm not sure if this is the correct platform to ask architecture related question, actually I have a webapplication developed in nodejs & typescript hosted in AWS, and the backend is mongodb and my requirement is to include a search box with wild card & auto suggest search functionality so when I start typing on the text box, it will autosuggest just like we do in google search, so how would I achieve this, querying everytime to mongodb will be kind of slow and if 100's of user start doing that, then my application might start dangling so need your suggestion.
Not tried as this more of architecture help required
Not tried as this more of architecture help required
It's not a very detailed answer but may point you in a direction.
I just built something similar using AWS Lambda, ElasticSearch and API Gateway.
ElasticSearch is great for text searches but needs to be populated with indexed data.
If your dataset is changing, you will have to remember about updating ElasticSearch.
API Gateway routes requests from HTTP to Lambda, of which there are two:
one for analysing data in my data warehouse and producing indices for ElasticSearch, the other for doing the actual search and returning results.
I have a working Django web application that currently uses Postgresql as the database. Moving forward I would like to perform some analytics on the data and also generate reports etc. I would like to make use of Amazon Redshift as the data warehouse for the above goals.
In order to not affect the performance of the existing django web application, I was thinking of writing a NEW Django application that essentially would leverage a READ-ONLY replica of the Postgresql database and continuously write data from read-only replicas to the Amazon Redshift. My thinking is that perhaps the NEW Django application can be used to handle some/all of the Extract, Transform and Load functions
My questions are as follows:
1. Does the Django ORM work well with Amazon Redshift? If yes, how does one handle the model schema translations? Any pointers in this regard would be greatly appreciated.
2. Is there any better alternative to achieve the goals listed above?
Thanks in advance.
I have installed CakePHP 3 using directions from this tutorial:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/php-cakephp-tutorial.html
It is working perfectly and actually installation was quite easy. There is PHP, CakePHP, MySQL working and also I noticed that the newest AWS SDK as whole is installed in vendor directory. So I am fully set to use also DynamoDB as my data source. You might ask why I should use DynamoDb since I am already using MySQL/MarianDB, this is because we have an application that is already in production and it is using DynamoDB. But we should be able to write admin application using CakePHP in top of DynamoDB. This is not technical decision but coming from business side.
I found good tutorial written by StarTutorial how to use DynamoDB as session handler in CakePHP 3:
https://www.startutorial.com/articles/view/using-amazon-dynamodb-as-session-handler-in-cakephp-3
Well, there is not long way to using DynamoDB for putting data, getting data and doing scans, isn't there? Do you have any simple example how to do it, how to write data to DynamoDB or do scan?
I have also read the article:
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GettingStarted.PHP.html
and this is working fine, no problem. But I would like to all the advantages of the CakePHP 3, templating, security and so on, thousands of hours time saved with well written code and very fast to start coding for example admin console :)
Thank you,
You could create a Lambda function (in case you want to go serverless) or any other microservice to abstract communication with your DynamoDB. This will definitely simplify your PHP code. You may call Lambda functions directly (via API Gateway), or post messages to SQS for better decoupling. I would recommend the use of SQS -- you'll need some kind of microservice anyway to consume messages and deal with your DynamoDB in a CQRS fashion. Hope it helps!
Thank you for your answer, I was looking for a example how to use the AWS SDK for DynamoDB without creating more complexity to this environment as it is. This way I would have to create yet another layer without using the SDK that already exists. Can you please give wokring example how AWS SDK is used from CakePHP 3 so that it can use DynamoDB as a data source for its applications without losing it´s own resources an capabilities (MVC, security etc).
Thank you,
After a hard debug and found bugs I was able to get it working with only using AWS SDK in CakePHP 3.
Being new with the Play Framework, I'm wondering if it's easier than I think, but is it possible to use DynamoDB with the Play Framework?
As DynamoDB is a NoSQL database, I expect that you would need to use a specific module, which as Dynamo was only recently announced, a module does not exist.
If you are interested in writing your own module, then using Mongo (http://www.playframework.org/modules/mongo-1.3/home) as a starting point (also NoSQL), will give you a good guide on how this has been achieved in other implementations.
Yes, you can use DynamoDB with this library https://github.com/seratch/AWScala It seems to be pretty well