Celebrate My 3rd Year of Working in NUS

This month marks the beginning of my 3rd year of working as a software engineer in National University of Singapore (NUS). Hence, at this juncture, I would like to give myself an opportunity to broaden my horizon so that I can live up to the expectations of the team and continue to grow professionally.

Coincidentally, it’s NUS Well-Being Day in the beginning of the month. All the staff and students can have a long holiday to rest and re-energise.

7 PitStop Principles for Mental Wellbeing

In the beginning of Well-Being Day, NUS introduced the 7 PitStop Principles to aid everyone in the campus in stress management and self care. The seven principles are as listed below.

  1. Personal Skills;
  2. Interactions;
  3. Time Out;
  4. Sleep;
  5. Thoughtful Eating;
  6. On the Move;
  7. Purpose.

In order to make my life better by enhancing my mental wellbeing, I have tried to adopt the principles as a part of my lifestyle during the long holiday.

Personal Skills

As Eduardo Briceño shared in his Ted talk, in our life, there are two key zones, i.e. the Performance Zone and the Learning Zone.

The Performance Zone is where we apply our knowledge and skills to carry out our tasks. The Learning Zone on the other hand is all about improving our current skills and learning new skills.

The problem why many people don’t improve much is that they spend all of their time in their performance zone. They simply do, do, do but seldom reflect on it. Hence, in his talk, Eduardo Briceño suggested that we should frequently switch between the two zones.

During the NUS Well-Being Day long holiday, it’s also coincidentally the launch of Visual Studio 2022 and .NET 6. Both of them are the key tools in my career. Hence, I took the opportunity to learn what’s new during the launch event.

Joining the Microsoft team for the launch of Visual Studio 2022 to learn about what’s new. (Image Source: Microsoft Visual Studio)

I have been focusing more on desktop and mobile app development in my past two years of working in NUS. Before that, I had always been working on web development projects which required skills in cloud computing.

Hence, in order to keep my skill relevant, I also took 6 to 7 hours per day to take some modules on Microsoft Learn to enhance my knowledge in designing, building, testing, and maintaining cloud applications and services on Microsoft Azure.

Interactions

Social isolation and loneliness can affect one’s physical and mental health. Hence, family and friends play an important role in our healthy life.

Having a cup of coffee with friend in a quiet evening is enjoyable. (Image Source: PxHere)

I’m glad to have the opportunity to have a talk with Riza Marhaban, my friend and my mentor, in one of the evenings. This is a type of happiness especially in the current situation of pandemic because meeting friends is not as easy as the good old days.

In addition, during the holiday, I attended Dato Yeo Kok Hwa’s session about Disrupting Negative Thoughts organised by NUSHeart. Dato Yeo shared with us the symptoms and causes of negative thoughts as well as how we can apply strategies to disrupt those negative thoughts.

Dato Yeo talked about how some of us have Automatic Negative Thoughts (ANTs). For example, it could be because some people over-generalise things in their life in such a way that they view a negative event as a never-ending pattern of defeat. It also could be because some people dwell on the negatives and ignore the positives. Hence, it’s important to have alternative thinking which helps us to change the way we think.

Dato Yeo Kok Hwa’s session about Disrupting Negative Thoughts.

Time Out

I’m not sure about the rest of NUS staff, but I find that the working life in NUS research centre is challenging. Hence, it’s important for me to take time out for myself.

Before the holiday, Riza was telling me that Queen’s Gambit is a must-watch miniseries on Netflix. So I took the chance to watch it during the holiday. I haven’t stopped thinking about the series since finishing it because it was just that good.

Besides watching movie, I also played Command and Conquer 3 which is one of my favourite RTS games during the holiday. This video game was released in 2007. After 14 years have passed, I finally got the time to play it.

Pew pew.

Coincidentally, HoYo FEST was happening in Singapore during the holiday as well. So, I took the opportunity to visit their café.

Mei senpai!

Sleep

When I was working in startups, I lost a night or two of sleep especially when there is a deadline to meet. This is normal because sleep is undervalued in a startup culture where being busy and working beyond capacity is celebrated. Now in my current work life, I decide to sleep more.

During the holiday, I had 10 hours of sleep/rest per day on average.

Thoughtful Eating

Even though I’m not allowed to cook in the place I rent, I still try my best to avoid unhealthy food. It has been more than one year I stop consuming fast food.

