What is Amazon Neptune?
Amazon Neptune is a fully managed graph database service that makes it easy to build and run applications that work with highly connected datasets. Neptune supports both property graph and RDF graph models, with query languages including Apache TinkerPop Gremlin, SPARQL, and openCypher.
Built for the cloud, Neptune automatically replicates data across multiple Availability Zones, provides point-in-time recovery, continuous backup to Amazon S3, and supports read replicas for high throughput read workloads. It's optimized for storing billions of relationships and querying the graph with milliseconds latency.
Neptune Performance Calculator
Connectivity: 5 edges/vertex avg
Compute: 2 vCPUs, 16GB RAM
Replication: 6 copies across 3 AZs
Neptune Graph Models
Property Graph (Gremlin)
Vertices and edges with properties, ideal for social networks and recommendation engines.
• Directed edges with properties
• Apache TinkerPop Gremlin queries
• Flexible schema
• Complex traversals
RDF (SPARQL)
Subject-predicate-object triples, perfect for knowledge graphs and semantic web.
• SPARQL query language
• W3C standards compliant
• Ontologies and reasoning
• Semantic relationships
Neptune Core Features
High Availability
• 6-way replication across 3 AZs
• Automatic failover in 30 seconds
• Up to 15 read replicas
• Continuous backup to S3
Query Languages
• Apache TinkerPop Gremlin
• W3C SPARQL 1.1
• openCypher (preview)
• HTTP REST APIs
Serverless Option
• Auto-scaling compute capacity
• Pay per request pricing
• Instant scaling to zero
• Perfect for variable workloads
Real-World Neptune Implementations
Thomson Reuters
Uses Neptune to power their knowledge graph for financial news and analytics.
- • 1+ billion entities and relationships
- • Real-time news entity extraction
- • Financial market knowledge graphs
- • Sub-second query performance
Siemens
Leverages Neptune for industrial IoT data relationships and asset management.
- • Industrial asset relationship mapping
- • IoT sensor data correlation
- • Predictive maintenance insights
- • Global manufacturing optimization
AstraZeneca
Utilizes Neptune for drug discovery and molecular relationship analysis.
- • Molecular compound relationships
- • Drug interaction analysis
- • Research knowledge graphs
- • Clinical trial data correlation
Samsung
Powers recommendation systems and user behavior analysis with Neptune.
- • User preference modeling
- • Product recommendation graphs
- • Cross-platform user tracking
- • Real-time personalization
Neptune Query Examples
Gremlin Query (Property Graph)
Find friends of friends who like the same movies:
// Find friends of friends with similar interests
g.V().hasLabel('person').has('name', 'Alice')
.out('knows').out('knows')
.where(out('likes').in('likes').hasLabel('person').has('name', 'Alice'))
.dedup()
.values('name')
SPARQL Query (RDF)
Query knowledge graph for related concepts:
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dbp: <http://dbpedia.org/property/>
SELECT ?person ?name ?interest
WHERE {
?person foaf:name ?name ;
dbp:interest ?interest .
FILTER (CONTAINS(?interest, "machine learning"))
}
LIMIT 10
Neptune Best Practices
✅ Do
- • Use indexes on frequently queried properties
- • Implement connection pooling for better performance
- • Design graph models based on query patterns
- • Use read replicas to scale read workloads
- • Enable VPC and encryption for security
- • Monitor query performance with CloudWatch
❌ Don't
- • Create overly dense graphs without considering traversal cost
- • Use Neptune for simple key-value or tabular data
- • Ignore bulk loading best practices for large datasets
- • Create unbounded traversals without limits
- • Mix property graph and RDF data models carelessly
- • Skip query optimization and profiling