There are different materials that inlays are made of, gold, porcelain and composite resins are among them. Porcelain and composite inlays and onlays are cosmetic alternatives to fillings and are very strong compared to regular white fillings. Gold inlays and onlays are also good alternatives but their appearance has made them less popular.
Your dentist will explain to you when an inlay or onlay is a good treatment option for you. In general, inlays and onlays can replace most of back teeth fillings and provide a better alternative to conventional filling. At the same time they are more conservative than crowns.
As far as the cost is concerned, because the process of making an inlay or onlay is similar to a crown, its cost is also comparable. When long-term longevity of inlays and onlays are considered, though, they can end up costing less than traditional fillings.