Mobile edge computing (MEC) literally pushes cloud computing to the life radius of end users. The state-of-the-art mobile edge applications (MEApps) are posing rigorous latency requirements to service providers, as well as the need of security and high availability. However, vulnerabilities exist for both cloud and MEC environments. In this dissertation, our goal is to create a secure MEC environment for hosting MEApps with high availability, and to encourage resource sharing by both users for their Customer-premises equipment (CPE) and service providers (SPs) for their MEC hosts. While there is a number of challenges to achieve the goal, we present four parts of work to address these challenges. We first investigate the security issues in offloading applications and analyze vulnerabilities by modules of an application. A model called EdgePlace is formulated as a stochastic programming problem with a heuristic algorithm to leverage affinity and anti-affinity host placement rules for higher availability and lower cost. We then present IoT-B&B, an architecture featuring resource sharing of physical CPE nodes, with the goal to leverage unused resources at the network edge and to share them with users across the network edge. At last, we propose EdgeChain, a model for making fair MEApps placement decisions for multiple SPs and a heuristic placement algorithm for MEApps across different SPs. The algorithm is intended to run by multiple service providers for consensus and the placement decisions can be recorded onto a blockchain for the fairness of the results.