Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit fac33a48ffa3ebb4852874b460e1d91215e32c7e @dcramer committed Jun 20, 2012
Showing with 55 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +28 −0 README.rst
  3. +26 −0 server.py
@@ -0,0 +1 @@
+*.pyc
@@ -0,0 +1,28 @@
+MangoDB
+=======
+
+MangoDB is one of the fastest databases in existance. It allows you to store ANY KIND OF DATA you want without any IO
+bottleneck. You're only limited by the size of your pipe.
+
+If you're familiar with MongoDB then you'll feel write at home with Mango. We'll instantly map all of your existing
+data without ANY EFFORT with a new and improved AUTO SHARDING ALGORITHM.
+
+Getting Started
+---------------
+
+Run the server::
+
+ python server.py
+
+With your MongoDB client, connect to ``localhost`` on port ``6000``.
+
+That's it! You'll enjoy the same reliability as you're used to with MongoDB, but you'll get your responses so fast
+that you'll never want to go back!
+
+
+
+
+
+
+
+.. note:: If you use this you are an idiot.
@@ -0,0 +1,26 @@
+from gevent.server import StreamServer
+import os
+
+
+def mangodb(socket, address):
+ socket.sendall('HELLO\r\n')
+ client = socket.makefile()
+ output = open('/dev/null', 'w')
+ while True:
+ line = client.readline()
+ if not line:
+ break
+ cmd_bits = line.split(' ', 1)
+ cmd = cmd_bits[0]
+ if cmd == 'BYE':
+ break
+ if len(cmd_bits) > 1:
+ output.write(cmd_bits[1])
+ client.write('OK' + os.urandom(1024) + '\r\n')
+ client.flush()
+
+
+if __name__ == '__main__':
+ server = StreamServer(('0.0.0.0', 6000), mangodb)
+ print ('Starting MangoDB on port 6000')
+ server.serve_forever()

0 comments on commit fac33a4

Please sign in to comment.