DZone
IoT Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > IoT Zone > Microservices Granularity for the Internet of Things

Microservices Granularity for the Internet of Things

There are a lot of parallels between the Internet Of Things and Microservices. One of the big battles in the design is the granularity of each service and the impact that can have on interdependency and network costs.

Scott Lewis user avatar by
Scott Lewis
·
Jun. 02, 16 · IoT Zone · Opinion
Like (1)
Save
Tweet
4.00K Views

Join the DZone community and get the full member experience.

Join For Free

In a 2014 blog posting, Martin Fowler discussed issues around creating networked services in Microservices and the First Law of Distributed Objects. One of his points is that networked services should generally be more coarse-grained than local (in-process) services. The reason for this is that distribution always has costs (bandwidth, performance), and these costs easily can become large with fine-grained remote calls. 


But as Fowler points out, there are good reasons (e.g. complexity) to make a networked API as fine-grained as possible. How granular/coarse should IoT microservices be? In his blog posting, Fowler suggested that granularity was an open question and that experience with different systems with different levels of microservices granularity would provide eventual insight. I agree with Fowler's view that experience is necessary to decide on 'appropriate' granularity.   I think it's particularly true for the Internet of Things, where multiple people and organizations are attempting attempting to create consistent abstractions for the relatively limited input and output capabilities exposed by newly networked devices...aka 'things'. 

But when actually defining remote services, often the first thing done is to bind the service to a particular transport+protocol+impl framework (e.g. https+json+jersey). Once bound to a transport, the service API may become very difficult to refactor and version. This is especially true once a service has been deployed, but frequently deployment is the only way to get enough real experience to be more (or less) granular!

One way to provide flexibility...and allow future change to the granularity of a service is to remain from the beginning as transport-independent as possible. As described by this article, new standards such as OSGi Remote Services/RSA and ECF's modular implementation of these specs makes transport independence much easier for the microservices designer and developer. One consequence of using such an approach is that once sufficient experience has been gained, it will be much easier to refactor a microservice to be more or less granular. It does not guarantee that all microservices granularity changes will remain possible, but it does make it easier.
microservice IoT Internet (web browser)

Published at DZone with permission of Scott Lewis, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Leverage Speech-to-Text With Node.js
  • Data Software Design Pitfalls on Java: Should We Have a Constructor on JPA?
  • The Ultimate Software Engineering Job Search Guide
  • Build a Java Microservice With AuraDB Free

Comments

IoT Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo