Tag Archives: Syncthing

Home Data Backup & Redundancy Practices

My desire to draft this post was inspired by a recent pic from X, former Twitter.

Storage Pool 2 (Damaged)

My career is over.

I set up RAID 10 for four HHD disks, but two of them became faulty within two hours. They have persisted my code for the past seven or eight years.

Tomorrow, I am going to try some enterprise-level data recovery services. When I saw DAMAGED, my heart stopped.

I bought two WD disks and two Seagate disks from different batches on purpose, but they still crashed simultaneously.

I am using this chance to note down my practices of home data backup and redundancy against what I balance with privacy.

Let me start with this pic above. As a long-term user of NAS, I also encountered a situation where two disks were faulty nearly at the same time. At that moment, I just started to use NAS, so my dependency on NAS was pretty weak. Once I found one of the disks got down, I directly shut NAS down and ordered a new disk. Less than half an hour after I replaced the faulty disk with the newly procured one, another disk got down as well. So, if I had not shut the NAS down previously, I would have faced data loss.

As my dependency on the NAS got stronger, I found that it was tough for me to shut the NAS down when there was a faulty disk. Not to mention that the delivery in Singapore is much slower than in China, and waiting for one week for a new disk is not rare, so I was thinking of how to reduce the concurrence of two faulty disks without shutting the NAS down.

When one disk gets down, besides shutting the NAS down, lowering the disk IO, etc, reducing the concurrence of the failure of the second disk is not an easy thing. So, from my perspective, it is more realistic to reduce the failure duration of the first disk by setting up a standby disk.

How to Reduce the Risk of Double Faulty Disks for NAS: Standby Disk

The NAS I always use is 4-bay, but I only use three of the four disks to create a storage pool with Synology Hybrid RAID (SHR) enabled. The fourth disk is a standby disk instead of part of the storage pool.

  1. When a faulty disk is found in the storage pool, I will immediately replace it with the standby disk and remove it from the NAS.
  2. I will order a new disk. After I receive it, I will install it in the NAS as a standby disk. This will maximize the reduction of the failure duration of the first disk.
  3. But if another disk fails when the newly procured disk is on the way, I will still shut the NAS down as well.
//www.plantuml.com/plantuml/png/XPAnRi8m48PtFyNLKnaoaD2jYXWgf2uKbR5qCFWAKHrRSfoYgEgxrnIHvCAbC5d_7VQNxsvU1UL3NHfn5mvO8gXZbJYlx1w5C6gB1kJI-L8PASI7Lx53haDis2Eid3CmbV0j07RAQv1FHVKP4q63T1XaKlm8qGjciB7tww2itZOJsJwSd7zvbxnOX8MgJMZWz4T9RfcURbcemg3Us5SitHVgoHWsHEuX9ro1NYKpYEmKa18kyMWQM7ctgptgFqfujj6oYLYKzs7mrJmd2ygGCgXdLd4P83mcRuT2QxJlITuRrkN4rTEsdhBrhArdR9rEbcN9oQ2xCsbX9Z-CcFV7T-A_Aki1EX70cu1E1OouuAcf2Qg2SN5xnsuqK3P-5xcKzz8NCsQchsRCJUoPezLrQNu1
Reduce the failure duration of the first disk by using standby disk

If something happens often enough, it will be inevitable regardless of its low probability.

Anything that can go wrong will go wrong.

Murphy’s Law

Obviously, putting eggs into one basket, NAS, is not reliable; after all, RAID is not data backup but data redundancy. As I mentioned in my previous post, Unconventional Usage of LazyCat MicroServer, I still rely on LazyCat MicroServer to backup some important data, such as photos, as shown in the following figure:

https://www.plantuml.com/plantuml/png/TPBFRl8m4CJlVehzSlfw80-08WGguWHL9THJrSFMNeWb_q6R3HAj-kvjY5M3eQSecTdVPCUUTu8ilNVgdxJa2JmAiSL9xCNPG0grH8QNZbYf7QCdgDRuSNf4WOtL7BV4H-8AFXN0WQEchikEXNllVNMfR4z1Isl37eRFk-WCCLHd7wpIc_fAKMTxT75_WgV5zZeZIyzjbDZTJ_ahv9oXaGsiQK_1NA4NXuEp6iN6aCV7EGKm_jcIZbRJG1cgWMRosbfZABpD4b5TKA2fivn0u-DAISmiPQreGgdSOpEP5Rl1T51LqUfep7F9zlyNl2719Gf2cbXP9yHa7igm6qRge3RrxFPSOFgZNZYAsv7qOeEcxk-nYfsIhoIgEGNJU_SD
Dual Usage of Synology Photos & LazyCat Photo App

