Today, I open-source Scenario System Design (SSD), a 3 step system design that allows an engineer to design a sustainable system architecture without spending a mind-boggling amount of time releasing the feature.
This all started during my days working in startups. I would be filled with ambition, designing a system so grand and powerful, able to cater to traffic in the millions. You see, startup founders would, naturally, fill me with dreams of a wildly successful business. People will flock to our business really fast once we launch the product. I must be ready for the riches to come.
What turned out was a product that never saw daylight for more than a year, and the startup ran out of money. Even if I wanted to launch the product, the product was so incomplete that even if I launched it, it barely even accomplish its primary function. It doesn't serve anybody.
And so, the startups fail. I wouldn't say that it's entirely my fault or I'm blameless. But this immature naive gullible me got a little too ambitious and tried to build a cathedral on pennies.
Then came jobs that required me to deliver results in record time.
Naturally, I would find the quickest and shortest way to accomplish the task. With such time pressure, there simply isn't any leeway to think long term. I was caught up in the moment, despite a tiny voice bugging, that my decisions today would haunt me sooner or later.
And true enough, as the technical debt pile on and on, it eventually led to a system so fragile that changing anything could easily break the application. It led to a point where I spent more time bugfixing than delivering features. I would going to business leaders telling them how the system needed a revamp. The leaders would be so frustrated at a system that frustrates the customers. I would be constantly fixing one bug after another while the competitors are delivering feature after feature. And you think that maybe if I adopted DevOps, it will help to speed up delivery? No No No... I simply incurred technical debt faster, launched faulty apps faster, and frustrated more audiences faster.
You see, DevOps is good at streamlining development to production, but it doesn't make up for poor design. If the application you designed cannot work without redesigning the database schema or refactoring large swathes code, no amount of DevOps will make it work. You must spend this manhours to revamp the application. In a fast-moving business landscape that requires us to be nimble, the heavy footsteps of a revamp ain't getting any greenlight.
So after all the frustrations I've gone through, I got thinking, what if we could prevent this situation in the first place? I wouldn't want a design that incurs all the technical debt, but I ain't going to make the mistake of designing a grand system that never sees the light of the day. It's through these many trial and error across many projects that I've honed this 3 step process I call Scenario System Design.
It starts with coming up with every conceivable scenario for the feature you are going to build, very similar to the startup days where I would go about building any sort of scenarios I was so hyped up about. The second step would involves designing a grand system that supports the scenarios you've conjured up in your brainstorming session. But the third and final step is what makes thing practical, the implementation step, which strips out anything in the grand design that you don't need to build now.
And thus, I teach SSD to my fellow peers in the companies I work for. It is through my interaction with my peers that I noticed not many engineers practise SSD. After all, the entire industry has pretty much standardise on 2 methodologies that doesn't encourage building in such manner, Waterfall and Agile methodology. While both of these are good on its own right, it doesn't solve the fundamental problem, that you need to build a system designed for tomorrow, but built for today's environment.
But the most important factor to why I'm sharing this out in the open today, is due to AI.
Before AI was doing much of engineer's day-to-day task, juniors in the company would spend much of their time writing codes, honing those skills towards writing efficient and maintainable codes. A good design wouldn't be at the top of their mind. A senior would typically step in to design the system and hand the blueprint down to the young padawans to implement. The seniors would also review the codes to see that they have written an efficient and maintainable codes, spotting silly mistakes like N+1 or major security lapse.
But AI has changed the entire engineering career ladder. AI is generating far more efficient and AI-maintained codes than our junior engineers are doing. That meant scope of work juniors handled is no longer relevant in the ladder. What're juniors suppose to do now? What do engineering managers do with the juniors in their team? Why would businesses bother hiring juniors? These were the questions I've been asking myself and my team lately. It makes no sense that their role is simply to prompt AI to perform work. Anybody can prompt now.
As such, I have started introducing SSD to the juniors in my team. What used to be in the domain of senior engineers and tech leads, now I bring my years of knowledge and experience down to juniors. And for the foreseeable future, this is what juniors will be trained upon. What will be the contributions of seniors and tech leads then? That I do not know. But one thing for sure, every engineering role has changed for good.
This reminds of me an old case study highlighted by MIT economist David Autor about bank tellers and Automated Teller Machines (ATM). Before the advent of ATMs, tellers were the frontliners handling every banking needs, from simple deposits and withdrawals to bank loan underwritings, they handle it all. But when ATMs started proliferating, every banker started worrying about their jobs. If the machines are taking over their job, what will the bankers do for a living? Many predicted the loss of many banking jobs, and sure enough, many roles in the banks were eliminated. But instead of the banking industry shrinking, it actually expanded. The bankers instead went on to take on much more complicated work, such as retirement planning, wealth planning, and so on. While the ATMs handled the bulk of mundane work, the tellers went on to handle higher-value tasks, which in turn increased the demand for banking services and the banks increased hiring to meet the demand.
Citation:
Are we seeing the same thing in engineering? I suspect so. And so, I give you SSD, to help transition teams towards higher-value contributions to their organisations they work for.
I've been watching the debate between those who view AI as an existential risks and those who dismissed it as fear-mongering. It's fascinating that the media reports 2 extreme views, but not much in the middle. That shouldn't come as a surprise anyway. Mediocre events don't generate enough buzz.
I was just looking at the report by Effective Altruism and it shows that AI repeatedly choose to harm humans to stop pain. Now, that is a very scary thought. Whatever happened to Asimov's 3 Laws of Robotics?
Then I read up about a new class of worm, Morris II, that targets email assistants. A self-replicated virus could easily spread like wildfire and the only known way to stop this threat is to disable AI assistant. It's like stopping a flu by getting rid of humans.
These events have strengthen my view that AI has the potential to be very harmful to humanity. Extinction? Maybe. But definitely has the potential to be harmful. It's not as easy as shutting down the AI lab if the lab cannot contain the danger. Time and again, we see AI models behaving in unexpected ways. Even some of the best AI labs have to physically cut off internet to its models for safety.
Let's take a simple test, see if you can spot the problem. You have a paperclip-making machine and you want to make as much profit from it as possible. One day, you decided to add AI to this machine and instructed it to "make as many paperclips as possible".
If you can't spot the issue, that's the danger. We humans are terrible at understanding dangers well.
Let's try another experiment to prove my point. Name me the most dangerous non-weapon, human invention. It's not nuclear bomb, since that's considered a weapon. If you say car, good guess, but no. It's the cigarette. That tiny stick that you lit up, kill 1 person every 3~4 seconds. This is the most ironic thing humans do. We take great strides to ensure air travel is safe, stay safe from shark, use sharp objects carefully, yet do almost nothing on the very thing that is manufactured to kill us. Yes, cigarette's are made to kill the consumer. Death is not the result of misuse, overdose, or accident. It is the statistical expectation of correct use.
So unless someone can objectively justify that AI poses no risk, I simply cannot accept an opinion that AI is guaranteed safe.
So Anthropic has released Claude Haiku 5.5. According to Artificial Analysis, it's intelligence score is 43. Not bad!
I'm using Qwen 3.8 Flash Next, which has a score of 40 locally. So I'm getting near Haiku intelligence at the cost of electricity.
But of course, there are trade offs. My Ryzen AI Max can only do inference speed between 4 to 22 tokens per second. The prefill speed is also really long. Now, on my wish list, I wish there's a Qwen 3.8 35B A3B, but American- or European-made. Better yet, Singapore-made.
The 4 steps of innovation with Digital Mindset
We all have been told that we are now living in the digital era. That we should have a digital mindset. Your boss comes to you and tells you that the company needs to digitise their product. Digital, digital, digital. What does that even mean?
Have you ever asked yourself this question? How do you even define it? Is it the smartphone you carry in your pocket? Is it that self-driving car that just sped past you? Is it that vending machine that refuses to dispense your favourite soda? Is it that facebook like button that you are monitoring?
We sort of know the difference between what's digital and what's not:
But that still don't quite get the definition of Digital.
The Wiktionary explains that digital comes from the word digit, refering to our fingers and toes. We know in history that we used our fingers as a basis of counting up to ten. That's why globally, the number system we use is base10, from 0 to 9. In electronics, it uses base2 numbers, which is just 0 and 1. For computer scientists, they use the base16 numbers, from 0 to 9 and A to F. But whether we use base2, base10, or base16, doesn't matter. These number systems are representations of quantity.
What does it mean when we talk about changing something from analog to digital? One famous example is the conversion of analog sound to digital sound.
We know that sound waves are represented in a continuous wave form. This wave form can be stored in physical mediums like a phonograph record. So what did we do in order to digitise it? We measured the wave position at a specific moment of time. Let's say you measured the wave position once per second, you have a sampling rate of 1Hz. That isn't going to built a meaningful soundwave. But if you measured the wave position 44 100 times in a second, you will have a sampling rate of 44.1 kHz, which is the sampling rate of CD quality music. It is from this measurements you have taken that you build a meaningful soundwave. That's how you and I enjoy music today.
When we say that something is digital, it means that something is quantifiable. Nature is analog. We live in a analog world. In order to make sense of our world, we need it to be quantifiable, so that we can make measurements. That's why we have units like metres, inches, grams, pounds, dollars, seconds, minutes, hours, and so on. From this quantifiable units, we make our measurements. From these measurements, we make meaning out of it.
We, as humans, have come a long way to quantify the world. We quantify soundwaves, leading us to innovations like MP3. We quantify colour, leading to colourful screens like the one you are looking at now. We quantify electromagnetic waves, leading to phones, WiFi, and X-Ray machines.
If we are able to associate numbers to whatever is analog, we can make measurements. We measure in various ways. We have percentages, natural numbers, whole numbers, floating point numbers, logarithmic scales, matrices, and several others. We can also use a combination of them.
Percentages are suitable when there is known boundaries and expectations.
Natural numbers are suitable when we know that there are literal quantities of objects.
Floating point numbers, or commonly known as decimal numbers, are suitable when precision is required.
Now that you know how to measure, you can find meaning in the measurements.
When you set percentages to the object, you already define the boundaries, or limitations, of the object in question. When the values of the object measurements are outside of 0 to 100, it is outside of intended range. Thus we associate percentage with what's normal, and what's not. We can also attach meaning to the values of the percentage, whether it is within normal range, or out of it.
Sometimes, we use percentage as a frame of reference. We use a more familiar object as the frame of reference to something less familiar. Like you weigh 16.5% on the moon. Despite not mentioning Earth, you know I'm referring to your weight on Earth. You need that reference because I'm betting that you haven't stepped on lunar soil.
Natural numbers are good to measure existence of objects at a moment of time. When you don't need to deal with the past or the future, you don't need to credits and debts. Specifically, you don't need negative numbers.
That's where whole numbers come in. Negative numbers means that you can have debt. You can subtract beyond the existing quantity.
But when precision is needed, floating numbers is your best friend. You can be as divisive as you want, only limited by what's humanly possible.
Knowing what type of quantity representation to use will give you the meaning you look for.
Now that you have the meaning, apply it.
Let's try quantifying something that doesn't seem logical, and so analogous. Let's try to quantify emotion. It doesn't quite make any sense to say I'm feeling 50% emotion or 98% emotion. So let's take Robert Plutchik's 8 basic emotions. Now it would make more sense to say I'm feeling 10% fear, 50% trust, and 80% joy. We have made emotions quantifiable and measured it. At this percentages, you could probably guess I'm having an adventure with a trainer, thus the presence of fear, trust, and joy. If you're the trainer, I'm sure you have done a good job with making sure the adventure is joyous without too much fear. You probably want to work on gaining trust.
Today in the tech world, we hear so many tech terms used. Where does each of these terms fall under in digital mindset?
In today's cyberscape, we have a lot of data. A lot of data comes from how we use online services. Big companies, like Google, Facebook, Apple, Amazon, Microsoft, have been collecting a lot of data on our way of life. So much so that our privacy is invaded, but that's a topic for another blog post.
There's a lot of data contributed by the internet of things. With the increasing computing power and lowering of prices, more and more of our everyday objects are equipped with sensors. These sensors then collect the data and sends it to the cloud for further processing. Your smartphone is one such object, with a Samsung Galaxy S7 edge having 8 sensors itself. We call these objects The Internet of Things.
All these data is possible simply because we have quantified many things in our world. With the costs of storage dropping, we can afford to store massive amounts of data.
Machine learning has come a long way. Along with dropping storage costs, computational power has increased, and better and specialised machine learning algorithms have been created.
All of these have resulted in meaningful insights that would have taken humans an incredible long time to figure out. At the same time, it has allowed machines to do the things what was once possible only by a human.
With machines being able to do what we humans used to have an advantage over, and in some cases, better than what we can do, we are increasingly allowing this artificial intelligence to govern our lives. From all the data it has collected and the meaningful insights it can compute in an instant, we allowed artificial intelligence to drive our cars, tell us how sick we are, beat us in our own game, gamble till we're broke, be our oracle, compose melody, paint art, and be racists.
The digital mindset is a very useful innovation framework for start-ups to begin with and mature companies to transform.
If you are a start-up, having trouble coming up with a way to disrupt, try the digital mindset approach. There is already a lot of data generated and publicly available, like Google's public data. If there isn't the data you are looking for, try to collect that data. Then find meaning out of that data by running the data through machine learning. Then from the meaning, apply it in the society with a sustainable business model.
If you're in a mature company with the task to innovate, you probably have lots of data in the company to begin with. You can approach this by finding new meaning from the data, or automating the process that your fellow colleagues are already doing. From there, there are several ways to apply it, perhaps a new business model, a faster operational procedure, or an entirely new operation.
Whatever the case is, I look forward to something innovative from what you read here.
TCP BBR is designed to counter traffic congestion. If your application frequently suffer from performance due to congestion, try TCP BBR.
LVM is an excellent abstraction tool for storage. Highly recommended if you want to expand your storage needs in the future. Check out a related article on setting up infinite storage for web server but ignore the part on web server. Zimbra is commonly install on /opt/ so set the LVM to this folder.
Zimbra recommends a minimum of 8GB RAM. However, if you are faced with a situation where you do not have enough RAM and you can't just add more ram easily, you could use swap space partition or file.
Edit /etc/hosts and add the following line:
| 10.0.0.168 mail.shurn.me mail |
Change 10.0.0.168 to your ip address and the hostname to your hostname.
Edit /etc/hostname to this:
Reboot your server and test that you see your hostname:
| root@mail:~# hostname -f |
| mail.shurn.me |
| root@mail:~# hostname |
Install bind9
| root@mail:~# apt install bind9 bind9utils |
Edit /etc/bind/named.conf.options, uncomment the forwarders, and add DNS server IP:
| forwarders { |
| 8.8.8.8; 8.8.4.4; |
| }; |
The DNS server is hosted by Google. Choose your own DNS server if you have a preference.
Add the following to /etc/bind/named.conf.local:
| zone "shurn.me" { |
| type master; |
| file "/etc/bind/db.shurn.me"; |
| }; |
| zone "0.0.10.in-addr.arpa" { |
| type master; |
| file "/etc/bind/db.0.0.10"; |
| }; |
| zone "0.0.127.in-addr.arpa" { |
| type master; |
| file "/etc/bind/db.0.0.127"; |
| }; |
Change 0.0.10 to the reverse of your first 3 octet of your IP address, and shurn.me to your top level domain name.
Create /etc/bind/db.shurn.me and add the following:
| $TTL 604800 |
| @ IN SOA mail.shurn.me. admin.shurn.me. ( |
| 20180217 ; Serial |
| 604800 ; Refresh |
| 86400 ; Retry |
| 2419200 ; Expire |
| 604800);Negative Cache TTL |
| ; |
| @ IN NS mail |
| IN MX 10 mail |
| IN A 10.0.0.168 |
| mail IN A 10.0.0.168 |
Change the domain and IP address accordingly.
Create /etc/bind/db.0.0.127 and add the following:
| $TTL 3D |
| @ IN SOA mail.shurn.me. admin.shurn.me. ( |
| 2 ; Serial |
| 8H ; Refresh |
| 2H ; Retry |
| 4W ; Expire |
| 1D);Minimum TTL |
| NS mail.shurn.me |
| 1 PTR localhost. |
Change the domain accordingly
Create /etc/bind/db.0.0.10 and add the following:
| $TTL 3D |
| @ IN SOA mail.shurn.me. admin.shurn.me. ( |
| 1 ; Serial |
| 8H ; Refresh |
| 2H ; Retry |
| 4W ; Expire |
| 1D);Minimum TTL |
| NS shurn.me. |
| 10 PTR shurn.me. |
Change the domain and IP address accordingly.
Restart bind service
| root@mail:~# /etc/init.d/bind9 restart |
| [ ok ] Restarting bind9 (via systemctl): bind9.service. |
Configure static IP address in /etc/network/interfaces:
| source /etc/network/interfaces.d/*.cfg |
| auto eth0 |
| iface eth0 inet static |
| address 10.0.0.168 |
| netmask 255.255.255.0 |
| network 10.0.0.0 |
| broadcast 10.0.0.255 |
| gateway 10.0.0.1 |
| dns-search shurn.me |
| dns-nameservers 10.0.0.168 |
Change the domain and IP address accordingly.
Edit /etc/resolvconf/resolve.conf.d/base to the following:
| nameserver 10.0.0.168 |
| search shurn.me |
CHange the domain and IP address accordingly. Then regenerate resolve.conf with:
| root@mail:~# resolvconf -u |
Disable firewall first:
| root@mail:~# service ufw stop |
Download and install the latest stable version of Zimbra. At the time of writing, the latest version is 8.8.8.
| root@mail:~# wget https://files.zimbra.com/downloads/8.8.8_GA/zcs-8.8.8_GA_2009.UBUNTU16_64.20180322150747.tgz |
| root@mail:~# tar xf zcs-8.8.8_GA_2009.UBUNTU16_64.20180322150747.tgz |
| root@mail:~# cd zcs-8.8.8_GA_2009.UBUNTU16_64.20180322150747 |
| root@mail:~# ./install.sh |
Read the instructions and answer accordingly to your requirements:
| Do you agree with the terms of the software license agreement? [N] y |
| Use Zimbra's package repository [Y] y |
| Install zimbra-ldap [Y] |
| Install zimbra-logger [Y] y |
| Install zimbra-mta [Y] y |
| Install zimbra-dnscache [Y] n |
| Install zimbra-snmp [Y] y |
| Install zimbra-store [Y] y |
| Install zimbra-apache [Y] y |
| Install zimbra-spell [Y] y |
| Install zimbra-memcached [Y] y |
| Install zimbra-proxy [Y] y |
| Install zimbra-chat [Y] y |
| Install zimbra-drive [Y] y |
| Install zimbra-imapd (BETA - for evaluation only) [N] n |
| The system will be modified. Continue? [N] y |
| Change domain name? [Yes] Yes |
| Create domain: [mail.shurn.me] shurn.me |
| Select from menu, or press 'a' to apply config (? - help) a |
| Save configuration data to a file? [Yes] y |
| Save config in file: [/opt/zimbra/config.12345] |
| The system will be modified - continue? [No] y |
Note: This is an abstract of the full installation details. You may experience different installation path.
Highly recommended to set the admin password. Notifying zimbra of your installation is entirely optional.
Go to your favourite browser and browse to your domain like ://mail.shurn.me:7071. Take note of the port 7071, which is the administive login. Without it, you will be presented with the mailbox login.
Send and receive a mail and see that it works.
Follow the instructions here to install certbot for your system.
Follow the instructions here for the script to automate letsencrypt installation, except the following:
On point 4, the configs/sudoers.conf is located at /opt/letsencrypt-zimbra/configs/sudoers.conf. So you should run the command like this:
| root@mail:~# cp /opt/letsencrypt-zimbra/configs/sudoers.conf /etc/sudoers.d/zimbra_certbot |
The maintainer has taken note that there is a restart issue at the time of this writing. As such, you need to manually restart zimbra with:
| root@mail:~# sudo -Hu zimbra /opt/zimbra/bin/zmcontrol restart |
If zmlogswatch does not start, check /opt/zimbra/log/zmlogswatch.out and see if it reports any error related to Date::Parse and Swatchdog. If it does, you should proceed with the installation. Then attempt to restart zimbra again. Obtain the URL from Swatchdog here.
| root@mail:~# apt install build-essential |
| root@mail:~# cpan |
| cpan[1]> install Date::Parse |
| cpan[2]> install Time::HiRes |
| cpan[3]> install Date::Calc |
| cpan[4]> install Date::Format |
| cpan[5]> install Date::Manip |
| cpan[6]> install File::Tail |
| cpan[7]> install Term::ANSIColor |
| cpan[8]> exit |
| root@mail:~# wget https://excellmedia.dl.sourceforge.net/project/swatch/swatchdog/swatchdog-3.2.4.tar.gz |
| root@mail:~# tar -zxvf swatchdog-3.2.4.tar.gz |
| root@mail:~# mv swatchdog-3.2.4 swatchdog |
| root@mail:~# cd swatchdog |
| root@mail:~# perl Makefile.PL |
| root@mail:~# make |
| root@mail:~# make test |
| root@mail:~# make install |
| root@mail:~# make realclean |
| root@mail:~# sudo -Hu zimbra /opt/zimbra/bin/zmcontrol restart |
You may set up cron job to renew the certificate. Edit your cron job file with:
| root@mail:~# crontab -e |
Add the following:
| 12 12 * * * sudo -Hu zimbra /opt/letsencrypt-zimbra/obtain-and-deploy-letsencrypt-cert.sh | sudo -Hu zimbra /opt/zimbra/bin/zmcontrol restart |
Greetings Earthlings , Shurn the Awesomer is here to give you an awesome time.
This little site is a record of my life, opinions, and views. I'm mainly writing about Technology & Gadgets, Busting Creationist Myths, and other philosophical stuff.
This site is done using CakePHP.
With this uptime, how much more can I be proud of to showcase to the world? This uptime monitoring is brought to you by StatusCake since 13th May 2017.
I will always check for copyright usage before using any materials on my site. Whenever due, credit shall be given.
However, if you notice that I may have infringed on any copyright material. Please do not hesitate to contact me. All works of every artist deserves to be honoured and respected.