Coder Social home page Coder Social logo

rtable's Introduction

Azure Replicated Table Library

RTable ("Replicated Table") is a library that provides synchronous geo-replication capability over the Azure Table service. The library is self-contained and has no service dependencies, making it an excellent tool for disaster recovery and business continuity scenarios on Azure.

RTable Summary (refer to the docs folder for details)

RTable provides synchronous geo-replication for Azure tables, thereby enabling zero-RPO availability and disaster recovery in the event of Azure table failures. Clients continue to benefit from the amazing scale, lower cost and manageability of Azure storage while gaining disaster tolerance. The protocol is optimized for read-latency โ€“ which is the same as for a regular Azure table read. In addition, recovery actions, such as re-introducing a replica, do not impact read or write availability. The protocol runs entirely from client-side and does not require any external service. Customers control the number and location of regions for replication. For more detailed documentaton, refer to the docs folder.

Latest: See a talk on RTable at Facebook's Networking@Scale

https://www.youtube.com/watch?v=ktXYnSvHbZ4&feature=share

Pros

  • Synchronous geo-replication over Azure tables to enable zero RPO availability and disaster recovery.
  • Very minimal change needed to an existing Azure table client. Many existing tools, such as, storage explorer, continue to work without any change.
  • Read latency same as without replication.
  • No external service is required.

Cons

  • Increased write latency. The latency depends on the locations chosen.
  • Write latency increases linearly with the number of replicas. Since the underlying Azure tables are highly durable, the main design goal of the protocol was to provide availability in the event of temporary Azure table outages. It is best suited for replication across two or three regions.
  • The protocol runs on the client side. So any changes to the protocol will require clients to update the library.

Technical Attributes of note

The RTable protocol provides strong consistency and as such is best suited for applications that need zero RPO recovery. The protocol favors Consistency and Partition Tolerance in the CAP theorem. Table operations may experience failure in the event of an Azure table failure until the faulty replica is taken out of rotation. Our goal is to limit this unavailability period to be less than five minutes.

Getting Started with RTable

Building source code

To get started, clone the repo and build using msbuild or Visual Studio.

The RTable library has the following build dependencies (NuGet packages):

  • Azure storage library: WindowsAzure.Storage.8.7.0 (and its own dependencies)
  • JSON.NET: Newtonsoft.Json.10.0.3
  • Configuration: Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0
  • NUnit Framework
  • FiddlerCore

The dependent packages will be automatically downloaded using NuGet.

Tests

A comprehensive suite of tests can be found under the Test folder. To run unit tests:

  1. Build the entire solution including Tests.csproj
  2. Go to folder: test\bin
  3. Update the RTableTestConfiguration.xml to update the storage account names and keys (replace the ******). You need three storage accounts.
  4. Download nunit.Runners package
  5. Run nunit-console.exe test\bin\Microsoft.Azure.Toolkit.Replication.Test.dll to run all tests

NuGet

At this time, the RTable library is only being released as a source download. To use the component, a developer will need to build it themselves.

In the future, as the library matures, a great experience, including published NuGet packages, will appear. Thanks for your patience.

Compared with Azure Table Geo-replication

The Microsoft Azure Storage Service supports creating accounts with geo-replication enabled. The replication provided by the service works with a paired region and is an excellent choice for replication.

However, the replication does not happen as quickly. When zero RPO is preferred, this library can help make that happen.

RTable History

A component initially built for use by the Azure Network software engineering team at Microsoft, rtable is a replication library that provides strong consistency and is easy to use, built on top of the existing Azure Table experience you may be familiar with from the Azure Storage SDK.

Contributing to RTable

Please feel free to open bugs and issues on GitHub.

For information about contributing to Azure open source projects, see the general guidance, including the legal CLA requirement, here: http://azure.github.io/guidelines.html#cla

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

azure-rtable ver. 0.9

Copyright (c) Microsoft Corporation

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

rtable's People

Contributors

abagarwamsft avatar ashwinmurthy avatar jeffwilcox avatar karnamsft avatar kasbaia avatar microsoft-github-policy-service[bot] avatar parveen-patel-msft avatar srinathsetty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtable's Issues

Implicit reliance on global synchronized clocks

This isn't necessarily a "bug", but it does need explicitly called out in the documentation.

In ReplicatedTable.cs, there is a fair bit of logic that is deciding whether or not a lock has expired based on the clients clock (via calls to DateTime.UtcNow. The trouble with this is that any client clock which has drifted may inadvertently begin experiencing unexpected behaviors.

For example, in ReplicatedTable.cs lines 715 and 1400, we have the following conditional checks:

if (DateTime.UtcNow >= currentRow._rtable_LockAcquisition + this._configurationWrapper.GetLockTimeout()) {...}

Since rtable runs on the clients, the assumption in this code is that all clients have stable clocks - which, as we know is not a trivial assumption to make.

Continuing the previous example, if we consider a client clock that has drifted ahead. If this case, the client will begin evaluating this condition as True, thereby allowing Flush2PC to proceed when it should have not. Likewise, a client who has drifted behind, will likely never be able to flush writes, since the above condition will end up returning False most of the time.

Apart from documenting the assumption of consistent global time (which needs to be called out), has any thought been given to moving away from wall-time? For example, storing a vector/logical clock in the entity metadata, and implemented standard Lamport-style logic in the clients to determine whether they are behind or not, etc.

Implement caching of views in the rtable code

When a view changes, the rtable client must continiue to use the older view till its lease expires. To do this, it must operate on a cached view and check for its validity before each transaction

Support batch operations

With the latest changes in repair and write protocols, batch operations were not brought up to speed.

Implement auto-reconfiguration

  • Detect storage failure. Log critical event when outage is detected.
  • If auto-reconfiguration is enabled, any client (preferably elected leader by taking leases on configuration blobs) can reconfigure the chain.
  • Similarly, any client should be able to re-introduce a replica once it detects that storage is back online.
  • build some kind of hysteresis control.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.