The only thing that makes pine at all suitable for your application is low price. “How long it lasts” is more a function of how the piece is designed, used and maintained over time. If you leave it outside, overload it and don’t finish the hell out of it, then it probably won’t last more than a few months. If you keep it inside, finish it well and don’t overload it, then it can last indefinitely.
Personally, the next time I want another bookcase (could be any day) I’ll get an oak kit from Home Depot. Those kits are well designed, the pieces are cut to size better than I can do, and the kit includes all of the fasteners needed and complete instructions to make a fully functional, durable and attractive piece of furniture. All I have to do is assemble and and finish. (Actually, I finish the pieces first, and then assemble.)