Smart cities generate vast amounts of data requiring rapid processing to improve urban management. This study investigates the application of edge computing to achieve realtime data processing in smart cities, minimizing latency and enhancing system responsiveness. Through a combination of theoretical analysis and case studies, the paper examines how edge computing can reduce data transmission delays and network congestion. The results reveal that implementing edge computing can significantly improve data efficiency in smart cities, offering a sustainable solution to meet growing urban demands.