  Edge/Fog computing is a novel computing paradigm that provides
resource-limited Internet of Things (IoT) devices with scalable computing and
storage resources. Compared to cloud computing, edge/fog servers have fewer
resources, but they can be accessed with higher bandwidth and less
communication latency. Thus, integrating edge/fog and cloud infrastructures can
support the execution of diverse latency-sensitive and computation-intensive
IoT applications. Although some frameworks attempt to provide such integration,
there are still several challenges to be addressed, such as dynamic scheduling
of different IoT applications, scalability mechanisms, multi-platform support,
and supporting different interaction models. To overcome these challenges, we
propose a lightweight and distributed container-based framework, called
FogBus2. It provides a mechanism for scheduling heterogeneous IoT applications
and implements several scheduling policies. Also, it proposes an optimized
genetic algorithm to obtain fast convergence to well-suited solutions. Besides,
it offers a scalability mechanism to ensure efficient responsiveness when
either the number of IoT devices increases or the resources become
overburdened. Also, the dynamic resource discovery mechanism of FogBus2 assists
new entities to quickly join the system. We have also developed two IoT
applications, called Conway's Game of Life and Video Optical Character
Recognition to demonstrate the effectiveness of FogBus2 for handling real-time
and non-real-time IoT applications. Experimental results show FogBus2's
scheduling policy improves the response time of IoT applications by 53\%
compared to other policies. Also, the scalability mechanism can reduce up to
48\% of the queuing waiting time compared to frameworks that do not support
scalability.
