Google Groups

Re: Please try new Mongodb REST server written in java using Jetty


Andyg Apr 28, 2012 8:36 PM
Posted in group: mongodb-user
I am writing this REST server firstly for my small project
There are about 910,000 entries that need to go to Mongodb
So I tried my rest server and inserted all 910000 fields doing
10,000 per http request from perl script
My mongodb rest server running on (http://hpcloud.com/pricing)
Standard Extra Small instance (which is free at the moment)
It averaged about 1000 inserts per second
I watched on server side using top command and java+mongo
two together did not take more than 50% of cpu during inserts
Not sure if it's good(fast) or not

https://sites.google.com/site/mongodbjavarestserver/home

On Apr 24, 11:04 pm, Andyg <gml...@gmail.com> wrote:
> I updated the server so queries can be cached with memcached
> Here's pagehttps://sites.google.com/site/mongodbjavarestserver/home
>
> On Apr 13, 8:08 pm, Andyg <gml...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I wrote a simpleRESTserver based  on Jetty
> > It's basically embedded Jetty with servlets
>
> > Some available features
> > can enble ssl
> > can enable ip filter
> > mongodb access (read,write,admin) based on user role
>
> > Source, need ant and JDK 1.5 or laterhttp://commondatastorage.googleapis.com/andreidata/mongoser-src.tar.gz
>
> > Binary, need JRE 1.6 or laterhttp://commondatastorage.googleapis.com/andreidata/mongoser.tar.gz
>
> > Please try and let me know
> > Thanks
>
> > Some examples with curl
> > mongoser="http://yourmongohost.com:8081"
>
> > list databases
> > curl -i "$mongohost/database"
>
> > drop database
> > curl -i "$mongohost/database?dbname=foo" -XDELETE
>
> > get db stat
> > curl -i "$mongohost/database?dbname=foo&op=stats"
>
> > list collections
> > curl -i "$mongohost/collection?dbname=foo"
>
> > get col stat
> > curl -i "$mongohost/collection?dbname=foo&op=stats&colname=test"
>
> > create col
> > curl -i "$mongohost/collection?dbname=foo&colname=test" -XPUT
>
> > add record
> > curl -i "$mongohost/write?dbname=foo&colname=test" -XPUT --data-binary
> > '{name:"foo"}'
>
> > add multi record must be separated by newline
> > curl -i "$mongohost/write?dbname=foo&colname=test" -XPUT --data-binary
> > $'{name:"foo"}\n{name:"moo"}\n{name:"cow"}'
>
> > update record, first field is condition, must be separated by newline
> > curl -i "$mongohost/write?dbname=foo&colname=test" -XPOST --data-
> > binary $'{name:"foo"}\n{name:"newfoo"}'
>
> > delete records with condition
> > curl -i "$mongohost/write?dbname=foo&colname=test" -XDELETE -d
> > '{name:"newfoo"}'
>
> > read all records in collection
> > curl -i "$mongohost/query?dbname=foo&colname=test"
>
> > with limit
> > curl -i "$mongohost/query?dbname=foo&colname=test&limit=3"
> > with limit and skip
> > curl -i "$mongohost/query?dbname=foo&colname=test&limit=3&skip=3"
> > with condition
> > curl -i "$mongohost/query?dbname=foo&colname=test" -XPOST -
> > d'{name:"newfoo"}'
>
> > list indexes
> > curl -i "$mongohost/index?dbname=foo&colname=test"
>
> > add index
> > curl -i "$mongohost/index?dbname=foo&colname=test" -XPUT -d"{name:
> > 1,age:1}"
>
> > delete index
> > curl -i "$mongohost/index?dbname=foo&colname=test" -XDELETE -d"{name:
> > 1,age:1}"