In fact, for such important data as photos, this is still far from enough. After all, the NAS and LazyCat MicroServer are both at home and strictly speaking, this does not count as off-site disaster recovery. So, I also use cloud storage to build an accepted version of 3 data centers in 2 locations 😂.

Accepted Version of “3DC in 2LOC”

I did a bit of simple thinking before confirming the implementation plan:

  1. Family photos, in my opinion, are extremely private data, so I have always hesitated to store them in cloud storage. Considering the limitation of local storage regarding data security, I had to compromise and accept uploading encrypted photos to the cloud. Ultimately, I preferred Syncthing because it supports encrypting the data before syncing.
  2. Cloud storage should offer high guarantees regarding privacy protection, compatibility, and stability, so I ultimately chose Google Drive.

Thus, the plan was confirmed.

//www.plantuml.com/plantuml/png/XP3DQiCm48JlUegfxdg1K4nA-dFfJy77qeEGDhP0Fs4j1zpITo_6IXEd3Zb9OaRVpkowovfp7xouoIq5Gj2Ps6cL-knT926sh0D1FkklOQCpNfpXL1FlYIM-1R3ZPAZh8EiXcjows40AO9ky9OPyBAVuEQ16O_Af6V1wLrzY_4US4juYuNrpSVuim4CqFEmoMPGeKnRZKsyXdr9gFE6UtPwa4CirRzL7wwob-Acgi_XNVrH_QKKfCgeLZcbNu_KWOb9FbraCitvGrMApuZrQhy8AQmPV5VBudEnBevIgplUtfcZxu7y1
Accepted Version of “3DC in 2LOC”

Of course, it is impossible to protect all the data with this implementation. Also, from the perspective of data backup itself, it’s impossible to achieve comprehensive coverage, and cost control also needs to be considered. Please skip the next section for guys who do not care about cost. 😂

Data Classification

Before proceeding with data backup and redundancy, it is necessary to classify the data first.

I classified all the data into four levels:

  • Level 1: Data should remain regardless of the existence of me
  • Level 2: Data should remain when I exist
  • Level 3: Better not lose the data
  • Level 4: Not important

Additionally, I also classified the data into another three levels based on the privacy requirements:

  • Level 1: Absolute privacy
  • Level 2: Not suitable to disclose in the public domain
  • Level 3: Can be displayed in the public domain

Based on the classification above, a simple scheme matrix has been drafted.

Persistence LevelPrivacy LevelExamplePlanMisc
Level 1Level 1Private projects and related dataNAS + LazyCat + Google Drive (Encoded)Accepted version of “3DC in 2LOC”
Level 2Non-private contracts, documents, etc.NAS + LazyCat + Google Drive
Level 3NA
Level 2Level 1NA
Level 2Non-private contracts, documents, etc.GitHub Private Repo + Google DriveDual cloud
Level 3Open-source projects and related dataGitHub Public Repo + Google DriveDual cloud
Level 3Level 1Purchased digital mediaNAS + LazyCat– Dual local storage
– Privacy due to copyright
Level 2NA
Level 3NA
Level 4Level 1Insignificant documents and data scattering across various devicesNA
Level 2Insignificant documents and data scattering across various devices and clouds
Level 3Insignificant documents and data scattering across various devices and clouds
Data Classification

The dual-cloud solution mentioned in the table above is too common to be elaborated on. The NAS + LazyCat solution is actually the same as the one mentioned in the post, Unconventional Usage of LazyCat MicroServer. That’s all for now.

Unconventional Usage of LazyCat MicroServer

Recently, I got a new niche product, LazyCat MicroServer. First, I would like to thank LazyCat CEO Andy Stewart for the coupon provided, as I am a loyal user of the OpenAI Translator created by yetone. 😂

LazyCat MicroServer

Like some other guys, when I saw the introduction to LazyCat MicroServer for the first time, I thought, “Isn’t it just a NAS?” I already own a NAS, and after playing around with it for a while, I realized that it looks like a NAS, but it falls short of a NAS in terms of data and service stability. However, it far surpasses NAS in terms of performance and flexibility. LazyCat MicroServer and NAS are entirely different products in separate lanes.

LazyCat MicroServer ≠ NAS

Here is why I think LazyCat MicroServer falls short of a NAS regarding data and service stability.

  1. NAS natively supports RAID. LazyCat MicroServer does have two data disks equipped but is not RAID-supported. Although the real-time Btrfs backups via external drives could be a decent compromised solution for users without a NAS, as someone who already owns a NAS, I will definitely not migrate the significant data to LazyCat MicroServer.
  2. NAS mainly has dual network interface cards (NIC) that support a variety of configurations, and I usually use NIC bonding to ensure one network port failure is tolerated for uninterrupted communication. However, most NAS devices do not natively support WiFi, but LazyCat MicroServe does, so the wired connection + WiFi combination is an acceptable compromise.

