{"id":724,"date":"2018-06-08T04:47:06","date_gmt":"2018-06-08T01:47:06","guid":{"rendered":"http:\/\/kusuaks7\/?p=329"},"modified":"2026-05-21T11:16:49","modified_gmt":"2026-05-21T11:16:49","slug":"database-as-a-microservice-stateless-in-a-stateful-world","status":"publish","type":"post","link":"https:\/\/www.experfy.com\/blog\/iot\/database-as-a-microservice-stateless-in-a-stateful-world\/","title":{"rendered":"Database as a Microservice: Stateless in a Stateful World"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"724\" class=\"elementor elementor-724\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-7e7643f0 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"25103\" data-id=\"7e7643f0\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-31ee36a8\" data-eae-slider=\"86835\" data-id=\"31ee36a8\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1ceae96f elementor-widget elementor-widget-text-editor\" data-id=\"1ceae96f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<strong><em>Ready to learn Internet of Things? <a href=\"https:\/\/www.experfy.com\/training\/tracks\/internet-of-things-training-certification\">Browse\u00a0 IoT Training and Certification courses<\/a> developed by industry thought leaders and Experfy in Harvard Innovation Lab.<\/em><\/strong>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-925001d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"97435\" data-id=\"925001d\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-50a09fe\" data-eae-slider=\"30855\" data-id=\"50a09fe\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-cddcd41 elementor-widget elementor-widget-heading\" data-id=\"cddcd41\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><h2>Evolution of Stateless Computing<\/h2>\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-abb8c42 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"2286\" data-id=\"abb8c42\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4b274f2\" data-eae-slider=\"21151\" data-id=\"4b274f2\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c291278 elementor-widget elementor-widget-text-editor\" data-id=\"c291278\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tMicroservices have become dominant over the last few years, so much so that it is hard to imagine encountering a modern application built with a SOAP API. The wide spread usage of stateless microservices has allowed for modern applications to be easily and quickly deployed horizontally and directly on the edge. \u00a0The lightweight nature of REST APIs due to their statelessness, have allowed for applications with less overhead, quicker integration times, and a much more enjoyable programming experience. \u00a0Microservice adoption at both the application and middleware layer have driven much of the advances in edge computing.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-8ed6f3c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"5171\" data-id=\"8ed6f3c\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-9495f05\" data-eae-slider=\"7897\" data-id=\"9495f05\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-1287032 elementor-widget elementor-widget-heading\" data-id=\"1287032\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><h2>Databases living in a Past State<\/h2>\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-9a0e201 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"39809\" data-id=\"9a0e201\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7493369\" data-eae-slider=\"32341\" data-id=\"7493369\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7869f12 elementor-widget elementor-widget-text-editor\" data-id=\"7869f12\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tDatabases on the other hand are lagging behind. \u00a0Many databases today still rely on statefulness which prevents them from being utilized directly as part of a microservice architecture. \u00a0Often it makes more sense for developers to buffer them with a middleware layer or in some cases even a caching database to protect both the database and the application.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-cecd591 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"81815\" data-id=\"cecd591\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2da4de1\" data-eae-slider=\"77401\" data-id=\"2da4de1\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c94c777 elementor-widget elementor-widget-text-editor\" data-id=\"c94c777\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tThis has major disadvantages from a capital and performance perspective. \u00a0Companies have invested heavily in IoT devices; yet need to double that spending on cloud infrastructure. Furthermore, we have heard from developers where latency between the edge and the cloud is causing usability issues as well as crashes in some cases.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-1c03b3b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"5177\" data-id=\"1c03b3b\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d191f3b\" data-eae-slider=\"18935\" data-id=\"d191f3b\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8848cbb elementor-widget elementor-widget-text-editor\" data-id=\"8848cbb\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tMost SQL databases today, like\u00a0<a href=\"https:\/\/www.voltdb.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">VoltDB<\/a>\u00a0and<a href=\"https:\/\/www.sap.com\/products\/hana.html\" target=\"_blank\" rel=\"noopener noreferrer\">\u00a0SAP HANA<\/a>, are heavily focused on in-memory indexes, which is great for a read only scenario, but suffers massively under a read\/write or\u00a0<a href=\"http:\/\/data-informed.com\/htap-what-it-is-and-why-it-matters\/\" target=\"_blank\" rel=\"noopener noreferrer\">HTAP<\/a>\u00a0scenario. The statefulness of these in-memory databases create problems like out of memory exceptions which lead to crashes, and make them an unreliable platform to directly call as a microservice. \u00a0Furthermore, because of their statefulness, when recovering from crashes they take a long time to restore state, and as a result can lead to a long outage.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-89a8971 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"23359\" data-id=\"89a8971\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-d5e133f\" data-eae-slider=\"27761\" data-id=\"d5e133f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d5b34c4 elementor-widget elementor-widget-text-editor\" data-id=\"d5b34c4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tNoSQL databases do not suffer from these same problems generally. However, they are difficult to use as HTAP databases as they are slow when attempting to perform advanced analytics and querying due to their structure. \u00a0Trying to use them for advanced analytics requires a lot of CPU and memory when performing multi-table queries or complex filters. \u00a0This makes it risky to use them as a microservice back end or IoT Database as this could lead to crashes. \u00a0The memory and CPU usage is due to their need to transform the data from a NoSQL model to a SQL model; hence the term multi-model.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-8f5cced elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"17300\" data-id=\"8f5cced\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4647323\" data-eae-slider=\"68773\" data-id=\"4647323\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8b78b13 elementor-widget elementor-widget-text-editor\" data-id=\"8b78b13\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tTo solve these problems in edge computing and industrial IoT most developers today are relying on some form of caching mechanism on the edge, and then migrating their data from their IoT devices back to the cloud to live in their data warehouse. \u00a0This is expensive, complex, and slow.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-a2c98de elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"21579\" data-id=\"a2c98de\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-87e5834\" data-eae-slider=\"44730\" data-id=\"87e5834\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e4f81a1 elementor-widget elementor-widget-heading\" data-id=\"e4f81a1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><h2>Middleware and ORM Slowing You Down<\/h2>\n<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-69ff52e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-eae-slider=\"77734\" data-id=\"69ff52e\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-416ac30\" data-eae-slider=\"64396\" data-id=\"416ac30\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6138fa4 elementor-widget elementor-widget-text-editor\" data-id=\"6138fa4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tAnother reason most folks do not use databases directly on the edge as a microservice platform is because they need ORMs and middleware to communicate to them. \u00a0While many databases today might support REST APIs it is not necessarily their recommended protocol. \u00a0As a result developers need some way to transform result sets returned by databases into usable objects. Often they will rely on ORM tools like Hibernate (<a href=\"http:\/\/hibernate.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/hibernate.org\/<\/a>) or Mongoose (<a href=\"http:\/\/mongoosejs.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">http:\/\/mongoosejs.com\/<\/a>). \u00a0These tools are terrible on performance and require a lot of overhead. \u00a0It would be ill advised to attempt to run an ORM directly on the edge. \u00a0In addition to their performance impact they require a lot of configuration and maintenance, and in an Industrial Internet of Things use case where you could have millions of connected devices it would be a nightmare to maintain an ORM on each of them.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Microservices have become dominant over the last few years, so much so that it is hard to imagine encountering a modern application built with a SOAP API. The wide spread usage of stateless microservices has allowed for modern applications to be easily and quickly deployed horizontally and directly on the edge. &nbsp;The lightweight nature of REST APIs due to their statelessness, have allowed for applications with less overhead, quicker integration times, and a much more enjoyable programming experience. &nbsp;Microservice adoptions at both the application and middleware layer have driven much of the advances in edge computing.<\/p>\n","protected":false},"author":292,"featured_media":3869,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[195],"tags":[93],"ppma_author":[1835],"class_list":["post-724","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-iot","tag-internet-of-things"],"authors":[{"term_id":1835,"user_id":292,"is_guest":0,"slug":"stephen-goldberg","display_name":"Stephen Goldberg","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","author_category":"","user_url":"","last_name":"Goldberg","first_name":"Stephen","job_title":"","description":"Stephen Goldberg is the CEO of&nbsp;<a href=\"http:\/\/www.harperdb.io\/\" target=\"_blank\" rel=\"noopener\">HarperDB<\/a>. He has previously founded two startups, and most recently was CTO at Phizzle, Inc. managing product, engineering, product marketing, and support. He has worked at companies large and small including Red Hat, Inc. where he led Infrastructure for their Global Support Services division. Stephen has 4 pending patents and has been a speaker at both Salesforce.com&rsquo;s &nbsp;Dreamforce as well as SAP&rsquo;s Sapphire."}],"_links":{"self":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/users\/292"}],"replies":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/comments?post=724"}],"version-history":[{"count":0,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/724\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media\/3869"}],"wp:attachment":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media?parent=724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/categories?post=724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/tags?post=724"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}