In addition, eating slower also helps. The benefits of slow eating include better digestion, better hydration, easier weight loss or maintenance, and greater satisfaction with our meals.

There is a lot of good food available in the campus.

On the Move

In 2018, a WHO report estimates that more than a quarter of people worldwide – 1.4 billion – are not doing enough physical exercise, a figure that has barely improved since 2001.

Currently, I am still trying to exercise for at least 20-minutes, 3 times a week.

My friend Jon introduced me a home workout video for beginner like me. You can refer to the video below if you are also finding ways to stay healthy during the lockdown period.

Purpose

Research suggests that people who volunteer actually experience a boost in their mental health.

I have been volunteering in National Library Board until the volunteering opportunity was cancelled in May 2021 due to the Covid-19 situation. So, there is nothing much to share about this until the volunteering programme is back.

The new library at Harbour Front that I was always volunteering at.

That’s all for how I celebrate both my 3rd year of working in NUS and the NUS Well-Being Day. I hope reading this brought you some inspiration.

References

Kaizen: Embark on My AI Certification Journey

Today, I’m finally getting recognised by Microsoft as a Microsoft Certified: Azure Artificial Intelligence (AI) Fundamentals.

Nowadays, in many of the industries, we hear words like AI, Machine Learning, and Deep Learning. The so-called AI revolution is here to stay and shows no signs of slowing. Hence, it’s getting more and more important to equip ourselves today for the future of tomorrow with relevant knowledge about AI.

In addition, big players in the AI industry such as Microsoft have made AI learning easier for anyone who has an interest in the AI field. In August 2021, Rene Modery, Microsoft MVP, shared on his LinkedIn profile about how to take a Microsoft Certification exam for free and Azure AI Fundamental certification is one of them. Without the discount, we will need to pay USD 106 just to take the Azure AI Fundamental certification exam in Singapore. Hence, this is a good opportunity for us to take the exam now while the discount is still available.

Why Am I Taking Certification Exam?

One word, Kaizen.

Kaizen is the Japanese term for continuous improvement. I first learnt about this concept from Riza Marhaban, who is also my mentor in my current workplace, in one of the Singapore .NET Community meetups last year. In his talk, Riza talked about how continuous improvement helped a developer to grow and to stay relevant in the ever-changing IT industry.

Riza’s sharing about Kaizen in Singapore .NET Developers Community meetup.

Yes, professional working experience is great. However, continuous learning and having the ability to demonstrate one’s skills through personal projects and certifications is great as well. Hence, after taking the online Azure AI training course, I decided to take the Microsoft Certificate exam, a way to verify my skills and unlock opportunities.

My Learning Journey

After I received my 2nd dose of the COVID-19 vaccination, I took a one-week leave to rest. During this period of time, every day I spent about 2-3 hours on average to go through the learning materials on Microsoft Learn.

To help us better prepared for the exam, our friendly Microsoft Learn has offered an online free learning path that we can learn at our own pace. I finished all the relevant modules within 7 days.

In addition, in order to be eligible for the free exam, I also spent another one day of my leave to attend the Microsoft Azure Virtual Training session on AI Fundamentals.

When I was going through the learning materials, I also took down important notes on Notion, which is a great tool for keeping our notes and documents, for future reference. Taking notes doesn’t only help me to learn better but also provide me an easier exam revision.

Studying for exam is a time of great stress. In fact, I was also busy at work at the same time. Hence, in order to destress, everyday I will find some time to login to Genshin Impact to travel in the virtual world and enjoy the nice view.

Feeling burned out, emotionally drained, or mentally exhausted? Play games with friends to destress! (Image Source: Genshin Impact)

The Exam

The certification exam, i.e. AI-900, has five main sections, i.e.

  • AI workloads and consideration;
  • Fundamental principles of ML on Azure;
  • Computer Vision workloads on Azure;
  • Natural Language Processing (NLP) workloads on Azure;
  • Conversational AI workloads on Azure.

In total, there are 40+ questions that we must answer within 45 minutes. This makes the exam a little difficult.

Based on my experience, as long as one has common sense and fully understands the learning materials on Microsoft Learn, it’s quite easy to pass the exam, which is to score at least 700 points only.