Considering these, I will not replace my NAS with LazyCat MicroServer. Of course, this is also not its market positioning.

LazyCat MicroServer > NAS Data and Service Stability Requirements Excluded

LazyCat MicroServer has some that attract me:

  1. Its performance is way better than most traditional NASes, and the equivalent high-performance NASes are way more expensive. Due to my NAS’ limited performance, I have to hold some deployments. But now I can deploy them on LazyCat Server and migrate most of the applications from NAS to LazyCat MicroServer. My NAS will be more of a data backup tool and media center.
  2. The LazyCat AppStore is well-stocked, and the LazyCat MicroServer features configuration-free network tunneling. Its cross-platform SDK has quite an active community.
  3. LazyCat’s official apps have some features that Synology’s counterparts are incapable of. For example, leveraging its more powerful chipset and LLMs, the LazyCat Photo app supports natural language photo queries. The upcoming version will also support duplicate photo detection and cleanup. Synology Photos, in contrast, is lack of this functionality despite its predecessor, Moments, having it. The community has requested Synology to reinstate this feature for quite a long while, but no official response has been received. Moreover, Synology doesn’t offer an API for Synology Photos, making third-party solutions impossible. Before LazyCat, I had to rely on third-party tools to periodically scan my NAS for duplicate photo cleanup, which was very troublesome.

Unconventional Usage

In order to experience the exciting features of LazyCat official Apps without migrating significant data like photos to LazyCat MicroServer, I figured out an unconventional usage by using Syncthing.

Dual Usage of Synology Photos & LazyCat Photo App

First of all, I need to confirm whether this dual usage is feasible.

  • I confirmed that the LazyCat Photo App supports both direct uploads from clients and files copied to its “Photos” directory.
  • Syncthing supports folder filtering, which means we can exclude some unnecessary files or folders from syncing.

Next, I am going to set up based on the diagram below. 😂

https://www.plantuml.com/plantuml/png/TPBFRl8m4CJlVehzSlfw80-08WGguWHL9THJrSFMNeWb_q6R3HAj-kvjY5M3eQSecTdVPCUUTu8ilNVgdxJa2JmAiSL9xCNPG0grH8QNZbYf7QCdgDRuSNf4WOtL7BV4H-8AFXN0WQEchikEXNllVNMfR4z1Isl37eRFk-WCCLHd7wpIc_fAKMTxT75_WgV5zZeZIyzjbDZTJ_ahv9oXaGsiQK_1NA4NXuEp6iN6aCV7EGKm_jcIZbRJG1cgWMRosbfZABpD4b5TKA2fivn0u-DAISmiPQreGgdSOpEP5Rl1T51LqUfep7F9zlyNl2719Gf2cbXP9yHa7igm6qRge3RrxFPSOFgZNZYAsv7qOeEcxk-nYfsIhoIgEGNJU_SD
Dual Usage of Synology Photos & LazyCat Photo App
  1. I installed Syncthing on both my NAS and LazyCat MicroServer. The photo folder on my NAS syncs with a subfolder of the photo folder on LazyCat MicroServer. Additionally, I configured Syncthing to ignore Synology metadata directories, @eaDir, on my NAS side.
  2. I use Synology Photos’ mobile backup while keeping LazyCat’s backup disabled to avoid duplicate uploads.

In this way, I can manage my photos with the LazyCat MicroServer’s high performance while relying on my NAS to securely store cherished memories; All the changes made on either side sync to the other.

To Be Continued

I’m still exploring new ways to use the LazyCat MicroServer. For instance, I recently deployed a lightweight RAG (Retrieval-Augmented Generation) solution using AnythingLLM integrated with Ollama, and it was onboarded at LazyCat AppStore.

Admittedly, LazyCat MicroServer is not without any flaws: its SDK documentation is cryptic and incomplete, and the system, SDK, and website are riddled with bugs. The support team feels amateurish. The whole process of porting and developing applications on the MicroServer feels like pioneering uncharted territory. Despite its shortcomings, LazyCat’s rapid iteration, timely patches, and exceptionally quick support response give a strong impression of a product on the rise.

As the company’s first product of this kind, I have realistic expectations. Ironically, these imperfections make the process feel like an adventure, and I’m excited to keep exploring the MicroServer’s potential. Ironically, it’s the imperfections that make this journey engaging. The challenges add a layer of excitement, pushing me to dig deeper and explore more of the MicroServer’s potential. I’m eager to continue this adventure and uncover new possibilities.