DZone
Database 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 > Database Zone > API Design Choices - Sharding Status for Failure Scenarios

API Design Choices - Sharding Status for Failure Scenarios

Oren Eini user avatar by
Oren Eini
·
Jun. 01, 12 · Database Zone · Interview
Like (0)
Save
Tweet
3.98K Views

Join the DZone community and get the full member experience.

Join For Free

this post conclude this week’ series of api design choices regarding how to handle partial failure scenarios in sharded cluster. in my previous post ,  i discussed my issues with a local solution for the problem.

the way we ended up solving this issue is actually quite simple. we apply a global solution to a global problem, we added the ability to inject error handling logic deep into the execution pipeline of the sharding implementation, like this:

image

in this case, as you can see, we are allow requests to fail if we are querying (because we can probably still get something from other servers that will be useful), but if you are requesting something by id and it generates an error, we will propagate this error. note that in our implementation, we call to a user defined “notifyuserinterfaceaboutserverfailure”, which will let the user know about the error.

that way, you probably have some warning in the ui about partial information, but you are still functional. this is the proper way to handle this, because you are handling this once , and it means that you can handle it properly , instead of having to do the right thing everywhere.

API Design

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Fintech and AI: Ways Artificial Intelligence Is Used in Finance
  • APIs Outside, Events Inside
  • Migrating From Heroku To Render
  • Counting Faster With Postgres

Comments

Database Partner Resources

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