I choose to take the certification exam at NTUC Learning Hub located at Bras Basah. (Image Source: Wikimedia Commons)

WANNA BE Certified by Microsoft?

If you are new to Microsoft Certification and you’d like to find out more about their exams, feel free to check out the Microsoft Certifications web page.

Together, we learn better.

My Vaccination Journey: 1st Jab

According to the American National Public Radio, the Delta variant of COVID-19 could be as contagious as chicken pox, one of the more transmissible viruses , and could spread more easily than the common cold, the 1918 flu, and small pox. Fortunately, changes or mutations in the virus are expected not to make vaccines completely ineffective. Hence, it’s now time for us to work together to stop the virus from widely circulating in a population and increasing the chances of the virus mutating.

I had ended up in a hospital bed a few times because of pneumonia, which is an infection of the lungs. It’s not a great experience lying on the hospital bed for weeks to receive treatments. Meanwhile, the COVID-19 infection can also progress to our lungs and thus it’s possible to develop pneumonia because of COVID-19 infection. So before it’s too late, I shall have the vaccination done.

Nominated

As a staff working in National University of Singapore, I was nominated to received the COVID-19 vaccination in early June 2021. Hence, I don’t need to go through the registration process and can directly book the vaccination day.

We are allowed to choose a vaccination centre. Once it’s chosen, we cannot change the vaccination centre to another one after the 1st dose. The one I picked is located at Raffles City Convention Centre which offered Pfizer vaccines.

Preparation

I tried to rest as much as I could few days before the vaccination day. It’s also important to drink lots of water to maintain the body hydration level. I normally drank about 2 liters of plain water per day. On top of that, since the weather in Singapore was extremely warm in July, starting from three days before my vaccination day, I also bought a cup of coconut water every day. The nutrients and antioxidant properties of coconut water make it a good substitute for saline or glucose drinks and thus help those who are feeling feverish after vaccination, according to Dr Abdul Bashir, senior resident doctor at Thomson 24-hour Family Clinic.

On the day of vaccination, I also brought my NRIC and a bag with a bottle of plain water inside. We will be receiving vaccination information sheet and other documents after the vaccination, so it’s better to bring a bag to keep them safe.

askST: Why you need to get your Covid-19 vaccine shots, Singapore News &  Top Stories - The Straits Times
Receiving the Covid-19 vaccine at the Raffles City Convention Centre. (Photo Source: The Straits Times)

Vaccination

The timeslot I booked for the vaccination is at 3pm. The queue was rather short. I had only queued for 15 minutes. During this period of time, the staff in the vaccination centre checked with each of us, the vaccination recipients, about the health conditions to see whether we have following issues such as

  • ARI Symptoms;
  • Fever in the past 24 hours;
  • Other vaccines taken in past 14 days;
  • Cancer treatment;
  • Blood thinning;
  • Organ transplant;
  • Infected by COVID before;
  • Pregnant;
  • Reaction after 1st dose (for those who are taking 2nd dose).

If there are no serious issues, we will then be allowed to proceed to get vaccinated.

The vaccination information sheet.

The actual vaccination took less than one minute. After that, we are brought to the observation area.

Observation

The observation area is for us to sit on a chair and wait for 30 minutes to see whether any negative reaction occurs. There was also audio announcement in the observation area in four languages, i.e. English, Chinese, Bahasa Melayu, and Tamil. The announcement is important because it gives us advises on what to do after the vaccination and having severe allergic reaction.

The observation area in Raffles City Conference Centre. (Image Source: The Straits Times)

In order to kill time and destress, many of the vaccination recipients chose to read articles or watch videos on their smartphone. Hence, sometimes when the staff called their name to let them know the waiting time was over, they were still sitting there.

After 30 minutes of observation, the staff called my name and passed me a vaccination card. The vaccination card is the most important document throughout the vaccination journey because we need to bring the card for the 2nd dose.

After Vaccination

First of all, no fever.

I could feel a bit pain in the area of injection on my left arm when I lifted it upward in the first four days after the vaccination. I also avoided sleeping on left side because that would give pressure to my left arm and that would be a bit painful. Other than these minor issues, basically I had not encountered any side effect.

Yup, that’s all of my vaccination journey. Let’s discuss again when I have the 2nd dose.

Together, we live healthier.

