{"id":46602,"date":"2020-05-13T00:00:00","date_gmt":"2020-05-13T07:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/cromflag2-an-open-iot-stack\/"},"modified":"2025-11-13T12:54:55","modified_gmt":"2025-11-13T20:54:55","slug":"cromflag2-an-open-iot-stack","status":"publish","type":"post","link":"https:\/\/www.griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/","title":{"rendered":"CroMFlaG2 : An Open IoT Stack"},"content":{"rendered":"<p>In this blog, we will showcase the hows and whys of a simple, flexible open source IoT stack: CroMFlaG2 (CROn, Mqtt, FLAsk, GridDB, Grafana). This Internet of Things (IoT) software stack gives developers multiple options for ingesting, analyzing, and visualizing the data required to build useful IoT applications. <\/p>\n<h2>Introduction<\/h2>\n<p>With the popularity of the <a href=\"https:\/\/en.wikipedia.org\/wiki\/LAMP_(software_bundle)\">LAMP<\/a> (Linux, Apache, MySQL, PHP\/Perl\/Python) stack that powered the commoditization of the internet in the 2000s, many vendors have pushed their products into neat, tightly coupled stacks of software that ease usage and deployment. <\/p>\n<p>Some of these stacks have some adverse side effects: they promote vendor lock-in, and force the solution to fit the model that is intended by the stack. This often makes improvements, changes, or new features difficult to implement. CroMFlaG2 is intended to behave like the original LAMP stack by being open source, extensively configurable, and user modifiable. <\/p>\n<p>CroMFlaG2 has also been proven to be stable, lightweight and scalable to hundreds of thousand devices and is easy to implement traditionally or with new practices such as DevOps and Containerization; its components are well proven to work well with each other.<\/p>\n<p>They consist of <a href=\"\">Cron<\/a>, <a href=\"http:\/\/mqtt.org\/\">Mqtt<\/a>, <a href=\"https:\/\/palletsprojects.com\/p\/flask\/\">Flask<\/a>, <a href=\"https:\/\/griddb.net\/en\/docs\/documents\/1-1_what-is-griddb.php?id=sec_1_1_3\">GridDB<\/a>, and <a href=\"https:\/\/www.grafana.org\">Grafana<\/a>.<\/p>\n<h2>IoT Stack Architecture<\/h2>\n<p>Most IoT solutions consist of edge devices that contain sensors or other data generators and communicate with centralized infrastructure either directly or through a local gateway.<\/p>\n<p>The centralized infrastructure can be hosted either on a public cloud or private on-premises servers. The devices usually communicate with a separate data collector and not directly with a database but there are certain instances where it is not required.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" align=\"center\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-10-at-8.20.23-AM.png\" alt=\"\" width=\"554\" height=\"513\" class=\"alignnone size-full wp-image-26446\" alt=\"IoT Architecture\" srcset=\"\/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-10-at-8.20.23-AM.png 554w, \/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-10-at-8.20.23-AM-300x278.png 300w\" sizes=\"(max-width: 554px) 100vw, 554px\" \/><\/p>\n<p>Once the data is stored in the primary data store, other processes can perform analysis or visualize the stored data either in real time or in batches. <\/p>\n<p><img decoding=\"async\" align=\"center\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-18-at-1.53.23-PM.png\" alt=\"CroMFlaG2 IoT Stack\" width=\"433\" height=\"386\" class=\"alignnone size-full wp-image-26448\" srcset=\"\/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-18-at-1.53.23-PM.png 433w, \/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-18-at-1.53.23-PM-300x267.png 300w\" sizes=\"(max-width: 433px) 100vw, 433px\" \/><\/p>\n<p>In the CroMFlaG2 IoT Stack, the MQTT Broker and Subscriber or HTTP Flask Application act as the data collector while GridDB is the data store. HTTP Flask can also operate as an endpoint to provide real time data to untrusted applications, for example, those developed or executed by third parties outside of the data hosting organization. Meanwhile Grafana provides a platform to visualize the data and Cron is used to generate reports, invoices, etc. on predefined intervals. <\/p>\n<h2>Sending and Collecting Data<\/h2>\n<h3>MQTT<\/h3>\n<p>MQTT is a lightweight publish\/subscribe protocol that is intended for machine to machine (M2M) communication. The key advantages of MQTT are its persistent connection, low overhead (2 bytes) and its three QoS levels that ensure either that a message is sent, a message is received, or a message is received exactly once.<\/p>\n<p>The MQTT broker is a service that runs on the data collector and passes data between the MQTT publisher that is executed within the sensor or edge device and the MQTT Subscriber that reads the publisher\u00e2\u20ac\u2122s data and writes it into the data store. Popular brokers include <a href=\"https:\/\/mosquitto.org\/\">Mosquitto<\/a>, <a href=\"https:\/\/www.hivemq.com\/\">HiveMQ<\/a>, and <a href=\"https:\/\/www.rabbitmq.com\/\">RabbitMQ<\/a>, any of which can be used within the CroMFlaG2 IoT Stack.<\/p>\n<p><img decoding=\"async\" align=\"center\"  src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-17-at-8.09.56-PM.png\" alt=\"MQTT Broker as part of the IoT Stack\" width=\"706\" height=\"438\" class=\"alignnone size-full wp-image-26450\" srcset=\"\/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-17-at-8.09.56-PM.png 706w, \/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-17-at-8.09.56-PM-300x186.png 300w, \/wp-content\/uploads\/2020\/03\/Screen-Shot-2020-03-17-at-8.09.56-PM-600x372.png 600w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/p>\n<p>Data can be sent in any format but is usually binary blobs or more universal formats such as MessagePack, JSON, or XML. MessagePack is a very lightweight, binary format that can be easily serialized through data type conversion or custom packing. JSON and XML are both used extensively within industry with excellent libraries available for generation and parsing. <\/p>\n<h3>HTTP\/Flask<\/h3>\n<p>HTTP is the most commonly used network protocol, powering nearly all web traffic. HTTP has more network overhead than MQTT and does not feature QoS features but has some other advantages. First of all, HTTP is rarely blocked by network firewalls, it is simple to test and well understood by many developers, features many libraries and frameworks to build solutions with it, and is more reliable if wanting to transmit data from the centralized infrastructure to the edge device. <\/p>\n<p>On the edge or device side, <a href=\"https:\/\/curl.haxx.se\/libcurl\/\">libcurl<\/a> or more abstracted libraries such as <a href=\"https:\/\/github.com\/microsoft\/cpprestsdk\">Microsoft&#8217;s C++ Rest SDK<\/a>, can be used to send data. There are also a variety of ways to process incoming data on the data collector, one of which is Flask, a lightweight web application framework. <\/p>\n<p>The following sample code shows how curl can be used to simulate a device inserting a record, simple scripts allow for easy DevOps deployment and Continuous Integration practices. <\/p>\n<pre>$ curl -X POST --header \"Content-Type: application\/json\" \n  http:\/\/localhost:8000\/insert\/sample --data '{\n    \"deviceinfo\" : { \"deviceid\": \"sample\", \"fw_ver\" : \"12345.009\", \"batt_lvl\": 78 },\n    \"tsdata\": [\n            { \"day\": 18, \"dayofweek\": 2, \"hour\": 17, \"humidity\": 75.0, \n              \"illuminance\": 74.0, \"month\": 2, \"motion\": false, \"temperature\": 78.0,\n              \"timestamp\": 1582046738255 },\n            { \"day\": 18, \"dayofweek\": 2, \"hour\": 17, \"humidity\": 66.0, \n              \"illuminance\": 96.0, \"month\": 2, \"motion\": false, \"temperature\": 82.0,\n              \"timestamp\": 1582046748255 }, \n            { \"day\": 18, \"dayofweek\": 2, \"hour\": 17, \"humidity\": 67.0, \n              \"illuminance\": 93.0, \"month\": 2, \"motion\": false, \"temperature\": 81.0,                                      \n              \"timestamp\": 1582046758255 }, \n            { \"day\": 18, \"dayofweek\": 2, \"hour\": 17, \"humidity\": 77.0, \n              \"illuminance\": 95.0, \"month\": 2, \"motion\": true , \"temperature\": 80.0, \n              \"timestamp\": 1582046768255 }, \n            { \"day\": 18, \"dayofweek\": 2, \"hour\": 17, \"humidity\": 70.0,\n               \"illuminance\": 90.0, \"month\": 2, \"motion\": false, \"temperature\": 79.0, \n               \"timestamp\": 1582046778255 }, \n            { \"day\": 18, \"dayofweek\": 2, \"hour\": 17, \"humidity\": 66.0,\n               \"illuminance\": 86.0, \"month\": 2, \"motion\": false, \"temperature\": 77.0,              \n               \"timestamp\": 1582046788255 }\n    ]\n}'<\/pre>\n<p>An example app built with the Flask framework that enables recording of data to GridDB follows:<\/p>\n<pre>#!\/usr\/bin\/python3 -u\n\nfrom flask import Flask, request, abort\nfrom flask_cors import CORS, cross_origin\nfrom datetime import datetime\nimport griddb_python\nimport json\n\ngriddb = griddb_python\nfactory = griddb.StoreFactory.get_instance()\napp = Flask(__name__)\ncors = CORS(app)\n\n@app.route('\/insert\/<device>', methods=['POST'])\ndef post(device):\n\n    try:\n        data = json.loads(request.data)\n\n        if data['deviceinfo']['deviceid'] != device:\n            abort(500, \"malformed request\")\n\n        conInfo = griddb.ContainerInfo(\"devices\",\n                [[\"deviceid\", griddb.Type.STRING],\n                [\"batt_lvl\", griddb.Type.INTEGER],\n                [\"fw_ver\", griddb.Type.STRING]],\n                griddb.ContainerType.COLLECTION, True)\n\n        devConInfo = griddb.ContainerInfo(device,\n                [[\"timestamp\", griddb.Type.TIMESTAMP],\n                [\"motion\", griddb.Type.BOOL],\n                [\"temperature\", griddb.Type.FLOAT],\n                [\"humidity\", griddb.Type.FLOAT],\n                [\"illuminance\", griddb.Type.FLOAT],\n                [\"month\", griddb.Type.LONG],\n                [\"day\", griddb.Type.LONG],\n                [\"dayofweek\", griddb.Type.LONG],\n                [\"hour\", griddb.Type.LONG]],\n                griddb.ContainerType.TIME_SERIES, True)\n\n        col = gridstore.put_container(conInfo)\n        devCol = gridstore.put_container(devConInfo)\n        col.set_auto_commit(False)\n        devCol.set_auto_commit(False)\n\n        col.put([data['deviceinfo']['deviceid'], data['deviceinfo']['batt_lvl'],\n                 data['deviceinfo']['fw_ver']])\n\n        tsdata = []\n        for row in data['tsdata']:\n            tsdata.append([datetime.fromtimestamp(row['timestamp']\/1000), row['motion'],\n                           row['temperature'], row['humidity'], row['illuminance'],\n                           row['month'], row['day'], row['dayofweek'], row['hour']])\n        devCol.multi_put(tsdata)\n        col.commit()\n        devCol.commit()\n\n    except:\n        abort(500, \"Insert failed\")\n\n    return \"True\"\n\n\nif __name__ == \"__main__\":\n    gridstore = factory.get_store(\n        host=\"239.0.0.1\",\n        port=31999,\n        cluster_name=\"defaultCluster\",\n        username=\"admin\",\n        password=\"admin\"\n    )\n\n    app.run(host='0.0.0.0', port=8000 )<\/pre>\n<p>The device sends a HTTP POST request to the endpoint which parses the JSON and inserts the data into multiple GridDB containers. <\/p>\n<p>While not included in the above code, one big advantage of using a web framework such as Flask is the ease of authenticating devices; you can include libraries such as OAuth2 that provide a proven framework for authentication.<\/p>\n<h2>Storing Data<\/h3>\n<h3>GridDB<\/h3>\n<p>GridDB is a highly scalable, in-memory NoSQL time series database optimized for IoT and Big Data developed by Toshiba Digital Solutions Corporation.<\/p>\n<p>The Key-Container data model of GridDB extends the typical NoSQL Key-Value store. The Key-Container model represents data in the form of collections that are referenced by keys. The key and container are rough equivalents of the table name and table data in Relational Databases (RDB). Data modeling in GridDB is easier than with other NoSQL databases as we can define the schema and design the data similar to that of an RDB.<\/p>\n<p>GridDB\u00e2\u20ac\u2122s hybrid composition of In-Memory and Disk architecture is designed for maximum performance as I\/O is a common bottleneck in any DBMS that can cause the CPU to be under-utilized. GridDB overcomes this bottleneck with the \u00e2\u20ac\u02dcMemory first, Storage second\u00e2\u20ac\u2122 structure where the \u00e2\u20ac\u02dcprimary\u00e2\u20ac\u2122 data that is frequently accessed resides in memory and the rest is passed on to disks (SSD and HDD). <\/p>\n<p>GridDB scales linearly and horizontally on commodity hardware maintaining excellent performance as shown in YCSB benchmarks against Cassandra. Traditional RDBMS are built on Scale-Up architecture (add more capacity to existing server\/node). Transactions and data consistency are excellent on RDBMS. On the other hand, NoSQL databases focus on Scale-Out architecture but fare poorly on transactions and data consistency.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" align=\"center\"  src=\"https:\/\/griddb.net\/wp-content\/uploads\/2020\/03\/hybrid_cluster_management.png\" alt=\"GridDB Hybrid Cluster Management Scalability\" width=\"626\" height=\"558\" class=\"alignnone size-full wp-image-26453\" srcset=\"\/wp-content\/uploads\/2020\/03\/hybrid_cluster_management.png 626w, \/wp-content\/uploads\/2020\/03\/hybrid_cluster_management-300x267.png 300w, \/wp-content\/uploads\/2020\/03\/hybrid_cluster_management-600x535.png 600w\" sizes=\"(max-width: 626px) 100vw, 626px\" \/><\/p>\n<p>Hybrid cluster management and high fault-tolerant systems of GridDB are exceptional for mission-critical applications. Network partitions, node failures, and maintaining consistency are some of the major problems that arise when data is distributed across nodes. Typically, distributed systems adopt \u00e2\u20ac\u02dcMaster-Slave\u00e2\u20ac\u2122 or \u00e2\u20ac\u02dcPeer-to-Peer\u00e2\u20ac\u2122 architectures. The Master-Slave option is good at maintaining data consistency, but a master node redundancy is required to avoid having a Single Point of Failure (SPOF). Peer-to-Peer, though avoids SPOF, has a huge problem of communication overhead among the nodes.<\/p>\n<h2>Processing and Using Data<\/h2>\n<h3>HTTP\/Flask<\/h3>\n<p>Like using HTTP and Flask for ingesting data, HTTP and Flask are ideal for delivering data to other applications, especially those used by third parties. The benefits of using HTTP and Flask is the ease of development, the flexibility HTTP provides, and the number of different libraries and frameworks available to build the application.<\/p>\n<pre>@app.route('\/fetch\/<device>', methods=['GET'])\ndef fetch(device):\n\n    try:\n        ts = gridstore.get_container(device)\n\n        tql = \"select *\"\n        first = True;\n\n        if device != \"devices\":\n            for arg in request.args:\n                if first:\n                    tql = tql + \" WHERE\"\n                else:\n                    tql = tql + \" AND\"\n                if arg == \"from\":\n                    tql = tql + \" timestamp >= TO_TIMESTAMP_MS(\"+request.args['from']+\") \"\n                if arg == \"to\":\n                    tql = tql + \" timestamp < TO_TIMESTAMP_MS(\"+request.args['to']+\") \"\n                first = False\n        query = ts.query(tql)\n        rs = query.fetch(False)\n        columns = rs.get_column_names()\n        datadict = {}\n\n        retval=[]\n        while rs.has_next():\n            data = rs.next()\n            for col in columns:\n                if col == \"timestamp\":\n                    datadict[col] = int(data[columns.index(col)].timestamp()*1000)\n                else:\n                    datadict[col] = data[columns.index(col)]\n            retval.append(datadict.copy())\n\n        return json.dumps(retval)\n    except:\n        abort(500, \"Fetch failed\")<\/pre>\n<p>The above is a simple endpoint that allows querying of time series data optionally between timestamps. Further features are easy to add as required with the numerous data analysis tools available in python. You can also easily implement other useful additions to the Flask webframe -- like OAuth2 authentication to ensure data privacy -- or WebSockets to build real-time streaming applications. <\/p>\n<h3>Grafana<\/h3>\n<p>Grafana is an open source analytics and interactive visualization platform that can read data from many different databases, including GridDB. There are two options for using Grafana with GridDB, the first using a custom endpoint with Flask and then using JSON Datasource. The second is using the GridDB WebAPI and the native Grafana GridDB Datasource. <\/p>\n<p>With Grafana, not only can you visualize real-time time-series data in a variety of chart formats, but it is also possible to add database driven annotations or display aggregations in a table. <\/p>\n<p>It is the ideal tool for operations teams to monitor their equipment with little upfront setup.<\/p>\n<h3>Cron<\/h3>\n<p>Cron is one of the oldest utilities used to manage software and should not be overlooked; it is still quite useful due to its simplicity and effectiveness. With Cron, the desired application that performs any task can be run hourly, weekly, or monthly. In terms of the CroMFlaG2 stack, these applications usually generate daily or weekly reports or monthly invoices based on data that has been ingested.<\/p>\n<p>Cron is not only included in most Linux distributions, but it is also possible to deploy applications with Kubernetes container orchestration.<\/p>\n<h2>Conclusion<\/h2>\n<p>With the CroMFlaG2 IoT Stack, developers can build IoT solutions with open source components that adapt to their infrastructure, rather than adapting their infrastructure to the IoT software stack. With MQTT and HTTP Flask, both high velocity data streams and recurring batched data can be ingested into the GridDB data store while HTTP Flask, Cron, and Grafana provide different methods to furnish, process and visualize IoT data.  <\/p>\n<p>The HTTP Flask samples  are available at <a href=\"https:\/\/griddb.net\/en\/download\/26571\/\">here<\/a> and as a Docker image on <a href=\"https:\/\/hub.docker.com\/r\/griddbnet\/cromflag2\">DockerHub<\/a>. A PDF whitepaper can be downloaded <a href=\"https:\/\/griddb.net\/en\/download\/26458\/\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we will showcase the hows and whys of a simple, flexible open source IoT stack: CroMFlaG2 (CROn, Mqtt, FLAsk, GridDB, Grafana). This Internet of Things (IoT) software stack gives developers multiple options for ingesting, analyzing, and visualizing the data required to build useful IoT applications. Introduction With the popularity of the LAMP [&hellip;]<\/p>\n","protected":false},"author":71,"featured_media":26539,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46602","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CroMFlaG2 : An Open IoT Stack | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"In this blog, we will showcase the hows and whys of a simple, flexible open source IoT stack: CroMFlaG2 (CROn, Mqtt, FLAsk, GridDB, Grafana). This\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CroMFlaG2 : An Open IoT Stack | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"In this blog, we will showcase the hows and whys of a simple, flexible open source IoT stack: CroMFlaG2 (CROn, Mqtt, FLAsk, GridDB, Grafana). This\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-05-13T07:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:54:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.griddb.net\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Owen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Owen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/\"},\"author\":{\"name\":\"Owen\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\"},\"headline\":\"CroMFlaG2 : An Open IoT Stack\",\"datePublished\":\"2020-05-13T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:54:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/\"},\"wordCount\":1495,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/\",\"name\":\"CroMFlaG2 : An Open IoT Stack | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg\",\"datePublished\":\"2020-05-13T07:00:00+00:00\",\"dateModified\":\"2025-11-13T20:54:55+00:00\",\"description\":\"In this blog, we will showcase the hows and whys of a simple, flexible open source IoT stack: CroMFlaG2 (CROn, Mqtt, FLAsk, GridDB, Grafana). This\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg\",\"contentUrl\":\"\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg\",\"width\":2400,\"height\":1600},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66\",\"name\":\"Owen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g\",\"caption\":\"Owen\"},\"url\":\"https:\/\/www.griddb.net\/en\/author\/owen\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CroMFlaG2 : An Open IoT Stack | GridDB: Open Source Time Series Database for IoT","description":"In this blog, we will showcase the hows and whys of a simple, flexible open source IoT stack: CroMFlaG2 (CROn, Mqtt, FLAsk, GridDB, Grafana). This","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/","og_locale":"en_US","og_type":"article","og_title":"CroMFlaG2 : An Open IoT Stack | GridDB: Open Source Time Series Database for IoT","og_description":"In this blog, we will showcase the hows and whys of a simple, flexible open source IoT stack: CroMFlaG2 (CROn, Mqtt, FLAsk, GridDB, Grafana). This","og_url":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2020-05-13T07:00:00+00:00","article_modified_time":"2025-11-13T20:54:55+00:00","og_image":[{"width":2400,"height":1600,"url":"https:\/\/www.griddb.net\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg","type":"image\/jpeg"}],"author":"Owen","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"Owen","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/"},"author":{"name":"Owen","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66"},"headline":"CroMFlaG2 : An Open IoT Stack","datePublished":"2020-05-13T07:00:00+00:00","dateModified":"2025-11-13T20:54:55+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/"},"wordCount":1495,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/","url":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/","name":"CroMFlaG2 : An Open IoT Stack | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg","datePublished":"2020-05-13T07:00:00+00:00","dateModified":"2025-11-13T20:54:55+00:00","description":"In this blog, we will showcase the hows and whys of a simple, flexible open source IoT stack: CroMFlaG2 (CROn, Mqtt, FLAsk, GridDB, Grafana). This","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/cromflag2-an-open-iot-stack\/#primaryimage","url":"\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg","contentUrl":"\/wp-content\/uploads\/2020\/03\/zan-wGqz5YSqsfk-unsplash.jpg","width":2400,"height":1600},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/0f2f6d4b593adde8c43cf3ea5c794c66","name":"Owen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/47438a5c81215c7a9043be1b427e0bbd8dc0f77bd536f147f8495575149e4325?s=96&d=mm&r=g","caption":"Owen"},"url":"https:\/\/www.griddb.net\/en\/author\/owen\/"}]}},"_links":{"self":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/users\/71"}],"replies":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/comments?post=46602"}],"version-history":[{"count":1,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46602\/revisions"}],"predecessor-version":[{"id":51287,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/posts\/46602\/revisions\/51287"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media\/26539"}],"wp:attachment":[{"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/media?parent=46602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/categories?post=46602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.griddb.net\/en\/wp-json\/wp\/v2\/tags?post=46602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}