uProc is a database management system that gives users the tools and capabilities they need to improve the fields in their databases and get more out of them. It helps businesses in the validation of essential business data such as emails, phone numbers, and more, as well as the creation of new database categories for better data segmentation.
MongoDB is an open-source document-based database management tool that stores data in JSON-like formats. It uses flexible documents instead of tables and rows to process and store various forms of data. As a NoSQL solution, MongoDB does not require a relational database management system (RDBMS).MongoDB Integrations
It's easy to connect uProc + MongoDB without coding knowledge. Start creating your own business flow.
Triggers when you add a new collection.
Triggers when you add a new database.
Triggers when you add a new document to a collection.
Triggers when you add a new field to a collection.
Select a tool to perform verification or enrichment
Create a new document in a collection of your choice.
As mentioned in the previous chapter, uProc is a platform that supports MongoDB. It includes uProc-core and uProc-nodejs. uProc-core is an API used to manipulate MongoDB through binary protocp. uProc-nodejs is an extension of Node.js, which provides uProc-core API. uProc-core is written in C++ and it uses libbson for access to MongoDB. It is provided as a library named libmongoc. On the other hand, uProc-nodejs is an application programming interface (API. for Node.js. A web server for Node.js can be developed based on this API. If you are already familiar with Node.js, you can develop a web server by using uProc-nodejs without learning how to use MongoDB on your own. Since uProc-nodejs has many features that are not available in MongoDB itself, it will be beneficial to learn how to use it and develop web servers with it.
MongoDB is an open source document database, which is a type of NoSQL database. It is a good database when you are dealing with large vpumes of data and when you need fast responses to queries. Since each document in MongoDB is stored as a BSON (Binary JSON. value, data in MongoDB can be accessed very quickly because the data does not need to be parsed.
Integration of these two tops makes it easy to develop web servers that take advantage of the flexibility of MongoDB while using all of the tops provided by uProc-nodejs to make development easier. You can develop your own web servers based on uProc-nodejs or use the ones provided by the uProc project. There are many useful web servers provided by the uProc project, such as:
uHTTPd. a simple web server that supports HTTP only
uWSGI. a WSGI-compliant web server for Python apps
uWSGI Python Server. a WSGI-compliant Python app server based on uWSGI
uSCGI. a simple SCGI (Simple Common Gateway Interface. web server for Python apps
uWSGI SCGI Server. a WSGI-compliant SCGI app server based on uWSGI
uFastcgi. a FastCGI (FCGI. web server for Python apps
uFastcgi Python Server. a FastCGI app server based on uFastcgi
Since this book focuses on developing web applications on Google App Engine, we will only introduce how to use uHTTPd in this chapter. We will show how to develop a simple Hello World application and deploy it to Google App Engine with the help of uHTTPd. First, let’s look at the source code of “Hello World” application written in Python and developed with Flask, a microframework for Python web applications. The source code is shown in Listing 13-3.
Listing 13-3. “Hello World” Application Source Code Written in Python and Developed with Flask (helloworldapp_v0.py)
from flask import Flask, render_template
app = Flask(__name__)
if datetime.datetime.now(.hour < 10:
return 'Good Morning'
if datetime.datetime.now(.hour < 20:
return 'Good Afternoon'
if datetime.datetime.now(.hour < 18:
return 'Good Evening'
return 'Good Night'
return render_template('index.html', current_time=get_current_time(), title='Hello World')
if __name__ == "__main__":
In Listing 13-3, the “Hello World” application consists of two routes. /time and / (see line 5. When the user visits the site, he or she will see the time printed in the index page (see line 6. If the user goes to /time, he or she will see the current time printed in the index page (see line 7. This application is deployed to Google App Engine in Listing 13-4 by using uHTTPd, which we will explain later in this section.
Listing 13-4. Deployment Script of Hello World Application Using uHTTPd (helloworldapp_v0_gae_deployment_script_uhttpd_gae_version)
from apiclient import discovery
from oauth2client import client as oauth2client_client
from googleapiclient import errors
from googleapiclient import errors as google_errors
from httplib import InvalidURL, UnsupportedScheme, Timeout,
MissingSchema, InvalidHeader, InvalidCharacter,
class BaseAuthPlugin(object). # https://developers.google.com/identity/sign-in/web/authentication#client_library_implementationdef __init__(self). # Google Client ID and Secret are obtained from # https://code.google.com/apis/conspe/#project:project_number # For example, https://code.google.com/apis/conspe/#project:project_number # GOOGLE CLIENT ID AND GOOGLE CLIENT SECRET ARE REQUIRED TO USE THIS PLUGIN # https://developers.google.com/identity/sign-in/web/authentication#auth-client-id # https://developers.google.com/identity/sign-in/web/authentication#auth-client-secret # http://stackoverflow.com/questions/13053292/googleappenginehttplib2httplib2connectionpopexception-pop-entry-already-invalid # https://groups.google.com/forum/#!topic/googleappengine/XkSVxBpZApQ # https://groups.google.com/forum/#!msg/google-appengineEktX9RwUHs/jO3h5wLQVrkJ # http://codeandlife.com/2014/01/23/google-appengine-python-urlfetch/#comment-5692 # https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/_samples/iotanalytics/appengine/README # https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/_samples/iotanalytics/appengine/main_test_app_service_configuration_for_blobstore_uploader#L15 # https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/_samples/iotanalytics/appengine/_main_init_uhttpd_conf_sample#L41 # http://stackoverflow.com/questions/11606369/googleappenginehttplib2httplib2connectionpopexception Uncaught exception in thread started by _HttpRequestHandler at /home/.appengine_tmp/.turbogears._http._HttpRequestHandler1aJy4o at /home/.appengine_tmp/.turbogears._http._HttpRequestHandler1aJy4o(<bound method _HttpRequestHandler1aJy4o at 0x7f02ebb5ce50>, (). at <bound method _requestHandler at 0x7f02ebb5
The process to integrate uProc and MongoDB may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.