During the observation period, I was playing Honkai Impact 3rd to not only kill time but also stop myself from thinking too much about the vaccination.

Modern Data Warehouse with Azure

This month marks my third year in port and logistics industry.

In April, I attended a talk organised by NUS Business School on the future-ready supply chain. The talk is delivered by Dr Robert Yap, the YCH Group Executive Chairman. During the talk, Dr Yap mentioned that they innovated to survive because innovation was always at the heart of their development and growth. To him and his team, technology is not only an enabler for the growth of their business, but also a competitive advantage of the YCH Group.

In YCH Group, they have a vision of integrating the data flows in the supply chain with their unique analytics capabilities so that they can provide a total end-to-end supply chain enablement and transformation. Hence, today I’d like to share about how, with Microsoft Azure, we can build a data pipeline and modern data warehouse which helps to enable logistics companies to gear towards a future-ready supply chain.

Dr Yap shared about the The 7PL™ Strategy in YCH Group.

Two months ago, I also had the opportunity to join an online workshop to learn from Michelle Xie, Microsoft Azure Technical Trainer, about Azure Data Fundamentals. The workshop consists of four modules. In the workshop, we learnt core data concepts, relational and non-relational data offerings in Azure, modern data warehouses, and Power BI. Hence, I will share with you what I have learned in the workshop in this article as well.

About Data

Data is a collection of facts, figures, descriptions, and objects. Hence, data can be texts written on papers, or it can be in digital form and stored inside the electronic devices, or it could be facts that are in our mind. Data can be classified as follows.

Unstructured data like image is frequently used in combination with Machine Learning or Azure Cognitive Services capabilities to extract data.

ETL Data Pipeline

To build an data analytical system, we normally will have the following steps in a data pipeline to perform ETL procedure. ETL stands for Extract, Transform and Load. ETL loads data first into the staging storage server and then into the target storage system, as shown below.

ETL procedure in a data processing pipeline.
  • Data Ingestion: Data is moved from one or many data sources to a destination where it can be stored and further analysed;
  • Data Processing: Sometimes the raw data may not in the format suitable for querying. Hence, we need to transform and clean up the data;
  • Data Storage: Once the raw data has been processed, all the cleaned and transformed data will be stored to different storage systems which serve different purposes;
  • Data Exploration: A way of analysing performance through graphs and charts with business intelligence tools. This is helpful in making informed business decisions.
A map in the Power BI report showing the location of a prime mover within a time period.

In the world of big data, raw data often comes from different endpoints and the data is stored in different storage systems. Hence, there is a need of a service which can orchestrate the processes to refine these enormous stores of raw data into actionable business insights. This is where the Azure Data Factory, a cloud ETL service for scale-out serverless data integration and data transformation, comes into picture.

There are two ways of capturing the data in the Data Ingestion stage.

The first method is called the Batch Processing where a set of data is first collected over time and then fed into an analytics system to process them in group. For example, the daily sales data collected is scheduled to be processed every midnight. This is not just because midnight is the end of the day but also because the business normally ends at night and thus midnight is also the time when the servers are most likely to have more computing capacity.

Another method will be Streaming model where data is fed into analytics tools as it arrives and the data is processed in real time. This is suitable for use cases like collecting GPS data sent from the trucks because every piece of new data is generated in continuous manner and needs to be sent in real time.

Modern Data Warehouse

A modern data warehouse allows us to gather all our data at any scale easily, and to get insights through analytics, dashboard, and reports. The following image shows the data warehouse components on Azure.

Architecture diagram
Azure modern data warehouse architecture. (Image Source: Azure Docs)

For a big data pipeline, the data is ingested into Azure through Azure Data Factory in batches, or streamed near real-time using Apache Kafka, Event Hub, or IoT Hub. This data will then land in Azure Data Lake Storage long term persisted storage.

The Azure Data Lake Storage is an enterprise-wide hyper-scale repository for large volume of raw data. It is a suitable staging storage for our ingested data before the data is converted into a format suitable for data analysis. Thus, it can store any data in its native format, without requiring any prior transformations. Data Lake Storage can be accessed from Hadoop with the WebHDFS-compatible REST APIs.

As part of our data analytics workflow, we can use Azure Databricks as a platform to run SQL queries on the data lake and provide results for the dashboards in, for example, PowerBI. In addition, Azure Databricks also integrates with the MLflow machine learning platform API to support the end-to-end machine learning lifecycle from data preparation to deployment.

