December 21, 2020

Serverless API Backend for xBrowserSync

Ever since Xmarks Sync was shutdown by LogMeIn(LastPass), I was looking for a better cross browser & cross device bookmark synchronization service. While reviewing PrivacyTools I came across xBrowserSync which looked like a better alternative.

I liked the way it has been implemented using SHA-256 hash, 250000 iterations and AES-GCM algorithm to generate the hash of the custom password provided. Additionally, xBrowserSync provides a way to configure your own API backend where you store your information. There is already an open source implementation of xBrowserSync API and a docker version available.

When it’s easy to deploy a containerzied implementation of xBrowserSync API. I wish to have it fully on-demand and therefore took a Serverless approach to implement it.

I used DynamoDB to persist the data, each DynamoDB item can be up to 400KB hence I set the size limit to 399.5KB and configured it to on-demand capacity mode as to pay only for the used read/write capacity units. Two small Lambda functions have been used to handle create-bookmark and updat-bookmark operations. I also configured per function concurrency limit to a low value as it is for personal use. API Gateway is configured to invoke these Lambda functions and all GET requests are handled by making API call to DynamoDB directly. API Gateway have been configured to lower threshold to limit the request rate.

Everything is implemented through CloudFormation template and it’s available in xBrowserSync Serverless API GitHub repository.

Here is a quick summary of how much it might cost per month in AWS Ireland region.

Service Price Dimension Cost
API Gateway 43200/month 0.15
Lambda 43200/month-128MB-2s 0
DynamoDB 300 Bookmarks/month 0.12
Total 0.27

© Prakash P 2015 - 2021

Powered by Hugo & Kiss.