looking for a sample of MongoDB benchrun - mongodb

I would like to run a benchmark using mongodb benchrun that will create a lot of load on the backend storage. and at the same time will be representative of real application workloads.
If somebody has some js code ready, would be appreciated.

You can take a look in MongoDB repository on github - there are multiple performance tests that use benchRun. https://github.com/mongodb/mongo/tree/master/jstests has some in bench_xxx.js files.
You can also look at some sample scripts I have here:
https://github.com/asya999/bits-n-pieces/tree/master/benchRun

Related

Using MongoDB Atlas with Flutter

I want to create a Flutter mobile application and I want to use MongoDB Atlas as a database. Is there a Flutter package available that can help me with that?
If not, is there any other way I can connect Flutter to a MongoDB Atlas Database? If there isn't, what other options do you suggest?
Thank you in advance.
you can use the package mongo_dart, here is the catch in the database URL give URL to your MongoDB atlas database and you will be able to perform all the crud operations as usual. The documentation is pretty well written so you wouldn't have to face any pro
As #JideGuru said, what you'll want is some form of API that you can then make requests to from your app.
i.e. Instead of accessing your DB directly, you'd do something in Flutter like http.get("yourserveraddress.com/getSomethingWithThisNumber/1") using the HTTP package.
I'd recommend looking at something like Node.JS (https://nodejs.org/), which is a runtime for Javascript that allows it to be ran on servers. I'm just getting started with it and for basic CRUD (Create, read, update, delete) operations on my SQL database its been perfect. I'm not a JS developer by any stretch, but it is easy enough to pick up.
You really should never have your database being directly accessed by a client, as that means leaving it exposed on the internet!
MongoDB have their own driver for NodeJS, I've used it with atlas and it seems solid.
(https://mongodb.github.io/node-mongodb-native/)
Hope this helps!

MongoDB + Google Big Query - Normalize Data and Import to BQ

I've done quite a bit of searching, but haven't been able to find anything within this community that fits my problem.
I have a MongoDB collection that I would like to normalize and upload to Google Big Query. Unfortunately, I don't even know where to start with this project.
What would be the best approach to normalize the data? From there, what is recommended when it comes to loading that data to BQ?
I realize I'm not giving much detail here... but any help would be appreciated. Please let me know if I can provide any additional information.
If you're using python, easy way is to read collection chunky and use pandas' to_gbq method. Easy and quite fast to implement. But better to get more details.
Additionally to the answer provided by SirJ, you have multiple options to load data to BigQuery, including loading the data to Cloud Storage, local machine, Dataflow any more as mentioned here. Cloud Storage supports data in multiple formats such as CSV, JSON, Avro, Parquet and more. You also have various options to load data using Web UI, Command Line, API or using the Client Libraries which support C#, GO, Java, Node.JS, PHP, Python and Ruby.

Running javascript function on server using Mongo driver without $eval

we have a Ruby server application running on MongoDB.
We need to run function on a server which calculates sizes of objects per customer. We used db.command(:$eval...) for this however that's not deployable to production because such app would require rights to the whole db.
We were investigating to use db.system.js.save() . It is possible to run such a saved function withou using db.command(:$eval...) ?
Or would be other options for this? I'm currently also looking at the possibility to use mapReduce for this.
Thanks in advance,
Michal

How to visualize data from a Postgresql in Kibana?

I need to some visualize data from a Postgresql in Kibana. I have also ElasticSearch installed just in case. So how visualize data from a Postgresql in Kibana? Of course, I don't need the whole database, but only data returned by a custom sql query.
Also, I want it to be as simple as possible, I wouldn't like to use libraries I really don't need to use.
Kibana was built with Elastisearch in mind.
Having used it quite a lot in a startup I worked for, I can tell you that even the front-end query DSL (built on Lucene) will only work with Elasticsearch (or might need some serious tweaks).
I would advise you to push your data into Elasticsearch, and just work with Kibana the way it was made for :)

Backend stored procedure schedulers in MongoDB database

Currently we are using apache flume framework to collect the logs from all our web applications and it will store the logs in MongoDB database table called “Raw_Data”.
Now we got a task to differentiate the logs and store the logging information in different tables based on the application. So we decided to maintain a separate table for each application. Is there any way to create and run stored JavaScript on a frequency like scheduler to load the data application wise in MongoDB?
I’m very much familiar with oracle DB but I’m new to MongoDb. Can someone help me to find out the required things for this asap.
Thanks
Kishore
MongoDB has stored Javascript procedures, but no scheduler.
http://docs.mongodb.org/manual/tutorial/store-javascript-function-on-server/
You could trigger this from a client machine using a cron job and the mongo shell. However, I strongly recommend simply running a script in Python or similar client-side scripting language. It'll be far easier to version-control and to debug than server-side Javascript.