In the logistics industry, the need to store spatial data is greater than ever.

Let’s say a container trucking company collects data about each container delivery through an IoT device installed on the vehicle. Information such as the location and the speed of the prime mover is constantly sent from the IoT device to Azure Event Hub. We then can use Azure Databricks to correlate of the trip data, and also to enrich the correlated data with neighborhood data stored in the Databricks file system.

In addition, to process large amount of data efficiently, we can also rely on the Azure Synapse Analytics, which is basically an analytics service and a cloud data warehouse that lets us scale, compute, and store elastically and independently, with a massively parallel processing architecture.

Finally, we have Azure Analysis Services, which is an enterprise-grade analytics engine as a service. It is used to combine the data, define metrics, and secure the data in a single, trusted tabular semantic data model with enterprise-grade data models. As mentioned by Christian Wade, the Power BI Principal Program Manager in Microsoft, in March 2021, they have brought Azure Analysis Services capabilities to Power BI.

Pricing tiers available for Azure Analysis Services.

Relational Database Deployment Options on Azure and HOSTING COST

On Azure, there are two database deployment options available, i.e. IaaS and PaaS. IaaS option means that we have to host our SQL server on their virtual machines. For PaaS approach, we are able to either use Azure SQL Database, which is considered as DBaaS, or Azure SQL Managed Instance. Unless there is a need for the team to have OS-level access and control to the SQL servers, PaaS approach is normally the best choice.

Both PaaS and IaaS options include base price that covers underlying infrastructure and licensing. In IaaS, we can reduce the cost by shutting down the resources. However, in PaaS, the resources are always running unless we drop and re-create our resources when they are needed.

Cloud SQL Server options: SQL Server on IaaS, or SaaS SQL Database in the cloud.
The level of administration we have over the infrastructure and by the degree of cost efficiency. (Image Source: Azure Docs)

SQL Managed Instance is the latest deployment option which enables easy migration of most of the on-premises databases to Azure. It’s a fully-fledged SQL instance with nearly complete compatible with on-premise version of SQL server. Also, since SQL Managed Instance is built on the same PaaS service infrastructure, it comes with all PaaS features. Hence, if you would like to migrate from on-premise to Azure without management overhead but at the same time you require instance-scoped features, such as SQL Server Agent, you can try the SQL Managed Instance.

Andreas Wolter, one of the only 7 Microsoft Certified Solutions Masters (MCSM) for the Data Platform worldwide, once came to Singapore .NET Developers Community to talk about the SQL Database Managed Instance. If you’re new to SQL Managed Instance, check out the video below.

Spatial Data Types

Visibility plays a crucial role in the logistics industry because it relates to the ability of supply chain partners to be able to access and share operation information with other parties. Tracking the asset locations with GPS is one of the examples. However, how should we handle the geography data in our database?

Spatial data, also known as geospatial data, is data represented by numerical values in a geographic coordinate system. There are two types of spatial data, i.e. the Geometry Data Type, which supports Euclidean flat-earth data, and the Geography Data Type, which stores round-earth data, such as GPS latitude and longitude coordinates.

In Microsoft SQL Server, native spatial data types are used to represent spatial objects. In addition, it is able to index spatial data, provide cost-based optimizations, and support operations such as the intersection of two spatial objects. This functionality is also available in Azure SQL Database and Azure Managed Instances.

geom_hierarchy
The geometry hierarchy upon which the geometry and geography data types are based. (Image Source: SQL Docs)

Let’s say now we want to find the closest containers to a prime mover as shown in the following map.

The locations of 5 containers (marked as red) and location of the prime mover (marked as blue).

In addition, we have a table of container positions defined with the schema below.

CREATE TABLE ContainerPositions
(
    Id int IDENTITY (1,1),
    ContainerNumber varchar(13) UNIQUE,
    Position GEOGRAPHY
);

We can then simply use spatial function as shown below like STDistance, which will return the shortest distance between the two geography locations, in our query to sort the containers having the shortest to the longest distance from the prime mover.

The container “HKXU 200841-9” is the nearest container to the prime mover.

In addition, starting from version 2.2, Entity Framework Core also supports mapping to spatial data types using the NetTopologySuite spatial library. So, if you are using EF Core in your ASP .NET Core project, for example, you can easily get the mapping to spatial data types.

