Image for post
Image for post
Redis setup

Redis is a very popular in-memory database when it comes to caching. This post covers the basic configurations for setting up a Redis instance in docker.

Directory Structure

Create a directory named redisdb and ensure the following file structure.

redisdb/
├── data/
├── redis.conf

The data directory will contain the snapshots taken over time (as .rdb and/or .aof).

The redis.conf file will contain the instance configurations.

Configurations

The below configurations are what seems important in general. Rest can be left to defaults.

bind 0.0.0.0       # bind to all available interfaces
protectedmode no # since we're not serving over localhost
port 6379 # default…


Image for post
Image for post

If you’re coming here for the first time, please take a look at the prequel Self-Hosted MongoDB.

Alright then, picking from where we left off, let’s get started with the data migration.

Now, the basic steps to migrate data from one MongoDB to another would be:

  1. Create a zipped backup of the existing data
  2. Dump the data in a new DB

This is very straight forward when the source database is not online. Because we know for sure that there won’t be any new documents created/updated during the migration process.

Let’s look at simple migration first before diving into the live scenario. …


Image for post
Image for post

You’re probably hosting your MongoDB on a reliable cloud service provider say Atlas for instance because you really want to focus on your idea and delegate all the subtle key management areas such as networking, storage, access, etc.

It all looks good initially until your small idea starts turning into a business and the cost starts skyrocketing. Even if that is not the case, this post will still give you a general overview of the technical complexities involved (and bucks saved!) if you were to migrate to a self-hosted solution.

BTW, how much savings are we talking about? Let’s do a quick comparison between an Atlas instance and a self-hosted MongoDB on AWS. …


Hi there! This is my first post so far on Medium. It covers customizing and extending the built-in service worker in a React application curated using CRA boilerplate.

What is a service worker?

A service worker is a script that runs on a background thread and acts as a network proxy for the web application. It has capabilities such as intercepting all network requests within specified scope, caching files, background sync, push notification, etc which makes it very useful for adding offline support in a site or building a PWA(Progressive Web App).

Image for post
Image for post
Service worker overview

About

Chinmaya Pati

Software Engineer @ LoginRadius | Enthusiast about web-dev, databases and design systems.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store