In the .NET Conference Singapore 2018, we announced the launch of Spatial Extension in EF Core 2.2.

Non-Relational DatabaseS on Azure

Azure Table Storage is one of the Azure services storing non-relational structured data. It provides a key/attribute store with a schema-less design. Since it’s a NoSQL datastore, it is suitable for datasets which do not require complex joins and can be denormalised for fast access.

Each of the Azure Table Storage consists of relevant entities, similar to a database row in RDBMS. Then each entity can have up to 252 properties to store the data together with a partition key. Entities with the same partition key will be stored in the same partition and the same partition server. Thus, entities with the same partition key can be queried more quickly. This also means that batch processing, the mechanism for performing atomic updates across multiple entities, can only operate on entities stored in the same partition.

In Azure Table Storage, using more partitions increases the scalability of our application. However, at the same time, using more partitions might limit the ability of the application to perform atomic transactions and maintain strong consistency for the data. We can then make use of this design to store, for example, data from each of the IoT devices in a warehouse, into different partition in the Azure Table Storage.

For a larger scale of the system, we can also design a data solution architecture that captures real-time data via Azure IoT Hub and store them into Cosmos DB which is a fast and flexible distributed database that scales seamlessly with guaranteed latency and throughput. If there is existing data in other data sources, we can also import data from data sources such as JSON files, CSV files, SQL database, and Azure Table storage to the Cosmos DB with the Azure Cosmos DB Migration Tool.

Azure Cosmos DB Migration Tool can be downloaded as a pre-compiled binary.

Globally, supply chain with Industry 4.0 is transformed into a smart and effective procedure to produce new outlines of income. Hence, the key impression motivating Industry 4.0 is to guide companies by transforming current manual processes with digital technologies.

Hard-copy of container proof of delivery (POD), for example, is still necessary in today’s container trucking industry. Hence, storing images and files for document generation and printing later is still a key feature in the digitalised supply chain workflow.

Proof of Delivery is now still mostly recorded on paper and sent via email or instant messaging services like Whatsapp. There is also no acceptable standard for what a proof of delivery form should specify. Each company more or less makes up their own rules.

On Azure, we can make use of Blob Storage to store large, discrete, binary objects that change infrequently, such as the documents like Proof of Delivery mentioned earlier.

In addition, there is another service called Azure Files available to provide serverless enterprise-grade cloud file shares. Azure Files can thus completely replace or supplement traditional on-premises file servers or NAS devices.

Hence, as shown in the screenshot below, we can upload files from a computer to the Azure File Share directly. Then the files will be accessible in another computer which is also connected to the Azure File Share, as shown below.

We can mount Azure File Share on macOS, Windows, and even Linux.

The Data Team

Setting up a new data team, especially in a startup, is a challenging problem. We need to explore roles and responsibilities in the world of data.

There are basically three roles that we need to have in a data team.

  • Database Administrator: In charge of operations such as managing the databases, creating database backups, restoring backups, monitoring database server performance, and implementing data security and access rights policy.
    • Tools: SQL Server Management Studio, Azure Portal, Azure Data Studio, etc.
  • Data Engineer: Works with the data to build up data pipeline and processes as well as apply data cleaning routine and transformations. This role is important to turn the raw data into useful information for the data analysis.
    • Tools: SQL Server Management Studio, Azure Portal, Azure Synapse Studio.
  • Data Analysis: Explores and analyses data by creating data visualisation and reporting which transforms data into insights to help in business decision making.
    • Tools: Excel, Power BI, Power BI Report Builder

In 2016, Gartner, a global research and advisory firm, shared a Venn Diagram on how data science is multi-disciplinary as shown below. Hence, there are some crucial technical skills needed, such as statistics, querying, modelling, R, Python, SQL, and data visualisation. Besides the technical skill, the team also needs to be equipped with business domain knowledge and soft skills.

The data science Venn Diagram. (Image source: Gartner)

In addition, the data team can also be organised in two manners, according to Lisa Cohen, Microsoft Principal Data Science Manager.

  • Embedded: The data science teams are spread throughout the company and each of the teams serves specific functional team in the company;
  • Centralised: There will be a core data team providing services to all functional teams across the company.

References